(address . guix-patches@gnu.org)
* gnu/packages/rust.scm (%rust-bootstrap-binaries-version): Update version.
(%rust-bootstrap-binaries): Update hashsums.
(cargo-bootstrap): Update minor version.
(rust): Rename "rustc" to "rust". Update sha256 for tarball. Add cargo related
dependencies. Install "cargo" as separate "rust" output. Remove substitutes
for bugs that was fixed in "rustc" source code. Install documentation to
separate "doc" output. Update configuration according to changes in "rustc"
source code.
* guix/build-system/cargo.scm (default-rust): Replace "default-cargo" and
"default-rustc" functions with "default-rust" function.
(cargo-build-system): Take only one package as "rust" source. Use "rustc" from
default output of "rust" package, use "cargo" as "cargo" output of "rust"
package.
Cargo was moved from separate package to "rust" output because starting from
0.25.0 release cargo have no "Cargo.lock" anymore. According to
commit message "cargo" used as "rust" dependency and stable version for
"cargo" provided through "Cargo.lock" file from "rust-lang/rust"
repository. As result only way to get stable version of "cargo" is build it from
"rust" sources.
---
gnu/packages/rust.scm | 1146 ++-----------------------------------------
guix/build-system/cargo.scm | 21 +-
2 files changed, 37 insertions(+), 1130 deletions(-)
Toggle diff (450 lines)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 1ba857d36..3fa889582 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -53,7 +53,7 @@
#:use-module (srfi srfi-26))
;; Should be one less than the current released version.
-(define %rust-bootstrap-binaries-version "1.21.0")
+(define %rust-bootstrap-binaries-version "1.23.0")
(define %rust-bootstrap-binaries
(origin
@@ -66,15 +66,15 @@
(base32
(match %host-type
("i686-unknown-linux-gnu"
- "1vnvqwz30hvyjcfr1f602lg43v2vlqjr3yhb5vr8xnrcc07yvjmp")
+ "0gs283lw6larhjlr02zm9g78djq2f6bdhxj6ls66q0z18zpx0nyw")
("x86_64-unknown-linux-gnu"
- "1s0866qcy0645bqhsbs3pvk2hi52ps8jzs7x096w0as033h707ml")
+ "0znw3xxh837i5wlwsbbw6bxdqfa58bxyw3716wbckwyph8xb4d4s")
("armv7-unknown-linux-gnueabihf"
- "1ml8fjq2b6j2vn1j314w93pf4wjl97n1mbz609h3i7md0zqscvs1")
+ "13mh4qx996rb6c3xygflc10j5zkmcxzjr32340ardwb7ja4jfw2q")
("aarch64-unknown-linux-gnu"
- "1hv4m2m7xjcph39r6baryfg23hjcr4sbsrfnd1lh0wn67k2fc7j9")
+ "1irbj73ifdm7xvshma7qp61sadm683dnc57jfg5qc8kdjyyrydrq")
("mips64el-unknown-linux-gnuabi64"
- "0p7fzkfcqg5yvj86v434z351dp7s7pgns8nzxj0fz3hmbfbvlvn9")
+ "1wksf07ba9idrj1z6x0hdfjsmhpzzi5idawnkfbhy6cj1g9ihnzv")
(_ "")))))) ; Catch-all for other systems.
(define %cargo-reference-project-file "/dev/null")
@@ -148,7 +148,7 @@ which can in turn be used to build the final Rust compiler.")
(define cargo-bootstrap
(package
(name "cargo-bootstrap")
- (version (cargo-version %rust-bootstrap-binaries-version 1))
+ (version (cargo-version %rust-bootstrap-binaries-version 0))
(source %rust-bootstrap-binaries)
(build-system gnu-build-system)
(native-inputs
@@ -213,9 +213,9 @@ manager, which is required to build itself.")
rustc-bootstrap and cargo-bootstrap packages.")
(license license:asl2.0)))
-(define-public rustc
+(define-public rust
(package
- (name "rustc")
+ (name "rust")
(version (rustc-version %rust-bootstrap-binaries-version 1))
(source (origin
(method url-fetch)
@@ -224,7 +224,7 @@ rustc-bootstrap and cargo-bootstrap packages.")
"rustc-" version "-src.tar.gz"))
(sha256
(base32
- "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"))
+ "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))
(modules '((guix build utils)))
(snippet
`(begin
@@ -240,10 +240,14 @@ rustc-bootstrap and cargo-bootstrap packages.")
("procps" ,procps) ; For the tests
("python-2" ,python-2)
("rust-bootstrap" ,rust-bootstrap)
+ ("pkg-config" ,pkg-config) ; For "cargo"
("which" ,which)))
(inputs
`(("jemalloc" ,jemalloc-4.5.0)
- ("llvm" ,llvm-3.9.1)))
+ ("llvm" ,llvm-3.9.1)
+ ("openssl" ,openssl)
+ ("libcurl" ,curl))) ; For "cargo"
+ (outputs '("out" "doc" "cargo"))
(arguments
`(#:imported-modules ,%cargo-build-system-modules ;for `generate-checksums'
#:phases
@@ -258,9 +262,6 @@ rustc-bootstrap and cargo-bootstrap packages.")
(add-after 'unpack 'patch-tests
(lambda* (#:key inputs #:allow-other-keys)
(let ((bash (assoc-ref inputs "bash")))
- (substitute* "src/build_helper/lib.rs"
- ;; In same folder as gcc there is only "gcc-ar" utility
- (("file\\.push_str\\(\"ar\"\\);") "file.push_str(\"gcc-ar\");"))
(substitute* "src/libstd/process.rs"
;; The newline is intentional.
;; There's a line length "tidy" check in Rust which would
@@ -276,12 +277,6 @@ rustc-bootstrap and cargo-bootstrap packages.")
;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
(delete-file-recursively "src/test/run-make/linker-output-non-utf8")
- (substitute* "src/build_helper/lib.rs"
- ;; Bug in Rust code.
- ;; Current implementation assume that if dst not exist then it's mtime
- ;; is 0, but in same time "src" have 0 mtime in guix build!
- (("let threshold = mtime\\(dst\\);")
- "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
#t)))
(add-after 'patch-source-shebangs 'patch-cargo-checksums
(lambda* (#:key inputs #:allow-other-keys)
@@ -302,6 +297,7 @@ rustc-bootstrap and cargo-bootstrap packages.")
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc"))
(gcc (assoc-ref inputs "gcc"))
(gdb (assoc-ref inputs "gdb"))
(binutils (assoc-ref inputs "binutils"))
@@ -317,15 +313,18 @@ rustc-bootstrap and cargo-bootstrap packages.")
[build]
cargo = \"" cargo "/bin/cargo" "\"
rustc = \"" rustc "/bin/rustc" "\"
+docs = true
python = \"" python "/bin/python2" "\"
gdb = \"" gdb "/bin/gdb" "\"
vendor = true
submodules = false
[install]
prefix = \"" out "\"
+docdir = \"" doc "/share/doc/rust" "\"
+sysconfdir = \"etc\"
+localstatedir = \"var/lib\"
[rust]
default-linker = \"" gcc "/bin/gcc" "\"
-default-ar = \"" binutils "/bin/ar" "\"
channel = \"stable\"
rpath = true
# There is 2 failed codegen tests:
@@ -336,6 +335,7 @@ codegen-tests = false
llvm-config = \"" llvm "/bin/llvm-config" "\"
cc = \"" gcc "/bin/gcc" "\"
cxx = \"" gcc "/bin/g++" "\"
+ar = \"" binutils "/bin/ar" "\"
jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
[dist]
") port)))
@@ -350,13 +350,20 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
#t))
(replace 'build
(lambda* (#:key inputs outputs #:allow-other-keys)
- (zero? (system* "./x.py" "build"))))
+ (and (zero? (system* "./x.py" "build"))
+ (zero? (system* "./x.py" "build" "src/tools/cargo")))))
(replace 'check
(lambda* (#:key inputs outputs #:allow-other-keys)
(zero? (system* "./x.py" "test"))))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
- (zero? (system* "./x.py" "install"))))
+ (and (zero? (system* "./x.py" "install"))
+ (begin
+ (substitute* "config.toml"
+ ;; replace prefix to specific output
+ (("prefix = \"[^\"]*\"")
+ (string-append "prefix = \"" (assoc-ref outputs "cargo") "\"")))
+ (zero? (system* "./x.py" "install" "cargo"))))))
(add-after 'install 'wrap-rustc
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
@@ -375,1096 +382,3 @@ safety and thread safety guarantees.")
(home-page "https://www.rust-lang.org")
;; Dual licensed.
(license (list license:asl2.0 license:expat))))
-
-;; This tries very hard not to get into a cyclic dependency like this:
-;; cargo <- cargo-build-system <- cargo.
-(define-public cargo
- (package
- (name "cargo")
- (version (cargo-version (rustc-version %rust-bootstrap-binaries-version) 0))
- (source (origin
- (method url-fetch)
- (uri (string-append "https://github.com/rust-lang/cargo/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "0kr7rml7v2bm7zl8jcb3056h63zpyy9m08s212i8vfwxf6lf5fzl"))))
- (build-system cargo-build-system)
- (propagated-inputs
- `(("cmake" ,cmake)
- ("pkg-config" ,pkg-config)))
- (inputs
- `(("curl" ,curl)
- ("libgit2" ,libgit2)
- ("libssh2" ,libssh2)
- ("openssl" ,openssl)
- ("python-2" ,python-2)
- ("zlib" ,zlib)))
- (native-inputs
- `(("git" ,git) ; required for tests
- ;; Next dependencies generated with next command:
- ;; cat Cargo.lock | awk '
- ;; /^"checksum/
- ;; { oname=name=$2; vers=$3; hash=$6;
- ;; if (ns[name] != 1) { ns[name]=1; } else { name = name "-" vers; }
- ;; print " (\"rust-" name "\"";
- ;; print " ,(origin";
- ;; print " (method url-fetch)";
- ;; print " (uri (crate-uri \"" oname "\" \"" vers "\"))";
- ;; print " (file-name \"rust-" oname "\-\" vers "\")
- ;; print " (sha256";
- ;; print " (base16-string->bytevector";
- ;; print " " hash "))))"
- ;; }'
- ("rust-advapi32-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "advapi32-sys" "0.2.0"))
- (file-name "rust-advapi32-sys-0.2.0")
- (sha256
- (base16-string->bytevector
- "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a"))))
- ("rust-aho-corasick"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "aho-corasick" "0.5.3"))
- (file-name "rust-aho-corasick-0.5.3")
- (sha256
- (base16-string->bytevector
- "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"))))
- ("rust-aho-corasick-0.6.3"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "aho-corasick" "0.6.3"))
- (file-name "rust-aho-corasick-0.6.3")
- (sha256
- (base16-string->bytevector
- "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"))))
- ("rust-atty"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "atty" "0.2.3"))
- (file-name "rust-atty-0.2.3")
- (sha256
- (base16-string->bytevector
- "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"))))
- ("rust-backtrace"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "backtrace" "0.3.3"))
- (file-name "rust-backtrace-0.3.3")
- (sha256
- (base16-string->bytevector
- "99f2ce94e22b8e664d95c57fff45b98a966c2252b60691d0b7aeeccd88d70983"))))
- ("rust-backtrace-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "backtrace-sys" "0.1.14"))
- (file-name "rust-backtrace-sys-0.1.14")
- (sha256
- (base16-string->bytevector
- "c63ea141ef8fdb10409d0f5daf30ac51f84ef43bff66f16627773d2a292cd189"))))
- ("rust-bitflags"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "bitflags" "0.7.0"))
- (file-name "rust-bitflags-0.7.0")
- (sha256
- (base16-string->bytevector
- "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"))))
- ("rust-bitflags-0.9.1"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "bitflags" "0.9.1"))
- (file-name "rust-bitflags-0.9.1")
- (sha256
- (base16-string->bytevector
- "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"))))
- ("rust-bufstream"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "bufstream" "0.1.3"))
- (file-name "rust-bufstream-0.1.3")
- (sha256
- (base16-string->bytevector
- "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32"))))
- ("rust-cc"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "cc" "1.0.0"))
- (file-name "rust-cc-1.0.0")
- (sha256
- (base16-string->bytevector
- "7db2f146208d7e0fbee761b09cd65a7f51ccc38705d4e7262dad4d73b12a76b1"))))
- ("rust-cfg-if"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "cfg-if" "0.1.2"))
- (file-name "rust-cfg-if-0.1.2")
- (sha256
- (base16-string->bytevector
- "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"))))
- ("rust-cmake"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "cmake" "0.1.26"))
- (file-name "rust-cmake-0.1.26")
- (sha256
- (base16-string->bytevector
- "357c07e7a1fc95732793c1edb5901e1a1f305cfcf63a90eb12dbd22bdb6b789d"))))
- ("rust-commoncrypto"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "commoncrypto" "0.2.0"))
- (file-name "rust-commoncrypto-0.2.0")
- (sha256
- (base16-string->bytevector
- "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"))))
- ("rust-commoncrypto-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "commoncrypto-sys" "0.2.0"))
- (file-name "rust-commoncrypto-sys-0.2.0")
- (sha256
- (base16-string->bytevector
- "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"))))
- ("rust-conv"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "conv" "0.3.3"))
- (file-name "rust-conv-0.3.3")
- (sha256
- (base16-string->bytevector
- "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299"))))
- ("rust-core-foundation"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "core-foundation" "0.4.4"))
- (file-name "rust-core-foundation-0.4.4")
- (sha256
- (base16-string->bytevector
- "5909502e547762013619f4c4e01cc7393c20fe2d52d7fa471c1210adb2320dc7"))))
- ("rust-core-foundation-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "core-foundation-sys" "0.4.4"))
- (file-name "rust-core-foundation-sys-0.4.4")
- (sha256
- (base16-string->bytevector
- "bc9fb3d6cb663e6fd7cf1c63f9b144ee2b1e4a78595a0451dd34bff85b9a3387"))))
- ("rust-crossbeam"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "crossbeam" "0.2.10"))
- (file-name "rust-crossbeam-0.2.10")
- (sha256
- (base16-string->bytevector
- "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"))))
- ("rust-crossbeam-0.3.0"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "crossbeam" "0.3.0"))
- (file-name "rust-crossbeam-0.3.0")
- (sha256
- (base16-string->bytevector
- "8837ab96533202c5b610ed44bc7f4183e7957c1c8f56e8cc78bb098593c8ba0a"))))
- ("rust-crypto-hash"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "crypto-hash" "0.3.0"))
- (file-name "rust-crypto-hash-0.3.0")
- (sha256
- (base16-string->bytevector
- "34903878eec1694faf53cae8473a088df333181de421d4d3d48061d6559fe602"))))
- ("rust-curl"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "curl" "0.4.8"))
- (file-name "rust-curl-0.4.8")
- (sha256
- (base16-string->bytevector
- "7034c534a1d7d22f7971d6088aa9d281d219ef724026c3428092500f41ae9c2c"))))
- ("rust-curl-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "curl-sys" "0.3.15"))
- (file-name "rust-curl-sys-0.3.15")
- (sha256
- (base16-string->bytevector
- "4bee31aa3a079d5f3ff9579ea4dcfb1b1a17a40886f5f467436d383e78134b55"))))
- ("rust-custom_derive"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "custom_derive" "0.1.7"))
- (file-name "rust-custom_derive-0.1.7")
- (sha256
- (base16-string->bytevector
- "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"))))
- ("rust-dbghelp-sys"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "dbghelp-sys" "0.2.0"))
- (file-name "rust-dbghelp-sys-0.2.0")
- (sha256
- (base16-string->bytevector
- "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"))))
- ("rust-docopt"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "docopt" "0.8.1"))
- (file-name "rust-docopt-0.8.1")
- (sha256
- (base16-string->bytevector
- "3b5b93718f8b3e5544fcc914c43de828ca6c6ace23e0332c6080a2977b49787a"))))
- ("rust-dtoa"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "dtoa" "0.4.2"))
- (file-name "rust-dtoa-0.4.2")
- (sha256
- (base16-string->bytevector
- "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"))))
- ("rust-env_logger"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "env_logger" "0.4.3"))
- (file-name "rust-env_logger-0.4.3")
- (sha256
- (base16-string->bytevector
- "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"))))
- ("rust-error-chain"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "error-chain" "0.11.0"))
- (file-name "rust-error-chain-0.11.0")
- (sha256
- (base16-string->bytevector
- "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"))))
- ("rust-filetime"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "filetime" "0.1.12"))
- (file-name "rust-filetime-0.1.12")
- (sha256
- (base16-string->bytevector
- "6ab199bf38537c6f38792669e081e0bb278b9b7405bba2642e4e5d15bf732c0e"))))
- ("rust-flate2"
- ,(origin
- (method url-fetch)
- (uri (crate-uri "flate2" "0.2.20"))
- (file-name "rust-flate2-0.2.20")
- (sha256
- (base16-string->bytevector
- "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423"))))
- ("rust-fnv"
-
This message was truncated. Download the full message here.