-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Build failure: iosevka
(with custom build plan)
#261820
Comments
If I read the log correctly, the error occurs when building NodeJS. In this case its NodeJS 18, in #261817 it's the exact same error message, but for NodeJS 14. |
I don't have a Mac, so I can't test things, but the following patch should fix things: From d55ffa42ffecdf2250254885e1886e39702e267a Mon Sep 17 00:00:00 2001
From: Florian Warzecha <[email protected]>
Date: Wed, 18 Oct 2023 23:14:06 +0200
Subject: [PATCH] nodejs: fix build on darwin architectures
---
pkgs/development/web/nodejs/nodejs.nix | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 8b615a55dd3a..bbb4ca93b601 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -120,6 +120,11 @@ let
inherit patches;
+ postPatch = ''
+ chmod +x ./gyp-mac-tool
+ patchShebangs ./gyp-mac-tool
+ '';
+
doCheck = lib.versionAtLeast version "16"; # some tests fail on v14
# Some dependencies required for tools/doc/node_modules (and therefore
--
2.42.0 For |
Thanks for the really quick reply! I applied an overlay containing the following: nodejs = prev.nodejs.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
chmod +x ./gyp-mac-tool
patchShebangs ./gyp-mac-tool
'';
}); Unfortunately, I receive the following error...
...the key part of which seems to be "chmod: cannot access './gyp-mac-tool': No such file or directory". |
I inserted this at the beginning of the addition to
The output was:
|
Thanks for trying that out and searching for the file :) In the meantime, I found out that the node build process automatically generates that executable during the build process. The following patch changes the base file used for generation instead:
|
Hm, I’ll try building node on |
I've tried your latest patch, @liketechnik, but it causes a number of test failures (although I'm not confident that these aren't the result of macOS interfering with the tests due to network permissions or some such 🙄). https://gist.github.com/nerosnm/33a525e9abbc27096090f78f25789a62 (Sorry the logs are so long!) |
I'm pretty much clueless about this (I haven't worked on/with NodeJS nor MacOS), so this most likely needs somebody else to take a look at. But, on a quick glance, nodejs/node#25353 looks like it's the same issue (same Testsuite, same error condition, i.e. |
Wrt failing test with the patch above, this is Nix on Darwin with Edit: The following patch should fix the issue, and it doesn’t look like patched shebang leaks to the derivation output. From 11ba0ba3672f42fcb5a439fb7bcd954579558bb2 Mon Sep 17 00:00:00 2001
From: Ivan Trubach <[email protected]>
Date: Thu, 19 Oct 2023 21:20:15 +0300
Subject: [PATCH] nodejs: fix sandboxed build on darwin
---
pkgs/development/web/nodejs/nodejs.nix | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 8b615a55dd3a..69f0cb3afc50 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -120,6 +120,15 @@ let
inherit patches;
+ # Used at build time, but not copied to the output, so we should not get
+ # Python reference in the output.
+ # See also https://github.com/NixOS/nixpkgs/issues/261820
+ postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+ patchShebangs --build tools/gyp/pylib/gyp/mac_tool.py
+ '';
+
+ __darwinAllowLocalNetworking = true; # for tests
+
doCheck = lib.versionAtLeast version "16"; # some tests fail on v14
# Some dependencies required for tools/doc/node_modules (and therefore |
I’ve opened PR that should fix this issue, but I won’t have enough time to properly test this until Saturday. |
The latest patch does fix the
|
I'm really confused about this now. My own original gist doesn't contain the same log I was expecting it to, looking back. You're right that the original log reflects a build failure in the Edit: also, sorry, I can't find any interface to |
I’m more in favor of 1.ii option, that is, explicitly invoking python3 interpreter in the generated build configuration. The behavior should be identical to |
@nerosnm, feel free to try #262124, it applies tie/gyp-next@2c73b79 to gyp, I’ll open upstream PR tomorrow if this works for you. With this PR, I can build Node.js, |
@tie thanks, I'll try it out. Might take some time, as it appears to require me to build 502 packages from source... |
@nerosnm, sorry if this is a bit late, it looks like staging branch bumped LLVM/clang version used on macOS, so Node.js v18 build fails due to If you are not cherry-picking changes from the PR on top of stable Nixpkgs branch fork, you can apply the PR as an overlay, for example: {
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05";
systems.url = "systems";
# See https://github.com/NixOS/nixpkgs/pull/262124
nixpkgs-pr-262124.url = "github:NixOS/nixpkgs/refs/pull/262124/head";
};
outputs = inputs: {
legacyPackages = inputs.nixpkgs.lib.genAttrs (import inputs.systems) (system:
import inputs.nixpkgs {
localSystem = { inherit system; };
overlays = [ inputs.self.overlays.backports ];
});
overlays.backports = final: prev:
let
nodejsPath = inputs.nixpkgs-pr-262124 + "/pkgs/development/web/nodejs";
nodeVersion = x: final.callPackage (nodejsPath + "/v${x}.nix");
v14 = nodeVersion "14";
v16 = nodeVersion "16";
v18 = nodeVersion "18";
v20 = nodeVersion "20";
in
{
nodejs_14 = v14 { openssl = final.openssl_1_1; };
nodejs-slim_14 = v14 { enableNpm = false; openssl = final.openssl_1_1; };
nodejs_16 = v16 { };
nodejs-slim_16 = v16 { enableNpm = false; };
nodejs_18 = v18 { };
nodejs-slim_18 = v18 { enableNpm = false; };
nodejs_20 = v20 { };
nodejs-slim_20 = v20 { enableNpm = false; };
};
};
} |
Thanks - I was applying it as an overlay, but not as comprehensively/cleanly as your suggestion. I did in fact run into the v18 build failure you mentioned; I'll try again with your suggested overlay (unless you're saying the errors are unresolved?). |
Yes, that patch works for me! Thank you so much. |
Do you know if there's been any progress on this anywhere? |
@nerosnm, unfortunately, upstream PR nodejs/gyp-next#216 is not getting enough attention. I’ve pinged the reviewer, so hopefully we’ll get a decision on this change. Meanwhile, I’ve rebased #262124. flake.nix{
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
systems.url = "systems";
# See https://github.com/NixOS/nixpkgs/pull/262124
nixpkgs-pr-262124.url = "github:NixOS/nixpkgs/refs/pull/262124/head";
};
outputs = inputs: {
legacyPackages = inputs.nixpkgs.lib.genAttrs (import inputs.systems) (system:
import inputs.nixpkgs {
localSystem = { inherit system; };
overlays = [ inputs.self.overlays.backports ];
});
overlays.backports = final: prev:
let
nodejsPath = inputs.nixpkgs-pr-262124 + "/pkgs/development/web/nodejs";
nodeVersion = x: final.callPackage (nodejsPath + "/v${x}.nix");
v18 = nodeVersion "18";
v20 = nodeVersion "20";
v21 = nodeVersion "21";
in
{
nodejs_18 = v18 { };
nodejs-slim_18 = v18 { enableNpm = false; };
nodejs_20 = v20 { };
nodejs-slim_20 = v20 { enableNpm = false; };
nodejs_21 = v21 { };
nodejs-slim_21 = v21 { enableNpm = false; };
};
};
} |
Steps To Reproduce
Steps to reproduce the behavior:
iosevka
package at nixpkgs commit 80e825e:Build log
the error at the end of the full log is:
Additional context
this problem was introduced at commit 80e825e (determined by bisecting nixpkgs). i'm on an aarch64-darwin machine.
Notify maintainers
maintainers:
iosevka
: @jfrankenau, @ttuegel, @babariviere, @rileyinman, @AluisioASG, @lunik1nodejs
: @cillianderoiste, @gilligan, @cko, @marsamMetadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: