Skip to content

Comments

elfutils: disable test suite when cross-compiling#304605

Merged
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:elfutils-fix-native-cross
Apr 30, 2024
Merged

elfutils: disable test suite when cross-compiling#304605
sternenseemann merged 1 commit intoNixOS:masterfrom
sternenseemann:elfutils-fix-native-cross

Conversation

@sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Apr 16, 2024

elfutils' test suite uses uname(1) to determine if certain tests can be executed, e.g. it checks for x86_64 to learn whether it can use $CC -m64. Obviously, such checks fall flat if we are compiling from e.g. x86_64 to i686.

Instead of skipping known bad tests, just be safe and disable for “executable” cross as well.

E.g. https://github.com/roolebo/elfutils/blob/master/tests/run-disasm-x86-64.sh.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Add a 👍 reaction to pull requests you find important.

elfutils' test suite uses uname(1) to determine if certain tests can be
executed, e.g. it checks for x86_64 to learn whether it can use
$CC -m64. Obviously, such checks fall flat if we are compiling from e.g.
x86_64 to i686.

Instead of skipping known bad tests, just be safe and disable for
“executable” cross as well.
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Apr 16, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 16, 2024
sternenseemann added a commit to sternenseemann/nixpkgs that referenced this pull request Apr 19, 2024
elfutils is used in the RTS (rts/Libdw.c), i.e. it will be used on the
target platform.

Tested via pkgsCross.gnu32.haskellPackages.ghc [1], though NixOS#304605 needs
to be cherry-picked for elfutils to build.

[1]: nix-shell -E 'with import ./. { crossSystem = "i686-linux"; };
       mkShell { nativeBuildInputs = [haskellPackages.ghc ]; }'
Copy link
Contributor

@r-burns r-burns left a comment

Choose a reason for hiding this comment

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

Confirmed, and the change here LGTM.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 30, 2024
@sternenseemann sternenseemann merged commit b4710c1 into NixOS:master Apr 30, 2024
@sternenseemann sternenseemann deleted the elfutils-fix-native-cross branch April 30, 2024 12:43
sternenseemann added a commit that referenced this pull request May 26, 2024
elfutils is used in the RTS (rts/Libdw.c), i.e. it will be used on the
target platform.

Tested via pkgsCross.gnu32.haskellPackages.ghc [1], though #304605 needs
to be cherry-picked for elfutils to build.

[1]: nix-shell -E 'with import ./. { crossSystem = "i686-linux"; };
       mkShell { nativeBuildInputs = [haskellPackages.ghc ]; }'
github-actions bot pushed a commit that referenced this pull request May 26, 2024
elfutils is used in the RTS (rts/Libdw.c), i.e. it will be used on the
target platform.

Tested via pkgsCross.gnu32.haskellPackages.ghc [1], though #304605 needs
to be cherry-picked for elfutils to build.

[1]: nix-shell -E 'with import ./. { crossSystem = "i686-linux"; };
       mkShell { nativeBuildInputs = [haskellPackages.ghc ]; }'

(cherry picked from commit b868aaa)
sternenseemann added a commit that referenced this pull request May 26, 2024
elfutils is used in the RTS (rts/Libdw.c), i.e. it will be used on the
target platform.

Tested via pkgsCross.gnu32.haskellPackages.ghc [1], though #304605 needs
to be cherry-picked for elfutils to build.

[1]: nix-shell -E 'with import ./. { crossSystem = "i686-linux"; };
       mkShell { nativeBuildInputs = [haskellPackages.ghc ]; }'

(cherry picked from commit b868aaa)
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: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants