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

buildGoPackage: enable strictDeps #82786

Closed
wants to merge 1 commit into from

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Mar 17, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member Author

Mic92 commented Mar 17, 2020

I will move this over to staging once I fixed some stuff.

@Mic92 Mic92 changed the title Cross build go package buildGoPackage: enable strictDeps Mar 17, 2020
@Mic92 Mic92 requested a review from Ericson2314 March 17, 2020 16:38
@Mic92 Mic92 mentioned this pull request Mar 17, 2020
10 tasks
@Mic92 Mic92 requested review from Ericson2314 and removed request for Ericson2314 March 17, 2020 17:24
@Mic92 Mic92 force-pushed the cross-build-go-package branch 2 times, most recently from 4333691 to d04dbd7 Compare March 18, 2020 11:16
Mic92 added a commit to Mic92/nixpkgs that referenced this pull request Mar 18, 2020
This will improve cross compiling in the long run.
See also NixOS#82786
@Mic92
Copy link
Member Author

Mic92 commented Mar 23, 2020

@LnL7 We will have the same issue with Darwin frameworks here as in #83099
Should I explicitly add the darwin services as a buildInput to buildGoPackage?

@Ericson2314
Copy link
Member

(N.B. In the other, I say go with depsTargetTargetPropagated)

@romildo
Copy link
Contributor

romildo commented Mar 23, 2020

I may not have yet understand very well the purpose of strictDeps and how it works. Is it well documented somewhere? Maybe in a blog article, or in a topic in the forum?

Why in the case of dde-api, dde-daemon, and startdde, some build dependencies needs to migrate from nativeBuildInputs to buildInputs when strictDeps is true?

@Ericson2314
Copy link
Member

@romildo There is some documentation, though not enough, in https://nixos.org/nixpkgs/manual/#chap-cross . Basically, strictDeps makes native act like cross always does, rigorously treating the various sorts of dependencies differently (e.g. run-time deps don't go on the PATH at build time, -L and -isystem flags stay separate, etc., etc).

By not having native be more permissive than cross, we make the cross builds much less likely to bitrot.

@Mic92 Mic92 marked this pull request as ready for review March 28, 2020 07:03
@@ -31,7 +31,21 @@ in stdenv.mkDerivation {
avrgcc
avrbinutils
gcc-arm-embedded
gcc-armhf-embedded
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to improve cross-compilation let's enable strictDeps
and fix what breaks.
@Mic92
Copy link
Member Author

Mic92 commented Mar 28, 2020

@GrahamcOfBorg build dnscrypt-proxy2

@Mic92
Copy link
Member Author

Mic92 commented Mar 28, 2020

Cherry-picked to ff2ea91 in staging

@Mic92 Mic92 closed this Mar 28, 2020
@Mic92 Mic92 deleted the cross-build-go-package branch March 28, 2020 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants