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
Closed

Conversation

@Mic92
Copy link
Contributor

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
Contributor 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 Mar 17, 2020
Mic92 added a commit to Mic92/nixpkgs that referenced this pull request Mar 17, 2020
This will improve cross compiling in the long run.
See also NixOS#82786
@Mic92 Mic92 mentioned this pull request Mar 17, 2020
4 of 10 tasks complete
@Mic92 Mic92 requested review from Ericson2314 and removed request for Ericson2314 Mar 17, 2020
@Mic92 Mic92 force-pushed the Mic92:cross-build-go-package branch from f32cc2c to da97f74 Mar 17, 2020
@Mic92 Mic92 force-pushed the Mic92:cross-build-go-package branch 2 times, most recently from 4333691 to d04dbd7 Mar 18, 2020
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
Contributor 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?

@Mic92 Mic92 mentioned this pull request Mar 23, 2020
4 of 10 tasks complete
@Mic92 Mic92 force-pushed the Mic92:cross-build-go-package branch from 83b578b to 7b03b99 Mar 23, 2020
@Ericson2314
Copy link
Member

Ericson2314 commented Mar 23, 2020

(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

Ericson2314 commented Mar 23, 2020

@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 force-pushed the Mic92:cross-build-go-package branch from 7b03b99 to 4f2d52c Mar 28, 2020
@Mic92 Mic92 marked this pull request as ready for review Mar 28, 2020
@@ -31,7 +31,21 @@ in stdenv.mkDerivation {
avrgcc
avrbinutils
gcc-arm-embedded
gcc-armhf-embedded

This comment has been minimized.

Copy link
@Mic92
@Mic92 Mic92 force-pushed the Mic92:cross-build-go-package branch from 7cc0f84 to dcb75b8 Mar 28, 2020
In order to improve cross-compilation let's enable strictDeps
and fix what breaks.
@Mic92 Mic92 force-pushed the Mic92:cross-build-go-package branch from dcb75b8 to b4d144e Mar 28, 2020
@Mic92
Copy link
Contributor Author

Mic92 commented Mar 28, 2020

@GrahamcOfBorg build dnscrypt-proxy2

@Mic92
Copy link
Contributor Author

Mic92 commented Mar 28, 2020

Cherry-picked to ff2ea91 in staging

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.