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

tests-stdenv-gcc-stageCompare: cleanup #316011

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tie
Copy link
Member

@tie tie commented May 30, 2024

Description of changes

Minor cleanup of the tests-stdenv-gcc-stageCompare. Note that the test itself is currently silently broken, see #314920 (comment). This PR does not fix that.

Parent PR:

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.11 Release Notes (or backporting 23.11 and 24.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.

Add a 👍 reaction to pull requests you find important.

@tie tie marked this pull request as ready for review May 30, 2024 22:29
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jun 2, 2024

That's a bit out of scope for my level of knowledge regarding bootstrapping

@tie
Copy link
Member Author

tie commented Jun 2, 2024

@SuperSandro2000, OK, sorry for the ping. I’m relatively new to the Nix community so I don’t know much about other members’ area of expertise. Do you happen to know someone else who can properly review this? Would be nice if someone was willing to work on fixing this test case since I’m currently out of capacity for low-level stdenv stuff with #314920 and other PRs 😅

@tie tie requested a review from roberth June 11, 2024 13:08
@tie
Copy link
Member Author

tie commented Jul 1, 2024

@wegank, could you help me with triaging this PR? Who is responsible for this part of Nixpkgs? The author of the original PR #209870 deleted GitHub account (amjoseph-nixpkgs)…

Should I move #314920 (comment) to a standalone issue?

@tie tie requested a review from wegank July 1, 2024 15:31
@wegank
Copy link
Member

wegank commented Jul 1, 2024

@trofi

@trofi
Copy link
Contributor

trofi commented Jul 1, 2024

The change looks fine.

My suggestion would be to remove stageCompare and corresponding checksum handling completely as it does not do what gcc's own do-compare does.

gcc's do-compare validates identity generated code between stage1 built with default value of -fchecking / -g (usually -fchecking=0 -g2) and -fchecking=1 -gtoggle (usually -fchecking=1 -g0). This finds real code generator bugs, like recent https://gcc.gnu.org/PR112107, https://gcc.gnu.org/PR112379, https://gcc.gnu.org/PR113445.

Side note: NIX_OUTPATH_USED_AS_RANDOM_SEED = cc.out; is needed to make the seed of built cc identical to seed of builder cc to make them closer. Otherwise they will be different as the default is randSeed=${NIX_OUTPATH_USED_AS_RANDOM_SEED:-$out}. I agree this seeding should probably not be $out-dependent. I personally use the patch below (and a few others) locally to make binary outputs more stable across minor gcc changes:

--- a/pkgs/build-support/setup-hooks/reproducible-builds.sh
+++ b/pkgs/build-support/setup-hooks/reproducible-builds.sh
@@ -8,2 +8,3 @@ NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE:-} -frandom-seed=$(
     randomseed="${outbase:0:10}"
+    randomseed=not-random-at-all
     echo $randomseed

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.

4 participants