Skip to content

check-by-name/run-local.sh: Make it usable for non-CI platforms#281407

Merged
infinisil merged 1 commit intoNixOS:masterfrom
tweag:by-name-local-run-platforms
Jan 17, 2024
Merged

check-by-name/run-local.sh: Make it usable for non-CI platforms#281407
infinisil merged 1 commit intoNixOS:masterfrom
tweag:by-name-local-run-platforms

Conversation

@infinisil
Copy link
Member

@infinisil infinisil commented Jan 16, 2024

Description of changes

Since #281374, the nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work when you're trying to run it on a platform different from CI:

$ ./pkgs/tests/nixpkgs-check-by-name/scripts/run-local.sh master 
Running nixpkgs-check-by-name..
/tmp/tmp.kynXWxE3nr/tool/bin/nixpkgs-check-by-name: line 3: /nix/store/qlls5ca8q88qpyygg9ddi60gl1nmvpij-nixpkgs-check-by-name/bin/.nixpkgs-check-by-name-wrapped:
  cannot execute binary file: Exec format error
/tmp/tmp.kynXWxE3nr/tool/bin/nixpkgs-check-by-name: line 3: /nix/store/qlls5ca8q88qpyygg9ddi60gl1nmvpij-nixpkgs-check-by-name/bin/.nixpkgs-check-by-name-wrapped:
  Undefined error: 0

This PR makes it work by being clearer about platforms and making local runs check out the correct Nixpkgs to evaluate the tool from.

Things done

  • Ran run-local.sh master successfully on x86_64-linux and aarch64-darwin
  • Ran update-pinned-tool.sh for the new format.

Add a 👍 reaction to pull requests you find important.

@infinisil infinisil added this to the RFC 140 milestone Jan 16, 2024
@github-actions github-actions bot added the 6.topic: policy discussion Discuss policies to work in and around Nixpkgs label Jan 16, 2024
@infinisil infinisil force-pushed the by-name-local-run-platforms branch from 739451a to c0ed22d Compare January 16, 2024 22:17
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 17, 2024
Since NixOS#281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.

This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
@infinisil infinisil force-pushed the by-name-local-run-platforms branch from c0ed22d to 9da57b5 Compare January 17, 2024 09:45
@infinisil infinisil merged commit 9997190 into NixOS:master Jan 17, 2024
@infinisil infinisil deleted the by-name-local-run-platforms branch January 17, 2024 20:21
infinisil added a commit to tweag/nixpkgs that referenced this pull request Jan 17, 2024
- name: Fetching the pinned tool
run: |
# Get the direct /nix/store path from the pin to avoid having to evaluate Nixpkgs
toolPath=$(jq -r .ci-path pkgs/test/nixpkgs-check-by-name/scripts/pinned-tool.json)
Copy link
Member Author

Choose a reason for hiding this comment

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

Should've tested this in a separate repository. This broke CI on master very briefly before I fixed it with #281412. Only two PRs were affected:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: policy discussion Discuss policies to work in and around Nixpkgs 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant