go-cloud icon indicating copy to clipboard operation
go-cloud copied to clipboard

all: build fails on darwin

Open caarlos0 opened this issue 3 years ago • 17 comments

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 avatar Apr 08 '22 16:04 caarlos0

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

vangent avatar Apr 08 '22 16:04 vangent

I filed https://github.com/mattn/go-ieproxy/issues/34.

I will downgrade our referenced version for now.

vangent avatar Apr 08 '22 17:04 vangent

Hmm I cannot downgrade our version, same error.

vangent avatar Apr 08 '22 17:04 vangent

just verified here and it works, will open a pr

caarlos0 avatar Apr 08 '22 18:04 caarlos0

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.

caarlos0 avatar Apr 08 '22 19:04 caarlos0

@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.....

vangent avatar Apr 08 '22 23:04 vangent

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

caarlos0 avatar Apr 09 '22 00:04 caarlos0

Carlos can you try the suggestion in https://github.com/mattn/go-ieproxy/issues/34#issuecomment-1094135564?

On Fri, Apr 8, 2022, 5:20 PM Carlos Alexandro Becker < @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/google/go-cloud/issues/3114#issuecomment-1093513938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMCKTXUCT25DR5M33ZWPATVEDEL7ANCNFSM5S5BYL2A . You are receiving this because you modified the open/close state.Message ID: @.***>

vangent avatar Apr 09 '22 23:04 vangent

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

caarlos0 avatar Apr 10 '22 00:04 caarlos0

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].

vangent avatar Apr 10 '22 15:04 vangent

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 avatar Apr 10 '22 21:04 caarlos0

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?

caarlos0 avatar Apr 11 '22 00:04 caarlos0

I also filed https://github.com/Azure/azure-pipeline-go/issues/31 with azure-pipeline-go.

vangent avatar Apr 11 '22 22:04 vangent

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 ...

bep avatar Apr 13 '22 15:04 bep

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

vangent avatar Apr 14 '22 15:04 vangent

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

ankitm123 avatar Apr 28 '22 01:04 ankitm123

will there be a release soon that includes https://github.com/google/go-cloud/pull/3117? can move back to v0.24.0, would like to move forward.

jfreeland avatar May 20 '22 17:05 jfreeland

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

thanks everyone ;)

caarlos0 avatar Jun 13 '23 18:06 caarlos0