Message ID | 87a6kzsu92.fsf@gmx.com |
---|---|
State | Accepted |
Headers | show |
Series | [bug#50261] gnu: node: Enable cross-compilation. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
Hello Pierre, > While working on tree-sitter I realized our node packages didn't > cross-compile [0] so I thought I'd give it a go, here's a patch! Nice! > I'm not sure there's any way to express this restriction in the package > definition, it would be good to fail in a useful way, any thoughts? I > suspect a mechanism for this isn't really worth the effort, I don't know > of any other packages like this. Yeah that's a strange limitation, I don't think we have something similar elsewhere. A restriction that compares the host and target bitness is maybe not worth it. > - (string-append (assoc-ref inputs "python") > + (string-append (assoc-ref (or native-inputs inputs) "python") You have several lines such as this one that are longer than the 78 columns limit. Other than that, it looks cool, and you can go ahead. Thanks, Mathieu
Hi Mathieu, Mathieu Othacehe <othacehe@gnu.org> writes: > Hello Pierre, > >> While working on tree-sitter I realized our node packages didn't >> cross-compile [0] so I thought I'd give it a go, here's a patch! > > Nice! > >> I'm not sure there's any way to express this restriction in the package >> definition, it would be good to fail in a useful way, any thoughts? I >> suspect a mechanism for this isn't really worth the effort, I don't know >> of any other packages like this. > > Yeah that's a strange limitation, I don't think we have something > similar elsewhere. A restriction that compares the host and target > bitness is maybe not worth it. > >> - (string-append (assoc-ref inputs "python") >> + (string-append (assoc-ref (or native-inputs inputs) "python") > > You have several lines such as this one that are longer than the 78 > columns limit. I did my best to fix those by reworking the configure flags as such: --8<---------------cut here---------------start------------->8--- (let* ((prefix (assoc-ref outputs "out")) (xflags ,(if (%current-target-system) `'("--cross-compiling" ,(string-append "--dest-cpu=" (match (%current-target-system) ((? (cut string-prefix? "arm" <>)) "arm") ((? (cut string-prefix? "aarch64" <>)) "arm64") ((? (cut string-prefix? "i686" <>)) "ia32") ((? (cut string-prefix? "x86_64" <>)) "x64") ((? (cut string-prefix? "powerpc64" <>)) "ppc64") (_ "unsupported")))) ''())) (flags (cons (string-append "--prefix=" prefix) (append xflags configure-flags)))) --8<---------------cut here---------------end--------------->8--- It's still one column over, but I figured it was OK, I couldn't find another way to write it without sacrificing readability, hope that's OK :-). > Other than that, it looks cool, and you can go ahead. Thanks for the review! Pushed with 9f7c4f380fdd86d81c805b72e4d05e9e658d3dc2 and 5ee38c467298091e98fa12be45facdcc63a59a87. Pierre
From 17cd8ccb2255d4bb392a94468abeb785e134ff1e Mon Sep 17 00:00:00 2001 From: Pierre Langlois <pierre.langlois@gmx.com> Date: Mon, 30 Aug 2021 00:25:58 +0100 Subject: [PATCH 2/2] gnu: esbuild: Disable race detector on 32-bit targets. * gnu/packages/web.scm (esbuild)[arguments]: Set the ESBUILD_RACE variable to an empty string to remove the -race option. --- gnu/packages/web.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index f0ac9ccee2..5817d2dd95 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1672,13 +1672,17 @@ used to validate and fix HTML data.") #t)))) (build-system go-build-system) (arguments - '(#:import-path "github.com/evanw/esbuild/cmd/esbuild" + `(#:import-path "github.com/evanw/esbuild/cmd/esbuild" #:unpack-path "github.com/evanw/esbuild" #:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? unpack-path #:allow-other-keys) (when tests? + ;; The "Go Race Detector" is only supported on 64-bit + ;; platforms, this variable disables it. + (unless ,(target-64bit?) + (setenv "ESBUILD_RACE" "")) (with-directory-excursion (string-append "src/" unpack-path) (invoke "make" "test-go"))) #t))))) -- 2.33.0