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

misc/swig: installing macports swig on OSX causes all.bash to fail #23469

Closed
martisch opened this issue Jan 18, 2018 · 6 comments

Comments

@martisch
Copy link
Member

commented Jan 18, 2018

tested on High Sierra 10.13.2 and Sierra 10.12.6 with go tip and swig installed from macports

replaced user names in some outputs:

High Sierra Environment

go version devel +67fdf587dc Wed Jan 17 22:05:33 2018 +0000 darwin/amd64

go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/martisch/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/martisch/go"
GORACE=""
GOROOT="/Users/martisch/go-dev"
GOTMPDIR=""
GOTOOLDIR="/Users/martisch/go-dev/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b4/8plr28vn52v25w5tv_365z4800d4hw/T/go-
build713849379=/tmp/go-build -gno-record-gcc-switches -fno-common"

swig -version

SWIG Version 3.0.12

Compiled with /usr/bin/clang++ [x86_64-apple-darwin17.0.0]

Configured options: +pcre

What did you do?

install swig from macports:
$ port install swig

$./all.bash

...
##### ../misc/cgo/life

##### ../misc/swig/stdio
# _/Users/martisch/go-dev/misc/swig/stdio
:3: Error: Unable to find 'go.swg'
FAIL	_/Users/martisch/go-dev/misc/swig/stdio [build failed]
2018/01/18 14:30:34 Failed: exit status 2

##### ../misc/swig/callback
# _/Users/martisch/go-dev/misc/swig/callback
:3: Error: Unable to find 'go.swg'
callback.swigcxx:14: Error: Unable to find 'std_string.i'
FAIL	_/Users/martisch/go-dev/misc/swig/callback [build failed]
2018/01/18 14:30:35 Failed: exit status 2

##### ../misc/cgo/test
PASS
ok  	_/Users/martisch/go-dev/misc/cgo/test	1.119s
PASS
ok  	_/Users/martisch/go-dev/misc/cgo/test	1.124s
skipped due to earlier error
skipped due to earlier error
2018/01/18 14:30:52 FAILED

/cc @ianlancetaylor

@martisch martisch changed the title misc/swig/stdio: installing swig on OSX causes all.bash to fail misc/swig: installing swig on OSX causes all.bash to fail Jan 18, 2018

@martisch

This comment has been minimized.

Copy link
Member Author

commented Jan 18, 2018

ok found the workaround from @dr2chase in #22824:

sudo port install swig-go

Similar to notes by @dr2chase @laboger in #22824 to make the test more discriminative:
Any ideas how we can make this test more sensitive/informative so others do not have to find the workaround somewhere in the go issue tracker?

@martisch martisch changed the title misc/swig: installing swig on OSX causes all.bash to fail misc/swig: installing macports swig on OSX causes all.bash to fail Jan 18, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2018

Is there any difference in the output of swig -version or swig -help or swig -go -help if you don't in stall the swig-go package?

Otherwise, if you run swig -swiglib, you should get a directory. If you don't install the swig-go package, does that directory have a subdirectory named go?

@martisch

This comment has been minimized.

Copy link
Member Author

commented Jan 19, 2018

$ swig -go -swiglib
/opt/local/share/swig/3.0.12

There is a go directory in /opt/local/share/swig/3.0.12 after installation of swig-go with macports but not before. Looking at "sudo port -v install -v swig-go" the swig-go installation mostly creates that directory including contents.

I have a go at crafting a CL that expands the test preconditions to take the above information into account when running on OSX.

@martisch martisch self-assigned this Jan 19, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2018

You'll want to edit (*tester).hasSwig in cmd/dist/test.go. Thanks.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 19, 2018

(Don't worry about only testing on darwin, it would be reasonable to run the test on any GOOS.)

@gopherbot

This comment has been minimized.

Copy link

commented Jan 20, 2018

Change https://golang.org/cl/88776 mentions this issue: cmd/dist: only run swig tests when a go directory is present in swiglib

@gopherbot gopherbot closed this in 4a7334b Jan 23, 2018

@golang golang locked and limited conversation to collaborators Jan 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.