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

Fix 'evaluation warning: ... buildGoModule: specify CGO_ENABLED with env.CGO_ENABLED instead.' #25

Conversation

onnimonni
Copy link
Contributor

I'm using your module in one of my servers and I started to see following error recently:

evaluation warning: /nix/store/1dyb7shmrf9v3xy5g2y7sajl5hhcppjd-source/pkgs/infrastructure-agent.nix:36: buildGoModule: specify CGO_ENABLED with env.CGO_ENABLED instead.

This should fix it 👍

@DavSanchez
Copy link
Owner

Hi! Thanks a lot.

I saw the CI failed with a certain error. Trying it from a local macOS also shows it:

error: The `env` attribute set cannot contain any attributes passed to derivation. The following attributes are overlapping:
  - CGO_ENABLED: in `env`: "1"; in derivation arguments: 1

Reading on similar occurrences on other places seem to be back from a 2023 problem that should be solved. Moreover, the upstream packages on unstable already include this change and could be built without issues. The diff only shows a difference in versions and corresponding hashes 🤔

Not sure what could be the issue. I assume this worked on your side. What version of Nix did you use to build the packages?

  • CI: 2.22.1
  • On local: 2.24.11

I'm updating the inputs and the version of Nix used in CI on separate PRs, after this is done, could you rebase your changes so the package builds with the latest dependency versions?

@DavSanchez
Copy link
Owner

DavSanchez commented Jan 24, 2025

Done with #26 and #27. Could you please rebase your changes with the latest master?

@onnimonni onnimonni force-pushed the get-rid-off-cgo-enabled-evaluation-warning branch from 7bd237c to 73daf35 Compare January 25, 2025 15:55
@onnimonni
Copy link
Contributor Author

Not sure what could be the issue. I assume this worked on your side. What version of Nix did you use to build the packages?

Well I got these errors with the latest Nix 2.26. I didn't actually even try them locally since I'm not sure how to do that (I'm Nix noob still).

I did the rebasing anyway so let's see 👍

@onnimonni
Copy link
Contributor Author

onnimonni commented Jan 25, 2025

I tested these changes by merging this PR into my own fork and using that as an input to my flake.

It worked just fine with nix versions 2.26 and 2.25.3. The error went away using this and my machine is still connected to New relic so I assume it works just fine 👍

EDIT: clarified my message.

@DavSanchez
Copy link
Owner

This indeed worked. Thanks! Merging 🙂

@DavSanchez DavSanchez merged commit afaa6b3 into DavSanchez:master Jan 25, 2025
8 checks passed
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 this pull request may close these issues.

2 participants