Open spacepluk opened 7 months ago
Thanks for the issue.
The new crypto library uses CGO and that requires specifying the C compiler when cross building (the env variable CC
). The compiler is different depending on the target ARCH
and OS
. I believe this was addressed properly in the release build(host is linux), but not yet addressed in versioned-binaries
.
When building natively (target matches the host), this should work properly using the host tool-chain, as you noticed.
You mentioned that this fails on windows though.
I haven't tried building on windows myself, but I can see this note in the crypto library used underneath: "To compile on Windows one has to have MinGW gcc on the %PATH%". Can you please try adding your mingw gcc to your path and see if it solves the windows native build?
For versioned-binaries
cross building, there needs to be a tool-chain installation for each host/target pair, which can be a pain to cover all combinations. Is there a specific combination that is blocking you that we should address first?
I agree that either way we should update the current versioned-binaries
target, or at least document its behaviour/assumptions.
cc @chasefleming @jribbink
Since installing all of the cross compiliers is a bit of a headache, another option we can pursue is migrating this to the same go-releaser-cross
docker workflow that is used by our CI/CD system currently. I don't think there's anything stopping us from running this locally and it would reduce the dependency to only docker instead of having to configure various cross compilers, etc.
I agree that would simplify the build and reduce the dependency to docker only. We could still leave the "binary" target for native builds only.
Good idea to reuse what we already have on CI, it seems to work 👍
Recent versions of flow-cli fail to build using
make versioned-binaries
. I used to use this to build a version of flow-cli with some minor patches on macOS and it would build all the binaries with no issues.I've tried to build
v1.12.0-cadence-v1.0.0-M8-2
,v1.14.1
andfeature/stable-cadence
and only the build that matches the host os/arch seems to work (except for windows which I couldn't manage to get it to run the makefile).Here's the output of an attempt to build on ubuntu:
Some discussion about it on discord.