From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNxu1-0006nS-HE for guix-patches@gnu.org; Sun, 10 Dec 2017 04:28:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNxty-0003se-CK for guix-patches@gnu.org; Sun, 10 Dec 2017 04:28:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNxty-0003sP-8l for guix-patches@gnu.org; Sun, 10 Dec 2017 04:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNxty-00048n-3y for guix-patches@gnu.org; Sun, 10 Dec 2017 04:28:02 -0500 Subject: [bug#29555] [PATCHv3] gnu: rust: update rust to 1.22.1 and cargo to 1.23.0 Resent-Message-ID: Date: Sun, 10 Dec 2017 10:27:23 +0100 From: Danny Milosavljevic Message-ID: <20171210102719.0c6198c2@scratchpost.org> In-Reply-To: <87bmj7mqz8.fsf_-_@member.fsf.org> References: <87609nhc00.fsf@member.fsf.org> <558D9F77-E950-4D77-86A3-4B633C0E2009@member.fsf.org> <20171204170506.75f2ce36@scratchpost.org> <87o9ndn1rm.fsf@member.fsf.org> <87bmj7mqz8.fsf_-_@member.fsf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Nikolai Merinov Cc: adam@vany.ca, 29555@debbugs.gnu.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