Skip to content

libgudev: fix cross failing to build checks#245761

Closed
lilyinstarlight wants to merge 1 commit intoNixOS:stagingfrom
lilyinstarlight:fix/libgudev-cross
Closed

libgudev: fix cross failing to build checks#245761
lilyinstarlight wants to merge 1 commit intoNixOS:stagingfrom
lilyinstarlight:fix/libgudev-cross

Conversation

@lilyinstarlight
Copy link
Member

@lilyinstarlight lilyinstarlight commented Jul 27, 2023

Description of changes

Since doCheck is still forced off for cross1, checkInputs do not get added to buildInputs. Prior to this change libgudev still tries to build the tests and fails because it can't find umockdev

Forcing tests off when doCheck is forcibly turned off fixes the libgudev build after #241939

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • x86_64-linux -> aarch64-linux (cross)
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Since `doCheck` is still forced off for cross[1], `checkInputs` do not
get added to `buildInputs`. Prior to this change libgudev still tries to
build the tests and fails because it can't find `umockdev`.

Forcing tests off when `doCheck` is forcibly turns off fixes the build.

[1] https://github.com/NixOS/nixpkgs/blob/bdddb46f4b058465ad53134d4a118671f9956662/pkgs/stdenv/generic/make-derivation.nix#L171
@lilyinstarlight lilyinstarlight added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jul 27, 2023
@lilyinstarlight lilyinstarlight requested a review from jtojnar July 27, 2023 16:40
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 27, 2023
];

mesonFlags = [
(lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck)
Copy link
Member

Choose a reason for hiding this comment

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

Why not just finalAttrs.doCheck?

Copy link
Member Author

Choose a reason for hiding this comment

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

Idk, finalAttrs.doCheck was still true and so didn't work, and I didn't look into it further 🤷🏻‍♀️

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it's because until it goes through mkDerivation, the doCheck attr still hasn't been transformed. It looks like finalAttrs is resolved after all overrides, but finalPackage is after the mkDerivationSimple transformations

@colemickens
Copy link
Member

I can't speak the quality of the specific change, but I can say this enabled me to get back to cross-compiling several of my systems on my locally applied "nixpkgs-cross" branch. Thank you!

@uninsane uninsane added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Aug 1, 2023
@uninsane
Copy link
Contributor

uninsane commented Aug 1, 2023

fixed in master: #246362

@uninsane uninsane closed this Aug 1, 2023
@lilyinstarlight lilyinstarlight deleted the fix/libgudev-cross branch August 1, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants