https://bugzilla.redhat.com/show_bug.cgi?id=1426790
Bug ID: 1426790 Summary: Explain how to use the packaged files in Fedora, maybe in a README.Fedora file Product: Fedora Version: rawhide Component: golang Assignee: vbatts@redhat.com Reporter: opensource@till.name QA Contact: extras-qa@fedoraproject.org CC: admiller@redhat.com, amurdaca@redhat.com, golang-updates@lists.fedoraproject.org, jcajka@redhat.com, lemenkov@gmail.com, renich@woralelandia.com, s@shk.io, vbatts@redhat.com
Description of problem: I installed golang and golang-github-kr-pty-devel from Fedora as described in
https://developer.fedoraproject.org/tech/languages/go/go-installation.html https://developer.fedoraproject.org/tech/languages/go/go-packages.html
but go does not use golang-github-kr-pty-devel without /usr/share/gocode being added to $GOPATH. But if it is there, go complains that it cannot mkdir/write to /usr/share/gocode/pkg.
$ export GOPATH=/usr/share/gocode:/home/till/work $ go install till/test/pty go install github.com/kr/pty: mkdir /usr/share/gocode/pkg: permission denied $ export GOPATH=/home/till/work:/usr/share/gocode $ go install till/test/pty go install github.com/kr/pty: mkdir /usr/share/gocode/pkg: permission denied
Version-Release number of selected component (if applicable): golang-1.6.4-3.fc24
How reproducible: always
Steps to Reproduce: 1. dnf install golang-github-kr-pty-devel golang 2. mkdir -p $HOME/work/src/till/test/pty export GOPATH=$HOME/work cat > $HOME/work/src/till/test/pty <<EOF package main
import ( "github.com/kr/pty" "io" "os" "os/exec" )
func main() { c := exec.Command("grep", "--color=auto", "bar") f, err := pty.Start(c) if err != nil { panic(err) }
go func() { f.Write([]byte("foo\n")) f.Write([]byte("bar\n")) f.Write([]byte("baz\n")) f.Write([]byte{4}) // EOT }() io.Copy(os.Stdout, f) } EOF 3. go install till/test/pty
Actual results: src/till/test/pty/pty.go:4:5: cannot find package "github.com/kr/pty" in any of: /usr/lib/golang/src/github.com/kr/pty (from $GOROOT) /home/till/work/src/github.com/kr/pty (from $GOPATH)
Expected results: It should install pty to $HOME/work/bin
Additional info: It works when I do: mkdir -p $HOME/system-golang ln -s /usr/share/gocode/src/ $HOME/system-golang/src export GOPATH=$GOPATH:$HOME/system-golang
If this is the recommended way of using Fedora go packages it should be documented.
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
Till Maas opensource@till.name changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |opensource@till.name
--- Comment #1 from Till Maas opensource@till.name --- Sorry, there is a typo when creating the go file:
BAD: cat > $HOME/work/src/till/test/pty <<EOF
GOOD: cat > $HOME/work/src/till/test/pty/pty.go <<EOF
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
--- Comment #2 from Till Maas opensource@till.name --- Building seems to work with:
export GOPATH=$HOME/work:/usr/share/gocode go build till/test/pty
but AFAICS setting the GOPATH to include /usr/share/gocode also lacks documentation and it still break go install.
Thx to thm for finding this and the typo from comment 1
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
Jakub Čajka jcajka@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jchaloup@redhat.com Assignee|vbatts@redhat.com |jcajka@redhat.com
--- Comment #3 from Jakub Čajka jcajka@redhat.com --- (In reply to Till Maas from comment #2)
Building seems to work with:
export GOPATH=$HOME/work:/usr/share/gocode go build till/test/pty
This is intended way of use, if you want to use distribution libraries. I'm actually writing blog post about basic workspace setup(although definitively non-exhaustive). I will update the doc on devel portal to include these bits.
but AFAICS setting the GOPATH to include /usr/share/gocode also lacks documentation and it still break go install.
This directories are distribution provided and are write protected from regular users(IMO correctly), that leads to failure of go install(or go build -i). There is question whatever we want to ship intermediate build artifacts for non-standard libraries which IMHO we shouldn't want until we will switch to/encourage dynamic linking, system wide(if at all). Maybe possibly just for libraries that do releases and guarantee stable API(and leave it on maintainer)? I think that is definitively still open question.
CC'ed jchaloupka
Thx to thm for finding this and the typo from comment 1
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
--- Comment #5 from Jan Chaloupka jchaloup@redhat.com --- So far, all golang devel packages are used for building only. If you decide to combine distribution specific go rpms an upstream projects when running 'go install`, you could try: $ GOPATH=$HOME/work go install till/test/pty
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
--- Comment #6 from Fedora End Of Life jkurik@fedoraproject.org --- This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
https://bugzilla.redhat.com/show_bug.cgi?id=1426790
Fedora End Of Life jkurik@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CLOSED Resolution|--- |EOL Last Closed| |2018-05-29 07:44:39
--- Comment #7 from Fedora End Of Life jkurik@fedoraproject.org --- Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug.
Thank you for reporting this bug and we are sorry it could not be fixed.
golang-updates@lists.stg.fedoraproject.org