You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1321 lines
60 KiB

mailmap: Update entries for Nikita. * .mailmap: change email and name for Nikita. * Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish, gnu/packages/accessibility.scm, gnu/packages/admin.scm, gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/cinnamon.scm, gnu/packages/compression.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/erlang.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile-xyz.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell-xyz.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp-xyz.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
1 year ago
gnu: Remove ".git" from "https://github/…/….git". Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix swh) would sometimes return #f for these because the ".git" URLs are redirects to the non-".git" URLs. Consequently, 'guix lint -c archival' would keep saying "scheduled Software Heritage archival"; likewise, the fallback download code would fail. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/android.scm, gnu/packages/animation.scm, gnu/packages/arcan.scm, gnu/packages/assembly.scm, gnu/packages/audio.scm, gnu/packages/authentication.scm, gnu/packages/avr.scm, gnu/packages/axoloti.scm, gnu/packages/backup.scm, gnu/packages/bash.scm, gnu/packages/benchmark.scm, gnu/packages/bioconductor.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/boost.scm, gnu/packages/build-tools.scm, gnu/packages/c.scm, gnu/packages/calendar.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/chez.scm, gnu/packages/clojure.scm, gnu/packages/code.scm, gnu/packages/compression.scm, gnu/packages/compton.scm, gnu/packages/coq.scm, gnu/packages/cpp.scm, gnu/packages/cran.scm, gnu/packages/crypto.scm, gnu/packages/curl.scm, gnu/packages/databases.scm, gnu/packages/datastructures.scm, gnu/packages/debug.scm, gnu/packages/disk.scm, gnu/packages/distributed.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/dns.scm, gnu/packages/docker.scm, gnu/packages/education.scm, gnu/packages/efi.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/embedded.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/erlang.scm, gnu/packages/fabric-management.scm, gnu/packages/file-systems.scm, gnu/packages/finance.scm, gnu/packages/firmware.scm, gnu/packages/flashing-tools.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/fpga.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/genealogy.scm, gnu/packages/genimage.scm, gnu/packages/geo.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/gnome-xyz.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/golang.scm, gnu/packages/gpodder.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/groff.scm, gnu/packages/groovy.scm, gnu/packages/gtk.scm, gnu/packages/guile-xyz.scm, gnu/packages/guile.scm, gnu/packages/hardware.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-xyz.scm, gnu/packages/hexedit.scm, gnu/packages/i2p.scm, gnu/packages/ibus.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/ipfs.scm, gnu/packages/java-graphics.scm, gnu/packages/java-maths.scm, gnu/packages/java.scm, gnu/packages/javascript.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
1 year ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 David Craven <david@craven.ch>
  3. ;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
  4. ;;; Copyright © 2016 Nikita <nikita@n0.is>
  5. ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
  6. ;;; Copyright © 2017, 2018 Nikolai Merinov <nikolai.merinov@member.fsf.org>
  7. ;;; Copyright © 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
  8. ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
  10. ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
  11. ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
  12. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  27. (define-module (gnu packages rust)
  28. #:use-module (gnu packages base)
  29. #:use-module (gnu packages bison)
  30. #:use-module (gnu packages bootstrap)
  31. #:use-module (gnu packages cmake)
  32. #:use-module (gnu packages compression)
  33. #:use-module (gnu packages curl)
  34. #:use-module (gnu packages elf)
  35. #:use-module (gnu packages flex)
  36. #:use-module (gnu packages gcc)
  37. #:use-module (gnu packages gdb)
  38. #:use-module (gnu packages jemalloc)
  39. #:use-module (gnu packages linux)
  40. #:use-module (gnu packages llvm)
  41. #:use-module (gnu packages pkg-config)
  42. #:use-module (gnu packages python)
  43. #:use-module (gnu packages ssh)
  44. #:use-module (gnu packages tls)
  45. #:use-module (gnu packages)
  46. #:use-module (guix build-system cargo)
  47. #:use-module (guix build-system gnu)
  48. #:use-module (guix build-system trivial)
  49. #:use-module (guix download)
  50. #:use-module (guix git-download)
  51. #:use-module ((guix licenses) #:prefix license:)
  52. #:use-module (guix packages)
  53. #:use-module ((guix build utils) #:select (alist-replace))
  54. #:use-module (guix utils)
  55. #:use-module (ice-9 match)
  56. #:use-module (srfi srfi-26))
  57. ;; This is the hash for the empty file, and the reason it's relevant is not
  58. ;; the most obvious.
  59. ;;
  60. ;; The root of the problem is that Cargo keeps track of a file called
  61. ;; Cargo.lock, that contains the hash of the tarball source of each dependency.
  62. ;;
  63. ;; However, tarball sources aren't handled well by Guix because of the need to
  64. ;; patch shebangs in any helper scripts. This is why we use Cargo's vendoring
  65. ;; capabilities, where instead of the tarball, a directory is provided in its
  66. ;; place. (In the case of rustc, the source code already ships with vendored
  67. ;; dependencies, but crates built with cargo-build-system undergo vendoring
  68. ;; during the build.)
  69. ;;
  70. ;; To preserve the advantages of checksumming, vendored dependencies contain
  71. ;; a file called .cargo-checksum.json, which contains the hash of the tarball,
  72. ;; as well as the list of files in it, with the hash of each file.
  73. ;;
  74. ;; The patch-cargo-checksums phase of cargo-build-system runs after
  75. ;; any Guix-specific patches to the vendored dependencies and regenerates the
  76. ;; .cargo-checksum.json files, but it's hard to know the tarball checksum that
  77. ;; should be written to the file - and taking care of any unhandled edge case
  78. ;; would require rebuilding everything that depends on rust. This is why we lie,
  79. ;; and say that the tarball has the hash of an empty file. It's not a problem
  80. ;; because cargo-build-system removes the Cargo.lock file. We can't do that
  81. ;; for rustc because of a quirk of its build system, so we modify the lock file
  82. ;; to substitute the hash.
  83. (define %cargo-reference-hash
  84. "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
  85. (define* (nix-system->gnu-triplet-for-rust
  86. #:optional (system (%current-system)))
  87. (match system
  88. ("x86_64-linux" "x86_64-unknown-linux-gnu")
  89. ("i686-linux" "i686-unknown-linux-gnu")
  90. ("armhf-linux" "armv7-unknown-linux-gnueabihf")
  91. ("aarch64-linux" "aarch64-unknown-linux-gnu")
  92. ("mips64el-linux" "mips64el-unknown-linux-gnuabi64")
  93. (_ (nix-system->gnu-triplet system))))
  94. (define* (rust-uri version #:key (dist "static"))
  95. (string-append "https://" dist ".rust-lang.org/dist/"
  96. "rustc-" version "-src.tar.gz"))
  97. (define* (rust-bootstrapped-package base-rust version checksum)
  98. "Bootstrap rust VERSION with source checksum CHECKSUM using BASE-RUST."
  99. (package
  100. (inherit base-rust)
  101. (version version)
  102. (source
  103. (origin
  104. (inherit (package-source base-rust))
  105. (uri (rust-uri version))
  106. (sha256 (base32 checksum))))
  107. (native-inputs
  108. (alist-replace "cargo-bootstrap" (list base-rust "cargo")
  109. (alist-replace "rustc-bootstrap" (list base-rust)
  110. (package-native-inputs base-rust))))))
  111. (define-public mrustc
  112. (let ((rustc-version "1.19.0"))
  113. (package
  114. (name "mrustc")
  115. (version "0.9")
  116. (source (origin
  117. (method git-fetch)
  118. (uri (git-reference
  119. (url "https://github.com/thepowersgang/mrustc")
  120. (commit (string-append "v" version))))
  121. (file-name (git-file-name name version))
  122. (sha256
  123. (base32
  124. "194ny7vsks5ygiw7d8yxjmp1qwigd71ilchis6xjl6bb2sj97rd2"))))
  125. (outputs '("out" "cargo"))
  126. (build-system gnu-build-system)
  127. (inputs
  128. `(("zlib" ,zlib)))
  129. (native-inputs
  130. `(("bison" ,bison)
  131. ("flex" ,flex)
  132. ;; Required for the libstd sources.
  133. ("rustc" ,(package-source rust-1.19))))
  134. (arguments
  135. `(#:test-target "test"
  136. #:make-flags
  137. (list ,(string-append "RUSTC_TARGET="
  138. (or (%current-target-system)
  139. (nix-system->gnu-triplet-for-rust))))
  140. #:phases
  141. (modify-phases %standard-phases
  142. (add-after 'unpack 'patch-date
  143. (lambda _
  144. (substitute* "Makefile"
  145. (("shell date") "shell date -d @1"))
  146. (substitute* "run_rustc/Makefile"
  147. (("[$]Vtime ") "$V "))
  148. #t))
  149. (add-after 'patch-date 'unpack-target-compiler
  150. (lambda* (#:key inputs outputs #:allow-other-keys)
  151. (invoke "tar" "xf" (assoc-ref inputs "rustc"))
  152. (chdir ,(string-append "rustc-" rustc-version "-src"))
  153. (invoke "patch" "-p0" ,(string-append "../rustc-" rustc-version
  154. "-src.patch"))
  155. (chdir "..")
  156. (setenv "RUSTC_VERSION" ,rustc-version)
  157. (setenv "MRUSTC_TARGET_VER"
  158. ,(version-major+minor rustc-version))
  159. (setenv "OUTDIR_SUF" "")
  160. #t))
  161. (replace 'configure
  162. (lambda* (#:key inputs #:allow-other-keys)
  163. (setenv "CC" (string-append (assoc-ref inputs "gcc")
  164. "/bin/gcc"))
  165. (setenv "CXX" (string-append (assoc-ref inputs "gcc")
  166. "/bin/g++"))
  167. #t))
  168. (add-after 'build 'build-minicargo
  169. (lambda* (#:key make-flags #:allow-other-keys)
  170. ;; TODO: minicargo.mk: RUSTC_VERSION=$(RUSTC_VERSION) RUSTC_CHANNEL=$(RUSTC_SRC_TY) OUTDIR_SUF=$(OUTDIR_SUF)
  171. (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags)
  172. (apply invoke "make" "-C" "tools/minicargo" make-flags)))
  173. ;(add-after 'check 'check-locally
  174. ; (lambda* (#:key make-flags #:allow-other-keys)
  175. ; ;; The enum test wouldn't work otherwise.
  176. ; ;; See <https://github.com/thepowersgang/mrustc/issues/137>.
  177. ; (setenv "MRUSTC_TARGET_VER" ,(version-major+minor rustc-version))
  178. ; (apply invoke "make" "local_tests" make-flags)))
  179. (replace 'install
  180. (lambda* (#:key inputs outputs #:allow-other-keys)
  181. (let* ((out (assoc-ref outputs "out"))
  182. (bin (string-append out "/bin"))
  183. (tools-bin (string-append out "/tools/bin"))
  184. (cargo-out (assoc-ref outputs "cargo"))
  185. (cargo-bin (string-append cargo-out "/bin"))
  186. (lib (string-append out "/lib"))
  187. (lib/rust (string-append lib "/mrust"))
  188. (gcc (assoc-ref inputs "gcc"))
  189. (run_rustc (string-append out
  190. "/share/mrustc/run_rustc")))
  191. ;; These files are not reproducible.
  192. (for-each delete-file (find-files "output" "\\.txt$"))
  193. ;(delete-file-recursively "output/local_tests")
  194. (mkdir-p (dirname lib/rust))
  195. (copy-recursively "output" lib/rust)
  196. (mkdir-p bin)
  197. (mkdir-p tools-bin)
  198. (install-file "bin/mrustc" bin)
  199. ;; minicargo uses relative paths to resolve mrustc.
  200. (install-file "tools/bin/minicargo" tools-bin)
  201. (install-file "tools/bin/minicargo" cargo-bin)
  202. (mkdir-p run_rustc)
  203. (copy-file "run_rustc/Makefile"
  204. (string-append run_rustc "/Makefile"))
  205. #t))))))
  206. (synopsis "Compiler for the Rust programming language")
  207. (description "Rust is a systems programming language that provides memory
  208. safety and thread safety guarantees.")
  209. (home-page "https://github.com/thepowersgang/mrustc")
  210. ;; Dual licensed.
  211. (license (list license:asl2.0 license:expat)))))
  212. (define rust-1.19
  213. (package
  214. (name "rust")
  215. (version "1.19.0")
  216. (source
  217. (origin
  218. (method url-fetch)
  219. (uri (rust-uri "1.19.0"))
  220. (sha256 (base32 "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm"))
  221. (modules '((guix build utils)))
  222. (snippet '(begin (delete-file-recursively "src/llvm") #t))
  223. (patches (search-patches "rust-1.19-mrustc.patch"))))
  224. (outputs '("out" "cargo"))
  225. (properties '((timeout . 72000) ;20 hours
  226. (max-silent-time . 18000))) ;5 hours (for armel)
  227. (arguments
  228. `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums'
  229. #:modules ((guix build utils) (ice-9 match) (guix build gnu-build-system))
  230. #:phases
  231. (modify-phases %standard-phases
  232. (add-after 'unpack 'set-env
  233. (lambda* (#:key inputs #:allow-other-keys)
  234. ;; Disable test for cross compilation support.
  235. (setenv "CFG_DISABLE_CROSS_TESTS" "1")
  236. (setenv "SHELL" (which "sh"))
  237. (setenv "CONFIG_SHELL" (which "sh"))
  238. (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
  239. ;; guix llvm-3.9.1 package installs only shared libraries
  240. (setenv "LLVM_LINK_SHARED" "1")
  241. #t))
  242. (add-after 'unpack 'patch-cargo-tomls
  243. (lambda* (#:key inputs outputs #:allow-other-keys)
  244. (substitute* "src/librustc_errors/Cargo.toml"
  245. (("[[]dependencies[]]") "
  246. [dependencies]
  247. term = \"0.4.4\"
  248. "))
  249. (substitute* "src/librustc/Cargo.toml"
  250. (("[[]dependencies[]]") "
  251. [dependencies]
  252. getopts = { path = \"../libgetopts\" }
  253. "))
  254. (substitute* "src/librustdoc/Cargo.toml"
  255. (("[[]dependencies[]]") "
  256. [dependencies]
  257. test = { path = \"../libtest\" }
  258. "))
  259. #t))
  260. (add-after 'unpack 'patch-tests
  261. (lambda* (#:key inputs #:allow-other-keys)
  262. (let ((bash (assoc-ref inputs "bash")))
  263. (substitute* "src/libstd/process.rs"
  264. ;; The newline is intentional.
  265. ;; There's a line length "tidy" check in Rust which would
  266. ;; fail otherwise.
  267. (("\"/bin/sh\"") (string-append "\n\"" bash "/bin/sh\"")))
  268. (substitute* "src/libstd/net/tcp.rs"
  269. ;; There is no network in build environment
  270. (("fn connect_timeout_unroutable")
  271. "#[ignore]\nfn connect_timeout_unroutable"))
  272. ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00222.html>
  273. (substitute* "src/libstd/sys/unix/process/process_common.rs"
  274. (("fn test_process_mask") "#[allow(unused_attributes)]
  275. #[ignore]
  276. fn test_process_mask"))
  277. #t)))
  278. (add-after 'patch-tests 'patch-aarch64-test
  279. (lambda* _
  280. (substitute* "src/librustc_back/dynamic_lib.rs"
  281. ;; This test is known to fail on aarch64 and powerpc64le:
  282. ;; https://github.com/rust-lang/rust/issues/45410
  283. (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
  284. #t))
  285. (add-after 'patch-tests 'use-readelf-for-tests
  286. (lambda* _
  287. ;; nm doesn't recognize the file format because of the
  288. ;; nonstandard sections used by the Rust compiler, but readelf
  289. ;; ignores them.
  290. (substitute* "src/test/run-make/atomic-lock-free/Makefile"
  291. (("\tnm ")
  292. "\treadelf -c "))
  293. #t))
  294. (add-after 'patch-tests 'remove-unsupported-tests
  295. (lambda* _
  296. ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
  297. ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
  298. (delete-file-recursively "src/test/run-make/linker-output-non-utf8")
  299. #t))
  300. (add-after 'patch-source-shebangs 'patch-cargo-checksums
  301. (lambda* _
  302. (use-modules (guix build cargo-utils))
  303. (substitute* "src/Cargo.lock"
  304. (("(\"checksum .* = )\".*\"" all name)
  305. (string-append name "\"" ,%cargo-reference-hash "\"")))
  306. (generate-all-checksums "src/vendor")
  307. #t))
  308. ;; This phase is overridden by newer versions.
  309. (replace 'configure
  310. (const #t))
  311. ;; This phase is overridden by newer versions.
  312. (replace 'build
  313. (lambda* (#:key inputs outputs #:allow-other-keys)
  314. (let ((rustc-bootstrap (assoc-ref inputs "rustc-bootstrap")))
  315. (setenv "CFG_COMPILER_HOST_TRIPLE"
  316. ,(nix-system->gnu-triplet (%current-system)))
  317. (setenv "CFG_RELEASE" "")
  318. (setenv "CFG_RELEASE_CHANNEL" "stable")
  319. (setenv "CFG_LIBDIR_RELATIVE" "lib")
  320. (setenv "CFG_VERSION" "1.19.0-stable-mrustc")
  321. (setenv "MRUSTC_TARGET_VER" ,(version-major+minor version))
  322. ; bad: (setenv "CFG_PREFIX" "mrustc") ; FIXME output path.
  323. (mkdir-p "output")
  324. ;; mrustc 0.9 doesn't check the search paths for crates anymore.
  325. (copy-recursively (string-append rustc-bootstrap "/lib/mrust")
  326. "output")
  327. (invoke (string-append rustc-bootstrap "/tools/bin/minicargo")
  328. "src/rustc" "--vendor-dir" "src/vendor"
  329. "--output-dir" "output/rustc-build"
  330. "-L" (string-append rustc-bootstrap "/lib/mrust")
  331. "-j" "1")
  332. (setenv "CFG_COMPILER_HOST_TRIPLE" #f)
  333. (setenv "CFG_RELEASE" #f)
  334. (setenv "CFG_RELEASE_CHANNEL" #f)
  335. (setenv "CFG_VERSION" #f)
  336. (setenv "CFG_PREFIX" #f)
  337. (setenv "CFG_LIBDIR_RELATIVE" #f)
  338. (invoke (string-append rustc-bootstrap "/tools/bin/minicargo")
  339. "src/tools/cargo" "--vendor-dir" "src/vendor"
  340. "--output-dir" "output/cargo-build"
  341. "-L" "output/"
  342. "-L" (string-append rustc-bootstrap "/lib/mrust")
  343. "-j" "1")
  344. ;; Now use the newly-built rustc to build the libraries.
  345. ;; One day that could be replaced by:
  346. ;; (invoke "output/cargo-build/cargo" "build"
  347. ;; "--manifest-path" "src/bootstrap/Cargo.toml"
  348. ;; "--verbose") ; "--locked" "--frozen"
  349. ;; but right now, Cargo has problems with libstd's circular
  350. ;; dependencies.
  351. (mkdir-p "output/target-libs")
  352. (for-each (match-lambda
  353. ((name . flags)
  354. (write name)
  355. (newline)
  356. (apply invoke
  357. "output/rustc-build/rustc"
  358. "-C" (string-append "linker="
  359. (getenv "CC"))
  360. ;; Required for libterm.
  361. "-Z" "force-unstable-if-unmarked"
  362. "-L" "output/target-libs"
  363. (string-append "src/" name "/lib.rs")
  364. "-o"
  365. (string-append "output/target-libs/"
  366. (car (string-split name #\/))
  367. ".rlib")
  368. flags)))
  369. '(("libcore")
  370. ("libstd_unicode")
  371. ("liballoc")
  372. ("libcollections")
  373. ("librand")
  374. ("liblibc/src" "--cfg" "stdbuild")
  375. ("libunwind" "-l" "gcc_s")
  376. ("libcompiler_builtins")
  377. ("liballoc_system")
  378. ("libpanic_unwind")
  379. ;; Uses "cc" to link.
  380. ("libstd" "-l" "dl" "-l" "rt" "-l" "pthread")
  381. ("libarena")
  382. ;; Test dependencies:
  383. ("libgetopts")
  384. ("libterm")
  385. ("libtest")))
  386. #t)))
  387. ;; This phase is overridden by newer versions.
  388. (replace 'check
  389. (const #t))
  390. ;; This phase is overridden by newer versions.
  391. (replace 'install
  392. (lambda* (#:key inputs outputs #:allow-other-keys)
  393. (let* ((out (assoc-ref outputs "out"))
  394. (target-system ,(or (%current-target-system)
  395. (nix-system->gnu-triplet
  396. (%current-system))))
  397. (out-libs (string-append out "/lib/rustlib/"
  398. target-system "/lib")))
  399. ;(setenv "CFG_PREFIX" out)
  400. (mkdir-p out-libs)
  401. (copy-recursively "output/target-libs" out-libs)
  402. (install-file "output/rustc-build/rustc"
  403. (string-append out "/bin"))
  404. (install-file "output/rustc-build/rustdoc"
  405. (string-append out "/bin"))
  406. (install-file "output/cargo-build/cargo"
  407. (string-append (assoc-ref outputs "cargo")
  408. "/bin")))
  409. #t)))))
  410. (build-system gnu-build-system)
  411. (native-inputs
  412. `(("bison" ,bison) ; For the tests
  413. ("cmake" ,cmake-minimal)
  414. ("flex" ,flex) ; For the tests
  415. ("gdb" ,gdb) ; For the tests
  416. ("procps" ,procps) ; For the tests
  417. ("python-2" ,python-2)
  418. ("rustc-bootstrap" ,mrustc)
  419. ("cargo-bootstrap" ,mrustc "cargo")
  420. ("pkg-config" ,pkg-config) ; For "cargo"
  421. ("which" ,which)))
  422. (inputs
  423. `(("jemalloc" ,jemalloc-4.5.0)
  424. ("llvm" ,llvm-3.9.1)
  425. ("openssl" ,openssl-1.0)
  426. ("libssh2" ,libssh2) ; For "cargo"
  427. ("libcurl" ,curl))) ; For "cargo"
  428. ;; rustc invokes gcc, so we need to set its search paths accordingly.
  429. ;; Note: duplicate its value here to cope with circular dependencies among
  430. ;; modules (see <https://bugs.gnu.org/31392>).
  431. (native-search-paths
  432. (list (search-path-specification
  433. (variable "C_INCLUDE_PATH")
  434. (files '("include")))
  435. (search-path-specification
  436. (variable "CPLUS_INCLUDE_PATH")
  437. (files '("include/c++" "include")))
  438. (search-path-specification
  439. (variable "LIBRARY_PATH")
  440. (files '("lib" "lib64")))))
  441. (synopsis "Compiler for the Rust progamming language")
  442. (description "Rust is a systems programming language that provides memory
  443. safety and thread safety guarantees.")
  444. (home-page "https://www.rust-lang.org")
  445. ;; Dual licensed.
  446. (license (list license:asl2.0 license:expat))))
  447. (define-public rust-1.20
  448. (let ((base-rust
  449. (rust-bootstrapped-package rust-1.19 "1.20.0"
  450. "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a")))
  451. (package
  452. (inherit base-rust)
  453. (source
  454. (origin
  455. (inherit (package-source base-rust))
  456. (snippet '(begin
  457. (delete-file-recursively "src/jemalloc")
  458. (delete-file-recursively "src/llvm")
  459. #t))
  460. (patches '())))
  461. (native-inputs
  462. `(;; The tests fail with newer versions of GNU Make.
  463. ("make" ,gnu-make-4.2)
  464. ,@(package-native-inputs base-rust)))
  465. (outputs '("out" "doc" "cargo"))
  466. ;; Since rust-1.19 is local, it's quite probable that Hydra
  467. ;; will build rust-1.19 only as a dependency of rust-1.20.
  468. ;; But then Hydra will use the wrong properties, the ones here,
  469. ;; for rust-1.19. Therefore, we copied the properties of
  470. ;; rust-1.19 here.
  471. (properties '((timeout . 72000) ;20 hours
  472. (max-silent-time . 18000))) ;5 hours (for armel)
  473. (arguments
  474. (substitute-keyword-arguments (package-arguments rust-1.19)
  475. ((#:phases phases)
  476. `(modify-phases ,phases
  477. (add-after 'patch-tests 'patch-cargo-tests
  478. (lambda _
  479. (substitute* "src/tools/cargo/tests/build.rs"
  480. (("/usr/bin/env") (which "env"))
  481. ;; Guix llvm is compiled without asmjs-unknown-emscripten.
  482. (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
  483. (substitute* "src/tools/cargo/tests/death.rs"
  484. ;; This is stuck when built in container.
  485. (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
  486. ;; Prints test output in the wrong order when built on
  487. ;; i686-linux.
  488. (substitute* "src/tools/cargo/tests/test.rs"
  489. (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
  490. ;; These tests pull in a dependency on "git", which changes
  491. ;; too frequently take part in the Rust toolchain.
  492. (substitute* "src/tools/cargo/tests/new.rs"
  493. (("fn author_prefers_cargo") "#[ignore]\nfn author_prefers_cargo")
  494. (("fn finds_author_git") "#[ignore]\nfn finds_author_git")
  495. (("fn finds_local_author_git") "#[ignore]\nfn finds_local_author_git"))
  496. #t))
  497. (add-after 'patch-cargo-tests 'ignore-glibc-2.27-incompatible-test
  498. ;; https://github.com/rust-lang/rust/issues/47863
  499. (lambda _
  500. (substitute* "src/test/run-pass/out-of-stack.rs"
  501. (("// ignore-android") "// ignore-test\n// ignore-android"))
  502. #t))
  503. (replace 'configure
  504. (lambda* (#:key inputs outputs #:allow-other-keys)
  505. (let* ((out (assoc-ref outputs "out"))
  506. (doc (assoc-ref outputs "doc"))
  507. (gcc (assoc-ref inputs "gcc"))
  508. (gdb (assoc-ref inputs "gdb"))
  509. (binutils (assoc-ref inputs "binutils"))
  510. (python (assoc-ref inputs "python-2"))
  511. (rustc (assoc-ref inputs "rustc-bootstrap"))
  512. (cargo (assoc-ref inputs "cargo-bootstrap"))
  513. (llvm (assoc-ref inputs "llvm"))
  514. (jemalloc (assoc-ref inputs "jemalloc")))
  515. (call-with-output-file "config.toml"
  516. (lambda (port)
  517. (display (string-append "
  518. [llvm]
  519. [build]
  520. cargo = \"" cargo "/bin/cargo" "\"
  521. rustc = \"" rustc "/bin/rustc" "\"
  522. docs = true
  523. python = \"" python "/bin/python2" "\"
  524. gdb = \"" gdb "/bin/gdb" "\"
  525. vendor = true
  526. submodules = false
  527. [install]
  528. prefix = \"" out "\"
  529. docdir = \"" doc "/share/doc/rust" "\"
  530. sysconfdir = \"etc\"
  531. [rust]
  532. default-linker = \"" gcc "/bin/gcc" "\"
  533. channel = \"stable\"
  534. rpath = true
  535. " ;; There are 2 failed codegen tests:
  536. ;; codegen/mainsubprogram.rs and codegen/mainsubprogramstart.rs
  537. ;; These tests require a patched LLVM
  538. "codegen-tests = false
  539. [target." ,(nix-system->gnu-triplet-for-rust) "]
  540. llvm-config = \"" llvm "/bin/llvm-config" "\"
  541. cc = \"" gcc "/bin/gcc" "\"
  542. cxx = \"" gcc "/bin/g++" "\"
  543. ar = \"" binutils "/bin/ar" "\"
  544. jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
  545. [dist]
  546. ") port)))
  547. #t)))
  548. (add-after 'configure 'provide-cc
  549. (lambda* (#:key inputs #:allow-other-keys)
  550. (symlink (string-append (assoc-ref inputs "gcc") "/bin/gcc")
  551. "/tmp/cc")
  552. (setenv "PATH" (string-append "/tmp:" (getenv "PATH")))
  553. #t))
  554. (add-after 'provide-cc 'configure-archiver
  555. (lambda* (#:key inputs #:allow-other-keys)
  556. (substitute* "src/build_helper/lib.rs"
  557. ;; Make sure "ar" is always used as the archiver.
  558. (("\"musl\"") "\"\"")
  559. ;; Then substitute "ar" by our name.
  560. (("\"ar\"") (string-append "\""
  561. (assoc-ref inputs "binutils")
  562. "/bin/ar\"")))
  563. #t))
  564. (delete 'patch-cargo-tomls)
  565. (add-before 'build 'reset-timestamps-after-changes
  566. (lambda* _
  567. (for-each
  568. (lambda (filename)
  569. ;; Rust 1.20.0 treats timestamp 0 as "file doesn't exist".
  570. ;; Therefore, use timestamp 1.
  571. (utime filename 1 1 1 1))
  572. (find-files "." #:directories? #t))
  573. #t))
  574. (replace 'build
  575. (lambda* _
  576. (invoke "./x.py" "build")
  577. (invoke "./x.py" "build" "src/tools/cargo")))
  578. (replace 'check
  579. (lambda* _
  580. ;; Disable parallel execution to prevent EAGAIN errors when
  581. ;; running tests.
  582. (invoke "./x.py" "-j1" "test" "-vv")
  583. (invoke "./x.py" "-j1" "test" "src/tools/cargo")
  584. #t))
  585. (replace 'install
  586. (lambda* (#:key outputs #:allow-other-keys)
  587. (invoke "./x.py" "install")
  588. (substitute* "config.toml"
  589. ;; replace prefix to specific output
  590. (("prefix = \"[^\"]*\"")
  591. (string-append "prefix = \"" (assoc-ref outputs "cargo") "\"")))
  592. (invoke "./x.py" "install" "cargo")))
  593. (add-after 'install 'delete-install-logs
  594. (lambda* (#:key outputs #:allow-other-keys)
  595. (define (delete-manifest-file out-path file)
  596. (delete-file (string-append out-path "/lib/rustlib/" file)))
  597. (let ((out (assoc-ref outputs "out"))
  598. (cargo-out (assoc-ref outputs "cargo")))
  599. (for-each
  600. (lambda (file) (delete-manifest-file out file))
  601. '("install.log"
  602. "manifest-rust-docs"
  603. "manifest-rust-std-x86_64-unknown-linux-gnu"
  604. "manifest-rustc"))
  605. (for-each
  606. (lambda (file) (delete-manifest-file cargo-out file))
  607. '("install.log"
  608. "manifest-cargo"))
  609. #t)))
  610. (add-after 'install 'wrap-rustc
  611. (lambda* (#:key inputs outputs #:allow-other-keys)
  612. (let ((out (assoc-ref outputs "out"))
  613. (libc (assoc-ref inputs "libc"))
  614. (ld-wrapper (assoc-ref inputs "ld-wrapper")))
  615. ;; Let gcc find ld and libc startup files.
  616. (wrap-program (string-append out "/bin/rustc")
  617. `("PATH" ":" prefix (,(string-append ld-wrapper "/bin")))
  618. `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib"))))
  619. #t))))))))))
  620. (define-public rust-1.21
  621. (let ((base-rust (rust-bootstrapped-package rust-1.20 "1.21.0"
  622. "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp")))
  623. (package
  624. (inherit base-rust)
  625. (arguments
  626. (substitute-keyword-arguments (package-arguments base-rust)
  627. ((#:phases phases)
  628. `(modify-phases ,phases
  629. (add-after 'configure 'remove-ar
  630. (lambda* (#:key inputs #:allow-other-keys)
  631. ;; Remove because toml complains about "unknown field".
  632. (substitute* "config.toml"
  633. (("^ar =.*") "\n"))
  634. #t)))))))))
  635. (define-public rust-1.22
  636. (let ((base-rust (rust-bootstrapped-package rust-1.21 "1.22.1"
  637. "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb")))
  638. (package
  639. (inherit base-rust)
  640. (arguments
  641. (substitute-keyword-arguments (package-arguments base-rust)
  642. ((#:phases phases)
  643. `(modify-phases ,phases
  644. (add-after 'unpack 'remove-flaky-test
  645. (lambda _
  646. ;; See <https://github.com/rust-lang/rust/issues/43402>.
  647. (when (file-exists? "src/test/run-make/issue-26092")
  648. (delete-file-recursively "src/test/run-make/issue-26092"))
  649. #t)))))))))
  650. (define-public rust-1.23
  651. (let ((base-rust (rust-bootstrapped-package rust-1.22 "1.23.0"
  652. "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l")))
  653. (package
  654. (inherit base-rust)
  655. (arguments
  656. (substitute-keyword-arguments (package-arguments base-rust)
  657. ((#:phases phases)
  658. `(modify-phases ,phases
  659. (delete 'configure-archiver)
  660. (delete 'remove-ar)
  661. (add-after 'unpack 'dont-build-native
  662. (lambda _
  663. ;; XXX: Revisit this when we use gcc 6.
  664. (substitute* "src/binaryen/CMakeLists.txt"
  665. (("ADD_COMPILE_FLAG\\(\\\"-march=native\\\"\\)") ""))
  666. #t)))))))))
  667. (define-public rust-1.24
  668. (let ((base-rust
  669. (rust-bootstrapped-package rust-1.23 "1.24.1"
  670. "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y")))
  671. (package
  672. (inherit base-rust)
  673. (arguments
  674. (substitute-keyword-arguments (package-arguments base-rust)
  675. ((#:phases phases)
  676. `(modify-phases ,phases
  677. (delete 'use-readelf-for-tests)
  678. (replace 'patch-aarch64-test
  679. (lambda* _
  680. (substitute* "src/librustc_metadata/dynamic_lib.rs"
  681. ;; This test is known to fail on aarch64 and powerpc64le:
  682. ;; https://github.com/rust-lang/rust/issues/45410
  683. (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
  684. #t)))))))))
  685. ;;; Rust 1.25 release support work with llvm 6--but build with llvm 6 is
  686. ;;; not determenistic due to <https://github.com/rust-lang/rust/issues/50556>.
  687. ;;; Keep using llvm 3.9.1 until builds become determenistic
  688. (define-public rust-1.25
  689. (let ((base-rust
  690. (rust-bootstrapped-package rust-1.24 "1.25.0"
  691. "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf")))
  692. (package
  693. (inherit base-rust)
  694. (source
  695. (origin
  696. (inherit (package-source base-rust))
  697. (snippet '(begin
  698. (delete-file-recursively "src/jemalloc")
  699. (delete-file-recursively "src/llvm")
  700. (delete-file-recursively "src/llvm-emscripten")
  701. #t))
  702. (patches (search-patches
  703. "rust-1.25-accept-more-detailed-gdb-lines.patch"))))
  704. (arguments
  705. (substitute-keyword-arguments (package-arguments base-rust)
  706. ((#:phases phases)
  707. `(modify-phases ,phases
  708. (add-after 'patch-cargo-tests 'patch-cargo-index-update
  709. (lambda _
  710. (substitute* "src/tools/cargo/tests/generate-lockfile.rs"
  711. ;; This test wants to update the crate index.
  712. (("fn no_index_update") "#[ignore]\nfn no_index_update"))
  713. #t))
  714. (replace 'patch-aarch64-test
  715. (lambda _
  716. (substitute* "src/librustc_metadata/dynamic_lib.rs"
  717. ;; This test is known to fail on aarch64 and powerpc64le:
  718. ;; https://github.com/rust-lang/rust/issues/45410
  719. (("fn test_loading_cosine") "#[ignore]\nfn test_loading_cosine"))
  720. ;; This test fails on aarch64 with llvm@6.0:
  721. ;; https://github.com/rust-lang/rust/issues/49807
  722. ;; other possible solution:
  723. ;; https://github.com/rust-lang/rust/pull/47688
  724. (delete-file "src/test/debuginfo/by-value-self-argument-in-trait-impl.rs")
  725. #t))
  726. (delete 'ignore-glibc-2.27-incompatible-test))))))))
  727. (define-public rust-1.26
  728. (let ((base-rust
  729. (rust-bootstrapped-package rust-1.25 "1.26.2"
  730. "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv")))
  731. (package
  732. (inherit base-rust)
  733. (source
  734. (origin
  735. (inherit (package-source base-rust))
  736. (patches (search-patches
  737. "rust-coresimd-doctest.patch"
  738. "rust-1.25-accept-more-detailed-gdb-lines.patch"))))
  739. (arguments
  740. (substitute-keyword-arguments (package-arguments base-rust)
  741. ((#:phases phases)
  742. `(modify-phases ,phases
  743. ;; binaryen was replaced with LLD project from LLVM
  744. (delete 'dont-build-native)
  745. (replace 'check
  746. (lambda* _
  747. ;; Enable parallel execution.
  748. (let ((parallel-job-spec
  749. (string-append "-j" (number->string
  750. (min 4
  751. (parallel-job-count))))))
  752. (invoke "./x.py" parallel-job-spec "test" "-vv")
  753. (invoke "./x.py" parallel-job-spec "test"
  754. "src/tools/cargo"))))
  755. (replace 'remove-unsupported-tests
  756. (lambda* _
  757. ;; Our ld-wrapper cannot process non-UTF8 bytes in LIBRARY_PATH.
  758. ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
  759. (delete-file-recursively "src/test/run-make-fulldeps/linker-output-non-utf8")
  760. #t))
  761. (replace 'patch-cargo-tests
  762. (lambda* _
  763. (substitute* "src/tools/cargo/tests/testsuite/build.rs"
  764. (("/usr/bin/env") (which "env"))
  765. ;; Guix llvm is compiled without asmjs-unknown-emscripten.
  766. (("fn wasm32_final_outputs") "#[ignore]\nfn wasm32_final_outputs"))
  767. (substitute* "src/tools/cargo/tests/testsuite/death.rs"
  768. ;; This is stuck when built in container.
  769. (("fn ctrl_c_kills_everyone") "#[ignore]\nfn ctrl_c_kills_everyone"))
  770. ;; Prints test output in the wrong order when built on
  771. ;; i686-linux.
  772. (substitute* "src/tools/cargo/tests/testsuite/test.rs"
  773. (("fn cargo_test_env") "#[ignore]\nfn cargo_test_env"))
  774. ;; Avoid dependency on "git".
  775. (substitute* "src/tools/cargo/tests/testsuite/new.rs"
  776. (("fn author_prefers_cargo") "#[ignore]\nfn author_prefers_cargo")
  777. (("fn finds_author_git") "#[ignore]\nfn finds_author_git")
  778. (("fn finds_local_author_git") "#[ignore]\nfn finds_local_author_git"))
  779. #t))
  780. ;; TODO(rebuild-rust): Remove this phase in rust-1.28 when rebuilding.
  781. (add-after 'patch-cargo-tests 'disable-cargo-test-for-nightly-channel
  782. (lambda* _
  783. ;; This test failed to work on "nightly" channel builds
  784. ;; https://github.com/rust-lang/cargo/issues/5648
  785. (substitute* "src/tools/cargo/tests/testsuite/resolve.rs"
  786. (("fn test_resolving_minimum_version_with_transitive_deps")
  787. "#[ignore]\nfn test_resolving_minimum_version_with_transitive_deps"))
  788. #t))
  789. (replace 'patch-cargo-index-update
  790. (lambda* _
  791. (substitute* "src/tools/cargo/tests/testsuite/generate_lockfile.rs"
  792. ;; This test wants to update the crate index.
  793. (("fn no_index_update") "#[ignore]\nfn no_index_update"))
  794. #t)))))))))
  795. (define-public rust-1.27
  796. (let ((base-rust
  797. (rust-bootstrapped-package rust-1.26 "1.27.2"
  798. "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs")))
  799. (package
  800. (inherit base-rust)
  801. (source
  802. (origin
  803. (inherit (package-source base-rust))
  804. (patches (search-patches "rust-coresimd-doctest.patch"
  805. "rust-bootstrap-stage0-test.patch"
  806. "rust-1.25-accept-more-detailed-gdb-lines.patch"
  807. "rust-reproducible-builds.patch"))))
  808. (native-inputs
  809. ;; FIXME: Rust 1.27 and some later versions require GDB 8.2 specifically.
  810. ;; See <https://bugs.gnu.org/37810>.
  811. (alist-replace "gdb" (list gdb-8.2)
  812. (package-native-inputs base-rust)))
  813. (arguments
  814. (substitute-keyword-arguments (package-arguments base-rust)
  815. ((#:phases phases)
  816. `(modify-phases ,phases
  817. (add-before 'install 'mkdir-prefix-paths
  818. (lambda* (#:key outputs #:allow-other-keys)
  819. ;; As result of https://github.com/rust-lang/rust/issues/36989
  820. ;; `prefix' directory should exist before `install' call
  821. (mkdir-p (assoc-ref outputs "out"))
  822. (mkdir-p (assoc-ref outputs "cargo"))
  823. #t))
  824. (add-after 'patch-cargo-tests 'disable-thinlto-test
  825. (lambda* _
  826. ;; thinlto required llvm 6.0 for work
  827. (substitute* "src/tools/cargo/tests/testsuite/path.rs"
  828. (("fn thin_lto_works") "#[ignore]\nfn thin_lto_works"))
  829. #t)))))))))
  830. (define-public rust-1.28
  831. (let ((base-rust
  832. (rust-bootstrapped-package rust-1.27 "1.28.0"
  833. "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx")))
  834. (package
  835. (inherit base-rust)
  836. (source
  837. (origin
  838. (inherit (package-source base-rust))
  839. (patches (search-patches "rust-coresimd-doctest.patch"
  840. "rust-bootstrap-stage0-test.patch"
  841. "rust-1.25-accept-more-detailed-gdb-lines.patch"
  842. "rust-reproducible-builds.patch"))))
  843. (inputs
  844. ;; Use LLVM 6.0
  845. (alist-replace "llvm" (list llvm-6)
  846. (package-inputs base-rust)))
  847. (arguments
  848. (substitute-keyword-arguments (package-arguments base-rust)
  849. ((#:phases phases)
  850. `(modify-phases ,phases
  851. (add-after 'configure 'enable-codegen-tests
  852. ;; Codegen tests should pass with llvm 6, so enable them.
  853. (lambda* _
  854. (substitute* "config.toml"
  855. (("codegen-tests = false") ""))
  856. #t))
  857. (add-after 'patch-tests 'disable-amd64-avx-test
  858. ;; That test would fail on x86_64 machines without avx.
  859. (lambda* _
  860. (substitute* "src/test/run-pass/issue-44056.rs"
  861. (("only-x86_64") "ignore-test"))
  862. #t))
  863. ;; The thinlto test should pass with llvm 6.
  864. (delete 'disable-thinlto-test))))))))
  865. (define-public rust-1.29
  866. (let ((base-rust
  867. (rust-bootstrapped-package rust-1.28 "1.29.2"
  868. "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h")))
  869. (package
  870. (inherit base-rust)
  871. (source
  872. (origin
  873. (inherit (package-source base-rust))
  874. (patches (search-patches "rust-1.25-accept-more-detailed-gdb-lines.patch"
  875. "rust-reproducible-builds.patch")))))))
  876. (define-public rust-1.30
  877. (let ((base-rust
  878. (rust-bootstrapped-package rust-1.29 "1.30.1"
  879. "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn")))
  880. (package
  881. (inherit base-rust)
  882. (source
  883. (origin
  884. (inherit (package-source base-rust))
  885. (snippet '(begin
  886. (delete-file-recursively "src/jemalloc")
  887. (delete-file-recursively "src/llvm")
  888. (delete-file-recursively "src/llvm-emscripten")
  889. (delete-file-recursively "src/tools/clang")
  890. (delete-file-recursively "src/tools/lldb")
  891. #t))))
  892. (arguments
  893. (substitute-keyword-arguments (package-arguments base-rust)
  894. ((#:phases phases)
  895. `(modify-phases ,phases
  896. (add-after 'patch-cargo-tests 'patch-cargo-env-shebang
  897. (lambda* (#:key inputs #:allow-other-keys)
  898. (let ((coreutils (assoc-ref inputs "coreutils")))
  899. (substitute* "src/tools/cargo/tests/testsuite/fix.rs"
  900. ;; Cargo has a test which explicitly sets a
  901. ;; RUSTC_WRAPPER environment variable which points
  902. ;; to /usr/bin/env. Since it's not a shebang, it
  903. ;; needs to be manually patched
  904. (("\"/usr/bin/env\"")
  905. (string-append "\"" coreutils "/bin/env\"")))
  906. #t)))
  907. (add-after 'patch-cargo-env-shebang 'ignore-cargo-package-tests
  908. (lambda* _
  909. (substitute* "src/tools/cargo/tests/testsuite/package.rs"
  910. ;; These tests largely check that cargo outputs warning/error
  911. ;; messages as expected. It seems that cargo outputs an
  912. ;; absolute path to something in the store instead of the
  913. ;; expected relative path (e.g. `[..]`) so we'll ignore
  914. ;; these for now
  915. (("fn include") "#[ignore]\nfn include")
  916. (("fn exclude") "#[ignore]\nfn exclude"))
  917. #t))
  918. ;; The test has been moved elsewhere.
  919. (replace 'disable-amd64-avx-test
  920. (lambda _
  921. (substitute* "src/test/ui/run-pass/issues/issue-44056.rs"
  922. (("only-x86_64") "ignore-test"))
  923. #t)))))))))
  924. (define (patch-command-exec-tests-phase test-path)
  925. "The command-exec.rs test moves around between releases. We need to apply
  926. a Guix-specific patch to it for each release. This function generates the phase
  927. that applies said patch, parametrized by the test-path. This is done this way
  928. because the phase is more complex than the equivalents for other tests that
  929. move around."
  930. `(lambda* (#:key inputs #:allow-other-keys)
  931. (let ((coreutils (assoc-ref inputs "coreutils")))
  932. (substitute* ,test-path
  933. ;; This test suite includes some tests that the stdlib's
  934. ;; `Command` execution properly handles situations where
  935. ;; the environment or PATH variable are empty, but this
  936. ;; fails since we don't have `echo` available in the usual
  937. ;; Linux directories.
  938. ;; NB: the leading space is so we don't fail a tidy check
  939. ;; for trailing whitespace, and the newlines are to ensure
  940. ;; we don't exceed the 100 chars tidy check as well
  941. ((" Command::new\\(\"echo\"\\)")
  942. (string-append "\nCommand::new(\"" coreutils "/bin/echo\")\n")))
  943. #t)))
  944. (define-public rust-1.31
  945. (let ((base-rust
  946. (rust-bootstrapped-package rust-1.30 "1.31.1"
  947. "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli")))
  948. (package
  949. (inherit base-rust)
  950. (arguments
  951. (substitute-keyword-arguments (package-arguments base-rust)
  952. ((#:phases phases)
  953. `(modify-phases ,phases
  954. (add-after 'patch-tests 'patch-command-exec-tests
  955. ,(patch-command-exec-tests-phase
  956. "src/test/run-pass/command-exec.rs"))
  957. ;; The test has been moved elsewhere.
  958. (replace 'disable-amd64-avx-test
  959. (lambda _
  960. (substitute* "src/test/ui/issues/issue-44056.rs"
  961. (("only-x86_64") "ignore-test"))
  962. #t))
  963. (add-after 'patch-tests 'patch-process-docs-rev-cmd
  964. (lambda* _
  965. ;; Disable some doc tests which depend on the "rev" command
  966. ;; https://github.com/rust-lang/rust/pull/58746
  967. (substitute* "src/libstd/process.rs"
  968. (("```rust") "```rust,no_run"))
  969. #t)))))))))
  970. (define-public rust-1.32
  971. (let ((base-rust
  972. (rust-bootstrapped-package rust-1.31 "1.32.0"
  973. "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac")))
  974. (package
  975. (inherit base-rust)
  976. (source
  977. (origin
  978. (inherit (package-source base-rust))
  979. (snippet '(begin (delete-file-recursively "src/llvm")
  980. (delete-file-recursively "src/llvm-emscripten")
  981. (delete-file-recursively "src/tools/clang")
  982. (delete-file-recursively "src/tools/lldb")
  983. (delete-file-recursively "vendor/jemalloc-sys/jemalloc")
  984. #t))
  985. (patches (search-patches "rust-reproducible-builds.patch"))
  986. ;; the vendor directory has moved to the root of
  987. ;; the tarball, so we have to strip an extra prefix
  988. (patch-flags '("-p2"))))
  989. (inputs
  990. ;; Downgrade to LLVM 6, all LTO tests appear to fail with LLVM 7.0.1
  991. (alist-replace "llvm" (list llvm-6)
  992. (package-inputs base-rust)))
  993. (arguments
  994. (substitute-keyword-arguments (package-arguments base-rust)
  995. ((#:phases phases)
  996. `(modify-phases ,phases
  997. ;; Cargo.lock and the vendor/ directory have been moved to the
  998. ;; root of the rust tarball
  999. (replace 'patch-cargo-checksums
  1000. (lambda* _
  1001. (use-modules (guix build cargo-utils))
  1002. (substitute* "Cargo.lock"
  1003. (("(\"checksum .* = )\".*\"" all name)
  1004. (string-append name "\"" ,%cargo-reference-hash "\"")))
  1005. (generate-all-checksums "vendor")
  1006. #t))
  1007. (add-after 'enable-codegen-tests 'override-jemalloc
  1008. (lambda* (#:key inputs #:allow-other-keys)
  1009. ;; The compiler is no longer directly built against jemalloc,
  1010. ;; but rather via the jemalloc-sys crate (which vendors the
  1011. ;; jemalloc source). To use jemalloc we must enable linking to
  1012. ;; it (otherwise it would use the system allocator), and set
  1013. ;; an environment variable pointing to the compiled jemalloc.
  1014. (substitute* "config.toml"
  1015. (("^jemalloc =.*$") "")
  1016. (("[[]rust[]]") "\n[rust]\njemalloc=true\n"))
  1017. (setenv "JEMALLOC_OVERRIDE" (string-append (assoc-ref inputs "jemalloc")
  1018. "/lib/libjemalloc_pic.a"))
  1019. #t))
  1020. ;; Remove no longer relevant steps
  1021. (delete 'remove-flaky-test)
  1022. (delete 'patch-aarch64-test))))))))
  1023. (define-public rust-1.33
  1024. (let ((base-rust
  1025. (rust-bootstrapped-package rust-1.32 "1.33.0"
  1026. "152x91mg7bz4ygligwjb05fgm1blwy2i70s2j03zc9jiwvbsh0as")))
  1027. (package
  1028. (inherit base-rust)
  1029. (source
  1030. (origin
  1031. (inherit (package-source base-rust))
  1032. (patches '())
  1033. (patch-flags '("-p1"))))
  1034. (inputs
  1035. ;; Upgrade to jemalloc@5.1.0
  1036. (alist-replace "jemalloc" (list jemalloc)
  1037. (package-inputs base-rust)))
  1038. (arguments
  1039. (substitute-keyword-arguments (package-arguments base-rust)
  1040. ((#:phases phases)
  1041. `(modify-phases ,phases
  1042. (delete 'ignore-cargo-package-tests)
  1043. (add-after 'configure 'configure-test-threads
  1044. ;; Several rustc and cargo tests will fail if run on one core
  1045. ;; https://github.com/rust-lang/rust/issues/59122
  1046. ;; https://github.com/rust-lang/cargo/issues/6746
  1047. ;; https://github.com/rust-lang/rust/issues/58907
  1048. (lambda* (#:key inputs #:allow-other-keys)
  1049. (setenv "RUST_TEST_THREADS" "2")
  1050. #t)))))))))
  1051. (define-public rust-1.34
  1052. (let ((base-rust
  1053. (rust-bootstrapped-package rust-1.33 "1.34.1"
  1054. "19s09k7y5j6g3y4d2rk6kg9pvq6ml94c49w6b72dmq8p9lk8bixh")))
  1055. (package
  1056. (inherit base-rust)
  1057. (source
  1058. (origin
  1059. (inherit (package-source base-rust))
  1060. (snippet '(begin
  1061. (delete-file-recursively "src/llvm-emscripten")
  1062. (delete-file-recursively "src/llvm-project")
  1063. (delete-file-recursively "vendor/jemalloc-sys/jemalloc")
  1064. #t)))))))
  1065. (define-public rust-1.35
  1066. (let ((base-rust
  1067. (rust-bootstrapped-package rust-1.34 "1.35.0"
  1068. "0bbizy6b7002v1rdhrxrf5gijclbyizdhkglhp81ib3bf5x66kas")))
  1069. (package
  1070. (inherit base-rust)
  1071. (inputs
  1072. (alist-replace "llvm" (list llvm-8)
  1073. (package-inputs base-rust)))
  1074. (arguments
  1075. (substitute-keyword-arguments (package-arguments base-rust)
  1076. ((#:phases phases)
  1077. `(modify-phases ,phases
  1078. ;; The tidy test includes a pass which ensures large binaries
  1079. ;; don't accidentally get checked into the rust git repo.
  1080. ;; Unfortunately the test assumes that git is always available,
  1081. ;; so we'll comment out the invocation of this pass.
  1082. (add-after 'configure 'disable-tidy-bins-check
  1083. (lambda* _
  1084. (substitute* "src/tools/tidy/src/main.rs"
  1085. (("bins::check") "//bins::check"))
  1086. #t)))))))))
  1087. (define-public rust-1.36
  1088. (let ((base-rust
  1089. (rust-bootstrapped-package rust-1.35 "1.36.0"
  1090. "06xv2p6zq03lidr0yaf029ii8wnjjqa894nkmrm6s0rx47by9i04")))
  1091. (package
  1092. (inherit base-rust)
  1093. (arguments
  1094. (substitute-keyword-arguments (package-arguments base-rust)
  1095. ((#:phases phases)
  1096. `(modify-phases ,phases
  1097. (delete 'patch-process-docs-rev-cmd))))))))
  1098. (define-public rust-1.37
  1099. (let ((base-rust
  1100. (rust-bootstrapped-package rust-1.36 "1.37.0"
  1101. "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj")))
  1102. (package
  1103. (inherit base-rust)
  1104. (arguments
  1105. (substitute-keyword-arguments (package-arguments base-rust)
  1106. ((#:phases phases)
  1107. `(modify-phases ,phases
  1108. (add-before 'configure 'configure-cargo-home
  1109. (lambda _
  1110. (let ((cargo-home (string-append (getcwd) "/.cargo")))
  1111. (mkdir-p cargo-home)
  1112. (setenv "CARGO_HOME" cargo-home)
  1113. #t))))))))))
  1114. ;; TODO(rebuild-rust): Switch to LLVM 9 in 1.38 instead of 1.40.
  1115. (define-public rust-1.38
  1116. (let ((base-rust
  1117. (rust-bootstrapped-package rust-1.37 "1.38.0"
  1118. "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4")))
  1119. (package
  1120. (inherit base-rust)
  1121. #;(inputs
  1122. (alist-replace "llvm" (list llvm-9)
  1123. (package-inputs base-rust)))
  1124. (arguments
  1125. (substitute-keyword-arguments (package-arguments base-rust)
  1126. ((#:phases phases)
  1127. `(modify-phases ,phases
  1128. (replace 'patch-command-exec-tests
  1129. ,(patch-command-exec-tests-phase
  1130. "src/test/ui/command-exec.rs"))
  1131. (add-after 'patch-tests 'patch-command-uid-gid-test
  1132. (lambda _
  1133. (substitute* "src/test/ui/command-uid-gid.rs"
  1134. (("/bin/sh") (which "sh"))
  1135. (("ignore-sgx") "ignore-sgx\n// ignore-tidy-linelength"))
  1136. #t)))))))))
  1137. (define-public rust-1.39
  1138. (let ((base-rust
  1139. (rust-bootstrapped-package rust-1.38 "1.39.0"
  1140. "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl")))
  1141. (package
  1142. (inherit base-rust)
  1143. (arguments
  1144. (substitute-keyword-arguments (package-arguments base-rust)
  1145. ((#:phases phases)
  1146. `(modify-phases ,phases
  1147. (replace 'patch-cargo-checksums
  1148. ;; The Cargo.lock format changed.
  1149. (lambda* _
  1150. (use-modules (guix build cargo-utils))
  1151. (substitute* "Cargo.lock"
  1152. (("(checksum = )\".*\"" all name)
  1153. (string-append name "\"" ,%cargo-reference-hash "\"")))
  1154. (generate-all-checksums "vendor")
  1155. #t)))))))))
  1156. (define-public rust-1.40
  1157. (let ((base-rust
  1158. (rust-bootstrapped-package rust-1.39 "1.40.0"
  1159. "1ba9llwhqm49w7sz3z0gqscj039m53ky9wxzhaj11z6yg1ah15yx")))
  1160. (package
  1161. (inherit base-rust)
  1162. (inputs
  1163. (alist-replace "llvm" (list llvm-9)
  1164. (package-inputs base-rust)))
  1165. (source
  1166. (origin
  1167. (inherit (package-source base-rust))
  1168. ;; llvm-emscripten is no longer bundled, as that codegen backend
  1169. ;; got removed.
  1170. (snippet '(begin
  1171. (delete-file-recursively "src/llvm-project")
  1172. (delete-file-recursively "vendor/jemalloc-sys/jemalloc")
  1173. #t))))
  1174. (arguments
  1175. ;; Rust 1.40 does not ship rustc-internal libraries by default
  1176. ;; (see rustc-dev-split). This means that librustc_driver.so is no
  1177. ;; longer available in lib/rustlib/$target/lib, which is the directory
  1178. ;; included in the runpath of librustc_codegen_llvm-llvm.so.
  1179. ;; This is detected by our validate-runpath phase as an error, but it
  1180. ;; is harmless as the codegen backend is loaded by librustc_driver.so
  1181. ;; itself, which must at that point have been already loaded.
  1182. ;; As such, we skip validating the runpath for Rust 1.40.
  1183. ;; Rust 1.41 stopped putting the codegen backend in a separate library,
  1184. ;; which makes this workaround only necessary for this release.
  1185. (cons* #:validate-runpath? #f
  1186. (substitute-keyword-arguments (package-arguments base-rust)
  1187. ((#:phases phases)
  1188. `(modify-phases ,phases
  1189. ;; We often need to patch tests with various Guix-specific paths.
  1190. ;; This often increases the line length and makes tidy, rustc's
  1191. ;; style checker, complain. We could insert additional newlines
  1192. ;; or add an "// ignore-tidy-linelength" comment, but as an
  1193. ;; ignore comment must be used, both approaches are fragile due
  1194. ;; to upstream formatting changes. As such, disable running the
  1195. ;; linter during tests, since it's intended for rustc developers
  1196. ;; anyway.
  1197. ;;
  1198. ;; TODO(rebuild-rust): This phase could be added earlier to
  1199. ;; simplify a significant amount of code, but it would require
  1200. ;; rebuilding the entire rusty universe.
  1201. (add-after 'patch-tests 'neuter-tidy
  1202. (lambda _
  1203. (substitute* "src/bootstrap/builder.rs"
  1204. (("^.*::Tidy,") ""))
  1205. #t))
  1206. ;; TODO(rebuild-rust): Adapt the find-files approach for
  1207. ;; earlier testsuite patches.
  1208. (replace 'patch-command-uid-gid-test
  1209. (lambda _
  1210. (match (find-files "src/test" "command-uid-gid\\.rs")
  1211. ((file)
  1212. (substitute* file
  1213. (("/bin/sh") (which "sh")))))
  1214. #t))
  1215. (replace 'patch-command-exec-tests
  1216. ,(patch-command-exec-tests-phase
  1217. '(match (find-files "src/test" "command-exec\\.rs")
  1218. ((file) file))))
  1219. ;; TODO(rebuild-rust): The test in question got fixed long ago.
  1220. (delete 'disable-cargo-test-for-nightly-channel)
  1221. ;; The test got removed in commit 000fe63b6fc57b09828930cacbab20c2ee6e6d15
  1222. ;; "Remove painful test that is not pulling its weight"
  1223. (delete 'remove-unsupported-tests)))))))))
  1224. (define-public rust-1.41
  1225. (let ((base-rust
  1226. (rust-bootstrapped-package rust-1.40 "1.41.1"
  1227. "0ws5x0fxv57fyllsa6025h3q6j9v3m8nb3syl4x0hgkddq0kvj9q")))
  1228. (package
  1229. (inherit base-rust)
  1230. (arguments
  1231. (substitute-keyword-arguments (package-arguments base-rust)
  1232. ((#:validate-runpath? _) #t))))))
  1233. (define-public rust-1.42
  1234. (rust-bootstrapped-package rust-1.41 "1.42.0"
  1235. "0x9lxs82may6c0iln0b908cxyn1cv7h03n5cmbx3j1bas4qzks6j"))
  1236. (define-public rust-1.43
  1237. (rust-bootstrapped-package rust-1.42 "1.43.0"
  1238. "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm"))
  1239. (define-public rust-1.44
  1240. (rust-bootstrapped-package rust-1.43 "1.44.1"
  1241. "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))
  1242. (define-public rust-1.45
  1243. (let ((base-rust
  1244. (rust-bootstrapped-package rust-1.44 "1.45.0"
  1245. "0z6dh0yd3fcm3qh960wi4s6fa6pxz9mh77psycsqfkkx5kqra15s")))
  1246. (package
  1247. (inherit base-rust)
  1248. (source
  1249. (origin
  1250. (inherit (package-source base-rust))
  1251. (patches (search-patches "rust-1.45-linker-locale.patch"))))
  1252. (inputs
  1253. (alist-replace "llvm" (list llvm-10)
  1254. (package-inputs base-rust)))
  1255. (arguments
  1256. (substitute-keyword-arguments (package-arguments base-rust)
  1257. ((#:phases phases)
  1258. `(modify-phases ,phases
  1259. ;; These tests make sure that the parser behaves properly when
  1260. ;; a source file starts with a shebang. Unfortunately,
  1261. ;; the patch-shebangs phase changes the meaning of these edge-cases.
  1262. ;; We skip the test since it's drastically unlikely Guix's packaging
  1263. ;; will introduce a bug here.
  1264. (add-after 'patch-tests 'skip-shebang-tests
  1265. (lambda _
  1266. (with-directory-excursion "src/test/ui/parser/shebang"
  1267. (delete-file "shebang-doc-comment.rs")
  1268. (delete-file "sneaky-attrib.rs")
  1269. #t)))
  1270. ;; This test case synchronizes itself by starting a localhost TCP
  1271. ;; server. This doesn't work as networking is not available.
  1272. (add-after 'patch-tests 'skip-networking-test
  1273. (lambda _
  1274. (substitute* "src/tools/cargo/tests/testsuite/freshness.rs"
  1275. (("fn linking_interrupted" all)
  1276. (string-append "#[ignore] " all)))
  1277. #t)))))))))
  1278. ;; TODO(staging): Bump this variable to the latest packaged rust.
  1279. (define-public rust rust-1.39)