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

Cache more #1580

Merged
merged 7 commits into from
Sep 11, 2023
Merged

Cache more #1580

merged 7 commits into from
Sep 11, 2023

Conversation

Radvendii
Copy link
Member

Right now in the nix build we set the NICKEL_NIX_BUILD_REV environment variable, which affects the string printed by nickel --version. However, this invalidates the cache on every commit (and when building dirty), even if nothing in the code was changed it has to be recompiled in CI, and also locally if the repo is dirty.

This change puts a static string in that spot, which can then be replaced in the resulting binary with a cheap fixup derivation. That derivation will need to be rebuilt on every commit, but it's extremely fast. This only needs to be done for nickel-lang-cli, since that's the only derivation that actually uses the git revision.

flake.nix Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request September 6, 2023 15:26 Inactive
flake.nix Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request September 6, 2023 16:40 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 6, 2023 16:46 Inactive
flake.nix Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pull request September 8, 2023 14:53 Inactive
@Radvendii Radvendii added this pull request to the merge queue Sep 11, 2023
Merged via the queue into master with commit f0bf0be Sep 11, 2023
4 checks passed
@Radvendii Radvendii deleted the cache-more branch September 11, 2023 08:57
suimong pushed a commit to suimong/nickel that referenced this pull request Sep 17, 2023
* cache most of the work even if rev changes

* longer string for more reliable search.

* more recognizable dummyRev

* nickel-lang-static needs env

* appease nixpkgs-fmt

* copy meta to new derivation

* add comment
YorikSar added a commit that referenced this pull request Sep 27, 2023
#1580 introduced patching of
resulting binary in a separate derivation that ends up with bad
(or missing) code signature which prevents it from running:

   % nix run
  zsh: killed     nix run

and Console.app revealing the reason:

  Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
  Exception Codes:       UNKNOWN_0x32 at 0x00000001054e4199
  Exception Codes:       0x0000000000000032, 0x00000001054e4199

This change uses autoSignDarwinBinariesHook to sign the result that
seems to fix the problem.
github-merge-queue bot pushed a commit that referenced this pull request Sep 28, 2023
#1580 introduced patching of
resulting binary in a separate derivation that ends up with bad
(or missing) code signature which prevents it from running:

   % nix run
  zsh: killed     nix run

and Console.app revealing the reason:

  Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
  Exception Codes:       UNKNOWN_0x32 at 0x00000001054e4199
  Exception Codes:       0x0000000000000032, 0x00000001054e4199

This change uses autoSignDarwinBinariesHook to sign the result that
seems to fix the problem.
YorikSar added a commit that referenced this pull request Sep 29, 2023
#1580 introduced patching of
resulting binary in a separate derivation that ends up with bad
(or missing) code signature which prevents it from running:

   % nix run
  zsh: killed     nix run

and Console.app revealing the reason:

  Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
  Exception Codes:       UNKNOWN_0x32 at 0x00000001054e4199
  Exception Codes:       0x0000000000000032, 0x00000001054e4199

This change uses autoSignDarwinBinariesHook to sign the result that
seems to fix the problem.
yannham pushed a commit that referenced this pull request Sep 29, 2023
#1580 introduced patching of
resulting binary in a separate derivation that ends up with bad
(or missing) code signature which prevents it from running:

   % nix run
  zsh: killed     nix run

and Console.app revealing the reason:

  Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
  Exception Codes:       UNKNOWN_0x32 at 0x00000001054e4199
  Exception Codes:       0x0000000000000032, 0x00000001054e4199

This change uses autoSignDarwinBinariesHook to sign the result that
seems to fix the problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants