Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: vendoredImportPath doesn't follow symbolic link correctly #11305

Closed
mikioh opened this issue Jun 19, 2015 · 8 comments
Closed

cmd/go: vendoredImportPath doesn't follow symbolic link correctly #11305

mikioh opened this issue Jun 19, 2015 · 8 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Jun 19, 2015

Tip fails build on some Unix variants.

% file /home
/home: symbolic link to usr/home

% ./all.bash
(snip)
--- FAIL: TestVendorRun (0.02s)
    go_test.go:238: running testgo [run hello.go]
    go_test.go:257: standard error:
    go_test.go:258: invalid vendoredImportPath: dir="/usr/home/x/src/cmd/go/testdata/src/vend/hello" root="/home/x/go/src/cmd/go/testdata" separator="/"

    go_test.go:267: go [run hello.go] failed unexpectedly: exit status 1
FAIL
@mikioh mikioh added this to the Go1.5Maybe milestone Jun 19, 2015
@adg
Copy link
Contributor

adg commented Jun 22, 2015

The Go tool doesn't observe symbolic links, generally. I thought we had an open issue about this but I can't find it.

@mikioh
Copy link
Contributor Author

mikioh commented Jun 22, 2015

I'm not sure which distro uses this sort of layout by default. At least it happens on my FreeBSD image which is configured with default parameters of FreeBSD installer (I guess so, maybe I chose ZFS instead of UFS) as follows:

% cat /etc/fstab 
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ada0p2             none    swap    sw              0       0
fdesc                   /dev/fd fdescfs rw              0       0

% mount -p
zroot/ROOT/default  /           zfs rw,noatime,nfsv4acls    0 0
devfs           /dev            devfs   rw,multilabel   0 0
fdescfs         /dev/fd         fdescfs rw      0 0
zroot/tmp       /tmp            zfs rw,nosuid,noatime,nfsv4acls     0 0
zroot/usr/home      /usr/home       zfs rw,noatime,nfsv4acls    0 0
zroot/usr/ports     /usr/ports      zfs rw,nosuid,noatime,nfsv4acls     0 0
zroot/usr/src       /usr/src        zfs rw,noatime,nfsv4acls    0 0
zroot/var/crash     /var/crash      zfs rw,noexec,nosuid,noatime,nfsv4acls  0 0
zroot/var/log       /var/log        zfs rw,noexec,nosuid,noatime,nfsv4acls  0 0
zroot/var/mail      /var/mail       zfs rw,nfsv4acls    0 0
zroot/var/tmp       /var/tmp        zfs rw,nosuid,noatime,nfsv4acls     0 0

I have no idea how much people would be annoyed by this limitation, maybe a few?

@adg
Copy link
Contributor

adg commented Jun 24, 2015

Yeah I've observed this symlink on FreeBSD too.

The question is whether it is just a test failure or indicative of a limitation of the Go tool? It shouldn't be a problem to have your GOPATH inside a symlinked directory. Or, rather, if it wasn't a problem in Go 1.4 it shouldn't become a problem now.

@mikioh
Copy link
Contributor Author

mikioh commented Jun 24, 2015

FWIW, if you are using ZFS, only thing you have to do is just;

# zfs set mountpoint=/home $(storagePoolName)/usr/home

@ebfe
Copy link
Contributor

ebfe commented Jun 24, 2015

I have no idea how much people would be annoyed by this limitation, maybe a few?

At least one. I don't think it is new, I ran into this before.

FWIW, if you are using ZFS, only thing you have to do is just;
zfs set mountpoint=/home $(storagePoolName)/usr/home

A less intrusive fix is to change your home directory to the path without symlink in /etc/passwd.
It's especially annoying on machines where you don't have root access, as you have to remember to do a cd /usr/home/<me> before using go.

@sam3000
Copy link

sam3000 commented Jun 25, 2015

I have no idea how much people would be annoyed by this limitation, maybe a few?

It's fairly common for /home to be symlinked.

Is the vendor import behaviour itself broken or is it just the test ? If it's just the test, then I imagine this is no biggie. If vendoring itself won't work in a symlinked path, then IMO that should be fixed.

@mikioh
Copy link
Contributor Author

mikioh commented Jun 25, 2015

See https://groups.google.com/d/msg/golang-dev/74zjMON9glU/4lWCRDCRZg0J.

Vanilla Go 1.4 source tree doesn't have this issue. As @adg said above, someone will disable TestVendorRun before the Go 1.5 cutoff when there's no easy fix.

@gopherbot
Copy link

CL https://golang.org/cl/12194 mentions this issue.

@rsc rsc closed this as completed in 9adf684 Jul 15, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 16, 2015
@golang golang locked and limited conversation to collaborators Jul 18, 2016
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants