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

meson: Clean up build and infra #86080

Merged
merged 3 commits into from Apr 28, 2020
Merged

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Apr 26, 2020

Motivation for this change

The big thing that happened is that mesonbuild/meson#6363 was finally merged!

Fixes #58831

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.

CC @matthewbauer @jtojnar

I've since convinced upstream to not use such vars for the build
platform during cross. Finally!
@ofborg ofborg bot added the 6.topic: stdenv Standard environment label Apr 26, 2020
@worldofpeace
Copy link
Contributor

The big thing that happened is that #6363 was finally merged!

That seems like it's unrelated

@Ericson2314
Copy link
Member Author

Oops sorry! meant mesonbuild/meson#6363

@Ericson2314 Ericson2314 changed the base branch from master to staging April 27, 2020 12:53
pkgs/stdenv/generic/make-derivation.nix Show resolved Hide resolved
armv7l = "arm";
i686 = "x86";
x86_64 = "x86_64";
};
Copy link
Member

Choose a reason for hiding this comment

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

I think this should default to the cpu.name when none match.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair, but let's do that in a follow-up? I just moved it as-is for now.

pkgs/stdenv/generic/make-derivation.nix Outdated Show resolved Hide resolved
pkgs/stdenv/generic/make-derivation.nix Outdated Show resolved Hide resolved
};
crossFile = builtins.toFile "cross-file.conf" (''
[properties]
needs_exe_wrapper = true
Copy link
Member

Choose a reason for hiding this comment

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

I don’t think we should set this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it was what was there so I rather change separately, but I do agree. Didn't you make a thing just for this sort of thing?

@FRidh FRidh added this to WIP in Staging via automation Apr 27, 2020
@FRidh FRidh moved this from WIP to Needs review in Staging Apr 27, 2020
See comment in code and the PR it references,
mesonbuild/meson#6827, for details.

We can remove entries from the cross file because they will be gotten
from env vars now.
@Ericson2314
Copy link
Member Author

@matthewbauer so what i ended up doing is removing most of the items from [binaries] as 1) meson with my tiny patch will just grab from env vars, even during cross, and 2) that avoids hasCC altogether.

The cross file is added in the `mkDerivation`. It isn't nice putting
build tool-specific stuff here, but our current architecture gives us
little alternative.
Staging automation moved this from Needs review to Ready Apr 28, 2020
@Ericson2314 Ericson2314 merged commit 941d276 into NixOS:staging Apr 28, 2020
Staging automation moved this from Ready to Done Apr 28, 2020
@Ericson2314 Ericson2314 deleted the fix-meson-cross branch April 28, 2020 17:38
@Ericson2314
Copy link
Member Author

Ugh I missed ofborg telling me I broke eval on staging. Fixing in a moment.

gnomesysadmins pushed a commit to GNOME/gobject-introspection that referenced this pull request May 17, 2020
Actually, we shouldn't really need this. We are building `native: false`
binaries so when we look up a `native: true` binary the override should
not apply. I've fixed this upstream in meson in
NixOS/nixpkgs#86080, though some backwards
compatibility migration might be in order.

In the meantime, we can make `gi_cross_use_host_gi` prevent the
overrides from happening, which will achieve the desired behavior.

Finally, this allows us to use `find_program` in `scanner_command`,
unconditionally, letting the presence of the override dictate whether a
freshly-built or pre-built `g-ir-scanner` is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

Meson overrides compiler, ignoring stdenv
3 participants