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

all: build fails on darwin #3114

Closed
caarlos0 opened this issue Apr 8, 2022 · 18 comments · Fixed by #3117
Closed

all: build fails on darwin #3114

caarlos0 opened this issue Apr 8, 2022 · 18 comments · Fixed by #3117

Comments

@caarlos0
Copy link
Contributor

caarlos0 commented Apr 8, 2022

Describe the bug

Building things that use this library seems to yield an error on darwin, both amd64 and arm64.

Example output:

❯ GOOS=darwin GOARCH=arm64 go build .
# github.com/mattn/go-ieproxy
../../Go/pkg/mod/github.com/mattn/[email protected]/ieproxy.go:36:9: undefined: getConf
../../Go/pkg/mod/github.com/mattn/[email protected]/ieproxy.go:41:9: undefined: reloadConf
../../Go/pkg/mod/github.com/mattn/[email protected]/ieproxy.go:48:2: undefined: overrideEnvWithStaticProxy
../../Go/pkg/mod/github.com/mattn/[email protected]/ieproxy.go:53:13: psc.findProxyForURL undefined (type *ProxyScriptConf has no field or method findProxyForURL, but does have FindProxyForURL)

To Reproduce

GOOS=darwin GOARCH=arm64 go build .

Expected behavior

Build just fine.

Version

0.25.

Additional context

v0.24 works fine. It seems that its related to the update of go-ieproxy to v0.0.3.

caarlos0 added a commit to goreleaser/goreleaser that referenced this issue Apr 8, 2022
v0.25.0 breaks the build on darwin.

reverts #3018
refs google/go-cloud#3114

Signed-off-by: Carlos A Becker <[email protected]>
@vangent
Copy link
Contributor

vangent commented Apr 8, 2022

Can you file a bug for mattn/go-ieproxy? I don't think this is something that go-cloud can fix.

@vangent
Copy link
Contributor

vangent commented Apr 8, 2022

I filed mattn/go-ieproxy#34.

I will downgrade our referenced version for now.

@vangent
Copy link
Contributor

vangent commented Apr 8, 2022

Hmm I cannot downgrade our version, same error.

@caarlos0
Copy link
Contributor Author

caarlos0 commented Apr 8, 2022

just verified here and it works, will open a pr

@caarlos0
Copy link
Contributor Author

caarlos0 commented Apr 8, 2022

check #3116

to test I made a cmd/main.go with:

package main

import (

	// Import the blob packages we want to be able to open.
	_ "gocloud.dev/blob/azureblob"
	_ "gocloud.dev/blob/gcsblob"
	_ "gocloud.dev/blob/s3blob"

	// import the secrets packages we want to be able to be used.
	_ "gocloud.dev/secrets/awskms"
	_ "gocloud.dev/secrets/azurekeyvault"
	_ "gocloud.dev/secrets/gcpkms"
)

func main() {
	print(1)
}

and built with:

GOOS=darwin GOARCH=amd64 go build -o foo ./cmd/

before this change it failed, after it compiled as expected.

@vangent
Copy link
Contributor

vangent commented Apr 8, 2022

@caarlos0

Can you verify which version of ie-proxy you ended up using?

Our test suite does build on Darwin, and when I tried downgrading to the 0.0.2 version, it reproduced what you were seeing. However the 0.0.3 version seemed to work.....

@caarlos0
Copy link
Contributor Author

caarlos0 commented Apr 9, 2022

i was using v0.0.3, downgraded to v0.0.1, which was the one used on go-cloud v0.24

@vangent
Copy link
Contributor

vangent commented Apr 9, 2022 via email

@caarlos0
Copy link
Contributor Author

I don't really want to add all the cgo complication to goreleaser unless its something we really cannot avoid...

@vangent
Copy link
Contributor

vangent commented Apr 10, 2022

If I am reading the bugs correctly, this works fine when you're actually compiling on Darwin; it fails when you are cross-compiling. Is that correct?

go mod graph shows Go CDK is pulling in this dependency from github.com/Azure/[email protected].

@caarlos0
Copy link
Contributor Author

If I am reading the bugs correctly, this works fine when you're actually compiling on Darwin; it fails when you are cross-compiling. Is that correct?

that's likely related to default CGO_ENABLED behavior, forcing cgo disabled on darwin causes the same issue...

@caarlos0
Copy link
Contributor Author

go mod graph shows Go CDK is pulling in this dependency from github.com/Azure/[email protected].

looking at the src of that lib, seems like it doesn't really use/need ieproxy v0.0.3 though...

maybe add a build test with cgo disabled and keep using the old one?

@vangent
Copy link
Contributor

vangent commented Apr 11, 2022

I also filed Azure/azure-pipeline-go#31 with azure-pipeline-go.

@bep
Copy link

bep commented Apr 13, 2022

I hit this with the latest Hugo release today, as I had upgraded to gocloud.dev v0.25.0, downgraded now to what we had before, v0.20.0, and crossing fingers ...

@vangent
Copy link
Contributor

vangent commented Apr 14, 2022

@bep v0.24.0 should be OK if you want to try it.

@ankitm123
Copy link

ankitm123 commented Apr 28, 2022

can confirm 0.24.0 works with darwin builds!
Pinning go-ieproxy to 0.0.1 made it work.

@jfreeland
Copy link

will there be a release soon that includes #3117? can move back to v0.24.0, would like to move forward.

@caarlos0
Copy link
Contributor Author

if I'm not mistaken, this has been fixed and released, so, closing :)

thanks everyone ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants