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

vscode-js-debug: fix missing jq in postPatch #320877

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

zeorin
Copy link
Contributor

@zeorin zeorin commented Jun 18, 2024

Fixes #320507.

The npmConfigHook used by buildNpmPackage does not correctly propagate the nativeBuildInputs into its PATH, which is why jq was not available during the patch phase.

Since this npmConfigHook is run as part of a fixed-output derivation (fetchNpmDeps), if it had already been realised, unless its hash had changed, a missing jq would not be noticed, on a rebuild of vscode-js-debug.

The postPatch hook is also run during buildNpmPackage, but there the nativeBuildInputs were correctly added to the PATH, which is why a rebuild of vscode-js-debug with the previous postPatch would succeed (if its npmDeps's hash hadn't changed).

Description of changes

Hard-coded a reference to jq using an absolute path into postPatch. Specifically, buildPackages.jq, which is equivalent to nativeBuildInputs from a cross-compilation perspective.

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.

Fixes NixOS#320507.

The `npmConfigHook` used by `buildNpmPackage` does not correctly
propagate the `nativeBuildInputs` into its `PATH`, which is why `jq` was
not available during the patch phase.

Since this `npmConfigHook` is run as part of a fixed-output
derivation (`fetchNpmDeps`), if it had already been realised, unless its
hash had changed, a missing `jq` would not be noticed, on a rebuild of
`vscode-js-debug`.

The `postPatch` hook is *also* run during `buildNpmPackage`, but there
the `nativeBuildInputs` were correctly added to the `PATH`, which is why
a rebuild of `vscode-js-debug` with the previous `postPatch` would
succeed (if its `npmDeps`'s hash hadn't changed).
Copy link
Contributor

@superherointj superherointj left a comment

Choose a reason for hiding this comment

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

Broken at master. Fixed here.

@superherointj superherointj merged commit 3bcf50f into NixOS:master Jun 18, 2024
29 checks passed
@zeorin zeorin deleted the fix-vscode-js-debug-build branch July 10, 2024 08:39
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.

Build failure: vscode-js-debug
2 participants