Hi

I started packaging swc but hit a weird error:

phase `patch-source-shebangs' succeeded after 0.7 seconds
starting phase `configure'
Backtrace:
           5 (primitive-load "/gnu/store/s72cf8n348fl0xdxc9w5bzdag77?")
In ice-9/eval.scm:
   191:35  4 (_ _)
In srfi/srfi-1.scm:
   863:16  3 (every1 #<procedure 6d5e20 at /gnu/store/27qw1zxljzylv?> ?)
In /gnu/store/27qw1zxljzylvm9b3jbi343gh6cngazq-module-import/guix/build/gnu-build-system.scm:
   799:28  2 (_ _)
In /gnu/store/27qw1zxljzylvm9b3jbi343gh6cngazq-module-import/guix/build/cargo-build-system.scm:
    80:20  1 (configure #:inputs _)
In unknown file:
           0 (open-file ".cargo/config" "w" #:encoding "utf-8")

ERROR: In procedure open-file:
In procedure open-file: Permission denied: ".cargo/config"

The permission on this file is: r-r-r
The .cargo-dir has: drwxr-xr-x

When I try chmodding the file via an argument I get:

building /gnu/store/jhh3xf7305080ll95f13ll7xwhvb1012-swc-0.0-1.2e22397f4.drv...
Backtrace:
          16 (primitive-load "/gnu/store/6s73l7r1x17yvbiix1danlsj87b?")
In ice-9/eval.scm:
   191:35 15 (_ #f)
   214:21 14 (_ #f)
   217:50 13 (lp (#<procedure 6d65e0 at ice-9/eval.scm:282:4 (env)> ?))
   217:50 12 (lp (#<procedure 6d65c0 at ice-9/eval.scm:282:4 (env)> ?))
   217:50 11 (lp (#<procedure 6d65a0 at ice-9/eval.scm:282:4 (env)> ?))
   217:50 10 (lp (#<procedure 6d6580 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  9 (lp (#<procedure 6d6560 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  8 (lp (#<procedure 6d6540 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  7 (lp (#<procedure 6d6520 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  6 (lp (#<procedure 6d6500 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  5 (lp (#<procedure 6d64e0 at ice-9/eval.scm:282:4 (env)> ?))
   217:50  4 (lp (#<procedure 6d64c0 at ice-9/eval.scm:282:4 (env)> ?))
   217:33  3 (lp (#<procedure 6d63c0 at ice-9/eval.scm:649:6 (env)> ?))
   293:34  2 (_ #(#<directory (guile-user) 5ce140> ((# . #<pro?>) ?)))
   173:55  1 (_ #(#<directory (guile-user) 5ce140> ((# . #<pro?>) ?)))
In unknown file:
           0 (chmod ".cargo/config" 493)

ERROR: In procedure chmod:
In procedure chmod: No such file or directory


--
Cheers Swedebugia
>From 2ef0de491f7179412d1d4f804726bd6edbc3f61d Mon Sep 17 00:00:00 2001
From: "Egil D. Priskorn" <[email protected]>
Date: Mon, 31 Dec 2018 23:54:47 +0100
Subject: [PATCH] WIP swc js-compiler, babel alternative

---
 gnu/packages/node.scm | 73 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index a0221601d..3e0a67391 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -27,7 +27,9 @@
   #:use-module (guix packages)
   #:use-module (guix derivations)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cargo)
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
   #:use-module (gnu packages base)
@@ -210,3 +212,74 @@ devices.")
               (sha256
                (base32
                 "16j1rrxkhmvpcw689ndw1raql1gz4jqn7n82z55zn63c05cgz7as"))))))
+
+(define-public swc
+  ;; No release yet.
+  (let ((commit "2e22397f42139247b2c5a6e298482efda4e92176")
+        (revision "1"))
+    (package
+      (name "swc")
+      (version (string-append "0.0-" revision "." (string-take commit 9)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/swc-project/swc.git";)
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "0jfad6zqrznfy4jhl3sff2h9l38fd2dfz2s9rx7k7wc2n66dzn4s"))))
+      (build-system cargo-build-system)
+      (arguments
+       `(#:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'permissions
+              (chmod ".cargo/config" #o755)))))
+      ;; (native-inputs
+      ;;  `(("pkg-config" ,pkg-config)))
+      (synopsis "Super-fast ECMAscript compiler written in rust.")
+      (description "swc is rust port of babel and closure compiler.
+It supports the following transforms:
+
+    es3
+        member-expression-literals
+        property-literals
+        reserved-words
+
+    es2015
+        arrow-functions
+        block-scoped-functions
+        block-scoping
+            Note: this might be buggy (at this time)
+        classes
+        computed-properties
+        destructuring
+        duplicate-keys
+        for-of
+        function-name
+        instanceof
+        literals
+        new-target
+        parameters
+        shorthand-properties
+        spread
+        sticky regex (y flag)
+        template-literals
+        typeof-symbol
+
+    es2016
+        exponentiation-operator
+
+    es2017
+        async-to-generator
+
+    es2018
+        object-rest-spread
+
+    react
+        jsx
+")
+      (home-page "")
+      (license expat
+               ;; FIXME license:apache2.0
+               ))))
-- 
2.19.2

Reply via email to