Skip to content

findProxyForURL with cgo on windows #45

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

Closed
chrislusf opened this issue Oct 17, 2022 · 8 comments · Fixed by #47
Closed

findProxyForURL with cgo on windows #45

chrislusf opened this issue Oct 17, 2022 · 8 comments · Fixed by #47

Comments

@chrislusf
Copy link

Found a similar problem as #43 on windows

GOOS=windows go build
# github.com/mattn/go-ieproxy
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:22:6: getConf redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:6:6: other declaration of getConf
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:28:6: reloadConf redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:10:6: other declaration of reloadConf
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:133:6: overrideEnvWithStaticProxy redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:14:6: other declaration of overrideEnvWithStaticProxy
../../../../../pkg/mod/github.com/mattn/[email protected]/pac_windows.go:9:29: ProxyScriptConf.findProxyForURL redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/pac_unix.go:6:29: other declaration of findProxyForURL
@mattn
Copy link
Owner

mattn commented Oct 17, 2022

What is your go env ?

@chrislusf
Copy link
Author

> go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/chrislu/Library/Caches/go-build"
GOENV="/Users/chrislu/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/chrislu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/chrislu/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jv/0rlhdck17jzgt7b3hcnq63mc0000gp/T/go-build247650256=/tmp/go-build -gno-record-gcc-switches -fno-common"

@chrislusf
Copy link
Author

@mattn
Copy link
Owner

mattn commented Oct 17, 2022

CC="clang"
CXX="clang++"

You are using host C compiler. It MUST be cross C compiler for Windows.

@chrislusf
Copy link
Author

Correct. Need to build for windows with github actions.

@leeweisberger
Copy link

leeweisberger commented Nov 1, 2022

This is also breaking our release train for windows with github actions. Same error as originally posted.

@muhyuddin
Copy link

muhyuddin commented Nov 7, 2022

Found a similar problem as #43 on windows

GOOS=windows go build
# github.com/mattn/go-ieproxy
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:22:6: getConf redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:6:6: other declaration of getConf
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:28:6: reloadConf redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:10:6: other declaration of reloadConf
../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_windows.go:133:6: overrideEnvWithStaticProxy redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/ieproxy_unix.go:14:6: other declaration of overrideEnvWithStaticProxy
../../../../../pkg/mod/github.com/mattn/[email protected]/pac_windows.go:9:29: ProxyScriptConf.findProxyForURL redeclared in this block
	../../../../../pkg/mod/github.com/mattn/[email protected]/pac_unix.go:6:29: other declaration of findProxyForURL

Any solution?

Facing the same issue on Linux, compiling for Windows, CGO is not enabled.

@abemedia
Copy link

Had the same issue building on Windows with CGO.
Reverting to v0.0.7 fixed the issue so just add the following to your go.mod as a temporary workaround:

replace github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.7

Weirdly this only seemed to affect 386 arch (using CC=i686-w64-mingw32-gcc and CXX=i686-w64-mingw32-g++).
Might wanna add a test for that in GitHub actions...

iwahbe added a commit to pulumi/pulumi-f5bigip that referenced this issue Feb 13, 2023
Can unpin after mattn/go-ieproxy#45 closes. It
looks like there is a PR to fix.
@mattn mattn closed this as completed in #47 May 20, 2023
chrislusf added a commit to seaweedfs/seaweedfs that referenced this issue May 21, 2023
andrzej-stencel added a commit to andrzej-stencel/opentelemetry-collector-releases that referenced this issue Sep 25, 2024
…package

The replacement for the package `github.com/mattn/go-ieproxy` is currently in effect
and replaces `v0.0.11` of the package with version `v0.0.1`.
I believe this replacement is not necessary anymore,
as the issue mattn/go-ieproxy#45 was fixed mattn/go-ieproxy#47
in v0.0.11.
andrzej-stencel added a commit to open-telemetry/opentelemetry-collector-releases that referenced this issue Oct 7, 2024
…package (#678)

The replacement for the package `github.com/mattn/go-ieproxy` is currently in effect
and replaces `v0.0.11` of the package with version `v0.0.1`.
I believe this replacement is not necessary anymore,
as the issue mattn/go-ieproxy#45 was fixed mattn/go-ieproxy#47
in v0.0.11.

Co-authored-by: Alex Boten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants