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

cloudflare/circl dependency makes it difficult to compile without cgo for amd64 #185

Open
pfiaux opened this issue Sep 19, 2023 · 2 comments

Comments

@pfiaux
Copy link

pfiaux commented Sep 19, 2023

I initially reported this in google/go-github#2932 but it is also relevant here depending on how you intend this library to be used (with our without cgo).

I'm running into a slightly obscure build problem. Using bazel (and gazelle and rules_go) to build worked fine both for arm64 and amd64. I recently tried to bump to a package which uses go-crypto as a dependency and found myself unable to build for amd64 via bazel.

The dependency github.com/cloudflare/circl was bumped from v1.1.0 to v1.3.3. The problem is that it includes some platform specific files changes (*_amd64.go) for some packages, some headers and some assembly. It's not new but some changes seem to have been introduced which changed the behavior of the build.

Unfortunately led to some issues trying to build via bazel with dependencies not detected:

external/com_github_cloudflare_circl/dh/x25519/curve_amd64.s:7: #include: open external/com_github_cloudflare_circl/math/fp25519/fp_amd64.h: no such file or directory

From what I can tell it would be possible to specify the purego build tag to avoid this behavior but it's a bit cumbersome to use a manual rather than the cgo builtin tag.

@ibexmonj
Copy link

I am experiencing the same issue when pulling in circl v1.3.3 as dependency.

How did you unblock yourself here ?

@pfiaux
Copy link
Author

pfiaux commented Oct 29, 2024

The maintainers of go-github (see the issue linked above) ended up changing their package slightly and removing the dependency on circl which solved the problem for good.

Before that I think we had to patch circl we were using go_repository(). I don't remember exactly but it was likely something with the go flags in those files and having a noop version for our platform targets.

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

No branches or pull requests

2 participants