From: John Soo <jsoo1@asu.edu>
To: 46163@debbugs.gnu.org
Subject: [bug#46163] [PATCH] staging gnu: Add wasm32 target to rustc.
Date: Thu, 28 Jan 2021 15:31:17 -0800 [thread overview]
Message-ID: <8735ykk5a2.fsf@asu.edu> (raw)
In-Reply-To: <87bld8k9bn.fsf@asu.edu> (John Soo's message of "Thu, 28 Jan 2021 14:03:56 -0800")
[-- Attachment #1.1: Type: text/plain, Size: 73 bytes --]
Here is a fixed patch, I had rebased incorrectly. Thanks again!
- John
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-wasm32-target-to-rust-1.46.patch --]
[-- Type: text/x-patch, Size: 2900 bytes --]
From d987b267c202f985808a19ebcb98ea5845a3a241 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sat, 23 Jan 2021 08:43:52 -0800
Subject: [PATCH] gnu: Add wasm32 target to rust@1.46.
* gnu/packages/rust.scm (rust-1.46): [arguments] Add wasm32 to target
configuration, [native-inputs] Add node for tests.
---
gnu/packages/rust.scm | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index b59fe98546..7b40372cb2 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -42,6 +42,7 @@
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
+ #:use-module (gnu packages node)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages ssh)
@@ -1329,7 +1330,8 @@ move around."
`(("gcc-lib" ,gcc "lib")
,@(package-inputs base-rust)))
(native-inputs
- `(("patchelf" ,patchelf)
+ `(("node" ,node)
+ ("patchelf" ,patchelf)
,@(package-native-inputs base-rust)))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
@@ -1347,7 +1349,21 @@ move around."
(generate-all-checksums "vendor")
#t))
(replace 'build
- (lambda* _
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "config.toml"
+ (("\\[build\\]" all)
+ (string-append all "
+target = [\"" ,(nix-system->gnu-triplet-for-rust) "\", \"wasm32-unknown-unknown\"]
+"))
+ (("\\[dist\\]" all)
+ (string-append "
+[target.wasm32-unknown-unknown]
+llvm-config = \"" (assoc-ref inputs "llvm") "/bin/llvm-config\"
+cc = \"" (assoc-ref inputs "gcc") "/bin/gcc\"
+cxx = \"" (assoc-ref inputs "gcc") "/bin/g++\"
+ar = \"" (assoc-ref inputs "binutils") "/bin/ar\"
+"
+all)))
(invoke "./x.py" "build")
(invoke "./x.py" "build" "src/tools/cargo")
(invoke "./x.py" "build" "src/tools/rustfmt")
@@ -1362,7 +1378,9 @@ move around."
(string-append "-j" (number->string
(min 4
(parallel-job-count))))))
- (invoke "./x.py" parallel-job-spec "test" "-vv")
+ (invoke "./x.py" parallel-job-spec "test"
+ (string-append "--target=" ,(nix-system->gnu-triplet-for-rust))
+ "-vv")
(invoke "./x.py" parallel-job-spec "test"
"src/tools/cargo")
(invoke "./x.py" parallel-job-spec "test"
--
2.30.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
next prev parent reply other threads:[~2021-01-28 23:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 22:03 [bug#46163] [PATCH] staging gnu: Add wasm32 target to rustc John Soo
2021-01-28 23:31 ` John Soo [this message]
2021-02-15 18:04 ` John Soo
2021-02-15 18:07 ` John Soo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735ykk5a2.fsf@asu.edu \
--to=jsoo1@asu.edu \
--cc=46163@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).