From: Danny Milosavljevic <dannym@scratchpost.org>
To: Nikolai Merinov <nikolai.merinov@member.fsf.org>
Cc: adam@vany.ca, 29555@debbugs.gnu.org
Subject: [bug#29555] [PATCHv3] gnu: rust: update rust to 1.22.1 and cargo to 1.23.0
Date: Sun, 10 Dec 2017 10:27:23 +0100 [thread overview]
Message-ID: <20171210102719.0c6198c2@scratchpost.org> (raw)
In-Reply-To: <87bmj7mqz8.fsf_-_@member.fsf.org>
Wow! Nice.
Review below:
+ ;; guix llvm-3.9.1 package install only shared libraries
"installs"
+ (setenv "LLVM_LINK_SHARED" "1")
+ (add-after 'patch-source-shebangs 'patch-cargo-checksums
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "src/Cargo.lock"
+ (("(\"checksum .* = )\".*\"" all name)
+ (string-append name "\"" ,%cargo-reference-hash "\"")))
+ (for-each
+ (lambda (filename)
+ (use-modules (guix build cargo-build-system))
+ (delete-file filename)
+ (let* ((dir (dirname filename)))
+ (display (string-append
+ "patch-cargo-checksums: generate-checksums for "
+ dir "\n"))
+ (generate-checksums dir ,%cargo-reference-project-file)))
+ (find-files "src/vendor" ".cargo-checksum.json"))))
Hmm, should return #t on success.
- (add-after 'install 'wrap-rustc
+ (jemalloc (assoc-ref inputs "jemalloc")))
+ (call-with-output-file "config.toml"
+ (lambda (port)
+ (display (string-append "
+[llvm]
+[build]
+cargo = \"" cargo "/bin/cargo" "\"
+rustc = \"" rustc "/bin/rustc" "\"
+python = \"" python "/bin/python2" "\"
+gdb = \"" gdb "/bin/gdb" "\"
+vendor = true
+submodules = false
+[install]
+prefix = \"" out "\"
+[rust]
+default-linker = \"" gcc "/bin/gcc" "\"
+default-ar = \"" binutils "/bin/ar" "\"
+channel = \"stable\"
+rpath = true
+# There is 2 failed codegen tests:
+# codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs
+# This tests required patched LLVM
+codegen-tests = false
+[target." %host-type "]
+llvm-config = \"" llvm "/bin/llvm-config" "\"
+cc = \"" gcc "/bin/gcc" "\"
+cxx = \"" gcc "/bin/g++" "\"
+jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
+[dist]
+") port))))))
Should return #t on success.
+ (add-before 'build 'reset-timestamps-after-changes
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (define ref (stat "README.md"))
+ (for-each
+ (lambda (filename)
+ (set-file-time filename ref))
+ (find-files "." #:directories? #t))))
Same
+ (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums
(lambda* (#:key inputs #:allow-other-keys)
- (let* ((gcc (assoc-ref inputs "gcc"))
- (cc (string-append gcc "/bin/gcc")))
- (mkdir ".cargo")
- (call-with-output-file ".cargo/config"
- (lambda (p)
- (format p "
+ (substitute* "Cargo.lock"
+ (("(\"checksum .* = )\".*\"" all name)
+ (string-append name "\"" ,%cargo-reference-hash "\"")))
+ (for-each
+ (lambda (filename)
+ (use-modules (guix build cargo-build-system))
+ (delete-file filename)
+ (let* ((dir (dirname filename)))
+ (display (string-append
+ "patch-cargo-checksums: generate-checksums for "
+ dir "\n"))
+ (generate-checksums dir ,%cargo-reference-project-file)))
+ (find-files "vendor" ".cargo-checksum.json"))))
Same
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* "tests/build.rs"
+ (("/usr/bin/env") (which "env"))
+ ;; Guix llvm compiled without asmjs-unknown-emscripten at all
+ (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
+ (substitute* "tests/death.rs"
+ ;; Stuck when built in container
+ (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
+ (mkdir ".cargo")
+ (call-with-output-file ".cargo/config"
+ (lambda (port)
+ (display "
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = 'vendor'
-")))
- (setenv "CMAKE_C_COMPILER" cc)
- (setenv "CC" cc))
- #t))
- (delete 'configure))))
+" port)))
+ ;; Disable test for cross compilation support
+ (setenv "CFG_DISABLE_CROSS_TESTS" "1")
+ (setenv "SHELL" (which "sh"))
+ (setenv "CONFIG_SHELL" (which "sh"))
+ (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")))))))
Same
next prev parent reply other threads:[~2017-12-10 9:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-03 19:01 [bug#29555] [PATCH] gnu: rust: update rust to 1.22.1 and cargo to 1.23.0 Nikolai Merinov
2017-12-04 7:02 ` ng0
2017-12-04 14:33 ` Jelle Licht
2017-12-04 14:54 ` Nikolai Merinov
2017-12-04 16:05 ` Danny Milosavljevic
[not found] ` <87o9ndn1rm.fsf@member.fsf.org>
2017-12-09 23:16 ` [bug#29555] [PATCHv3] " Nikolai Merinov
2017-12-10 9:27 ` Danny Milosavljevic [this message]
2017-12-10 21:14 ` [bug#29555] [PATCHv4] " Nikolai Merinov
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=20171210102719.0c6198c2@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=29555@debbugs.gnu.org \
--cc=adam@vany.ca \
--cc=nikolai.merinov@member.fsf.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).