Skip to content

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

Description

@pfiaux

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions