Bug 1426790 - Explain how to use the packaged files in Fedora, maybe in a README.Fedora file
Summary: Explain how to use the packaged files in Fedora, maybe in a README.Fedora file
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: golang
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Čajka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-24 21:14 UTC by Till Maas
Modified: 2018-05-29 11:44 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-05-29 11:44:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Till Maas 2017-02-24 21:14:03 UTC
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.

Comment 1 Till Maas 2017-02-24 21:34:44 UTC
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

Comment 2 Till Maas 2017-02-24 21:37:55 UTC
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

Comment 3 Jakub Čajka 2017-02-27 16:25:44 UTC
(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

Comment 4 Fedora End Of Life 2017-02-28 12:26:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 5 Jan Chaloupka 2017-02-28 13:20:26 UTC
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

Comment 6 Fedora End Of Life 2018-05-03 07:57:49 UTC
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.

Comment 7 Fedora End Of Life 2018-05-29 11:44:39 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.