]> Cypherpunks repositories - gostls13.git/commitdiff
misc/android,misc/ios: evaluate current working directory symlinks
authorElias Naur <mail@eliasnaur.com>
Fri, 1 Mar 2019 07:25:35 +0000 (08:25 +0100)
committerElias Naur <mail@eliasnaur.com>
Fri, 1 Mar 2019 16:41:38 +0000 (16:41 +0000)
Previous CLs added symlink evaulation to GOROOT and GOPATH.
Unfortunately that only fixed tests that ran outside GOROOT.

To fix the standard library tests, evaluate symlinks in the current
working directory as well.

Change-Id: Ia406a968235ae4321a1002567520105998582d15
Reviewed-on: https://go-review.googlesource.com/c/164699
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/android/go_android_exec.go
misc/ios/go_darwin_arm_exec.go

index 55461df31aa8f2fd0ec793b6faa1804ac27f6f9a..9a4e2afc80373873c0e87d741906ea04d44a0ea7 100644 (file)
@@ -156,6 +156,10 @@ func subdir() (pkgpath string, underGoRoot bool) {
        if err != nil {
                log.Fatal(err)
        }
+       cwd, err = filepath.EvalSymlinks(cwd)
+       if err != nil {
+               log.Fatal(err)
+       }
        goroot, err := filepath.EvalSymlinks(runtime.GOROOT())
        if err != nil {
                log.Fatal(err)
index 3eb1757e8f84a0cd50c82a3c17438497bf1d6786..6a3d9def68208d3fd07e4e0dfd483f8c8e4f8e56 100644 (file)
@@ -633,6 +633,10 @@ func subdir() (pkgpath string, underGoRoot bool, err error) {
        if err != nil {
                return "", false, err
        }
+       cwd, err = filepath.EvalSymlinks(cwd)
+       if err != nil {
+               log.Fatal(err)
+       }
        goroot, err := filepath.EvalSymlinks(runtime.GOROOT())
        if err != nil {
                return "", false, err