gnu: rust: Refactor in order to prepare for newer Rust versions.
* gnu/packages/rust.scm (rust-source): Rename to... (rust-source-pre-1.32): ...this. Add PATCH-FLAGS. (rust-bootstrapped-package): Rename to... (rust-bootstrapped-package-pre-1.32): ...this. (rust-source): New procedure. (rust-bootstrapped-package): New procedure. (mrustc): Use rust-bootstrapped-package-pre-1.32. (rust-1.19): Use rust-bootstrapped-package-pre-1.32. (rust-1.20): Use rust-bootstrapped-package-pre-1.32. (rust-1.21): Use rust-bootstrapped-package-pre-1.32. (rust-1.22): Use rust-bootstrapped-package-pre-1.32. (rust-1.23): Use rust-bootstrapped-package-pre-1.32. (rust-1.24): Use rust-bootstrapped-package-pre-1.32. (rust-1.25): Use rust-bootstrapped-package-pre-1.32. (rust-1.26): Use rust-bootstrapped-package-pre-1.32. (rust-1.27): Use rust-bootstrapped-package-pre-1.32. (rust-1.28): Use rust-bootstrapped-package-pre-1.32. (rust-1.29): Use rust-bootstrapped-package-pre-1.32. (rust-1.30): Use rust-bootstrapped-package-pre-1.32. (rust): Use rust-bootstrapped-package-pre-1.32. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
		
							parent
							
								
									1d6c047937
								
							
						
					
					
						commit
						339c1365fd
					
				
					 1 changed files with 84 additions and 49 deletions
				
			
		|  | @ -70,7 +70,10 @@ | ||||||
|     (_                (nix-system->gnu-triplet system)))) |     (_                (nix-system->gnu-triplet system)))) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
| (define* (rust-source version hash #:key (patches '())) | (define* (rust-source-pre-1.32 version hash | ||||||
|  |                                #:key | ||||||
|  |                                (patches '()) | ||||||
|  |                                (patch-flags '("-p1"))) | ||||||
|   (origin |   (origin | ||||||
|     (method url-fetch) |     (method url-fetch) | ||||||
|     (uri (string-append "https://static.rust-lang.org/dist/" |     (uri (string-append "https://static.rust-lang.org/dist/" | ||||||
|  | @ -78,16 +81,51 @@ | ||||||
|     (sha256 (base32 hash)) |     (sha256 (base32 hash)) | ||||||
|     (modules '((guix build utils))) |     (modules '((guix build utils))) | ||||||
|     (snippet '(begin (delete-file-recursively "src/llvm") #t)) |     (snippet '(begin (delete-file-recursively "src/llvm") #t)) | ||||||
|     (patches (map search-patch patches)))) |     (patches (map search-patch patches)) | ||||||
|  |     (patch-flags patch-flags))) | ||||||
|  | 
 | ||||||
|  | (define* (rust-bootstrapped-package-pre-1.32 base-rust version checksum | ||||||
|  |                                              #:key | ||||||
|  |                                              (patches '()) | ||||||
|  |                                              (patch-flags '("-p1"))) | ||||||
|  |   "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST. | ||||||
|  | Specific to rust versions before 1.32." | ||||||
|  |   (package | ||||||
|  |     (inherit base-rust) | ||||||
|  |     (version version) | ||||||
|  |     (source | ||||||
|  |      (rust-source-pre-1.32 version checksum #:patches patches #:patch-flags patch-flags)) | ||||||
|  |     (native-inputs | ||||||
|  |      (alist-replace "cargo-bootstrap" (list base-rust "cargo") | ||||||
|  |                     (alist-replace "rustc-bootstrap" (list base-rust) | ||||||
|  |                                    (package-native-inputs base-rust)))))) | ||||||
|  | 
 | ||||||
|  | (define* (rust-source version hash | ||||||
|  |                       #:key | ||||||
|  |                       (patches '()) | ||||||
|  |                       (patch-flags '("-p1"))) | ||||||
|  |   (origin | ||||||
|  |     (method url-fetch) | ||||||
|  |     (uri (string-append "https://static.rust-lang.org/dist/" | ||||||
|  |                         "rustc-" version "-src.tar.gz")) | ||||||
|  |     (sha256 (base32 hash)) | ||||||
|  |     (modules '((guix build utils))) | ||||||
|  |     (snippet '(begin (delete-file-recursively "src/llvm") | ||||||
|  |                      (delete-file-recursively "vendor/jemalloc-sys/jemalloc") | ||||||
|  |                      #t)) | ||||||
|  |     (patches (map search-patch patches)) | ||||||
|  |     (patch-flags patch-flags))) | ||||||
| 
 | 
 | ||||||
| (define* (rust-bootstrapped-package base-rust version checksum | (define* (rust-bootstrapped-package base-rust version checksum | ||||||
|                                     #:key (patches '())) |                                     #:key | ||||||
|  |                                     (patches '()) | ||||||
|  |                                     (patch-flags '("-p1"))) | ||||||
|   "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST." |   "Bootstrap rust VERSION with source checksum CHECKSUM patched with PATCHES using BASE-RUST." | ||||||
|   (package |   (package | ||||||
|     (inherit base-rust) |     (inherit base-rust) | ||||||
|     (version version) |     (version version) | ||||||
|     (source |     (source | ||||||
|      (rust-source version checksum #:patches patches)) |      (rust-source version checksum #:patches patches #:patch-flags patch-flags)) | ||||||
|     (native-inputs |     (native-inputs | ||||||
|      (alist-replace "cargo-bootstrap" (list base-rust "cargo") |      (alist-replace "cargo-bootstrap" (list base-rust "cargo") | ||||||
|                     (alist-replace "rustc-bootstrap" (list base-rust) |                     (alist-replace "rustc-bootstrap" (list base-rust) | ||||||
|  | @ -116,7 +154,7 @@ | ||||||
|          ("flex" ,flex) |          ("flex" ,flex) | ||||||
|          ;; Required for the libstd sources. |          ;; Required for the libstd sources. | ||||||
|          ("rustc" |          ("rustc" | ||||||
|           ,(rust-source "1.19.0" "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm")))) |           ,(rust-source-pre-1.32 "1.19.0" "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm")))) | ||||||
|       (arguments |       (arguments | ||||||
|        `(#:test-target "local_tests" |        `(#:test-target "local_tests" | ||||||
|          #:make-flags (list (string-append "LLVM_CONFIG=" |          #:make-flags (list (string-append "LLVM_CONFIG=" | ||||||
|  | @ -189,7 +227,7 @@ safety and thread safety guarantees.") | ||||||
|   (package |   (package | ||||||
|     (name "rust") |     (name "rust") | ||||||
|     (version "1.19.0") |     (version "1.19.0") | ||||||
|     (source (rust-source version "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm" |     (source (rust-source-pre-1.32 version "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm" | ||||||
|             #:patches '("rust-1.19-mrustc.patch"))) |             #:patches '("rust-1.19-mrustc.patch"))) | ||||||
|     (outputs '("out" "cargo")) |     (outputs '("out" "cargo")) | ||||||
|     (properties '((timeout . 72000)               ;20 hours |     (properties '((timeout . 72000)               ;20 hours | ||||||
|  | @ -425,7 +463,7 @@ safety and thread safety guarantees.") | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.20 | (define-public rust-1.20 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.19 "1.20.0" |          (rust-bootstrapped-package-pre-1.32 rust-1.19 "1.20.0" | ||||||
|           "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a"))) |           "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a"))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|  | @ -570,7 +608,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
|                    #t)))))))))) |                    #t)))))))))) | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.21 | (define-public rust-1.21 | ||||||
|   (let ((base-rust (rust-bootstrapped-package rust-1.20 "1.21.0" |   (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.20 "1.21.0" | ||||||
|                     "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp"))) |                     "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp"))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|  | @ -586,7 +624,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
|                  #t))))))))) |                  #t))))))))) | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.22 | (define-public rust-1.22 | ||||||
|   (let ((base-rust (rust-bootstrapped-package rust-1.21 "1.22.1" |   (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.21 "1.22.1" | ||||||
|                     "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"))) |                     "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|  | @ -602,7 +640,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
|                  #t))))))))) |                  #t))))))))) | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.23 | (define-public rust-1.23 | ||||||
|   (let ((base-rust (rust-bootstrapped-package rust-1.22 "1.23.0" |   (let ((base-rust (rust-bootstrapped-package-pre-1.32 rust-1.22 "1.23.0" | ||||||
|                     "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))) |                     "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|  | @ -621,8 +659,8 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.24 | (define-public rust-1.24 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.23 "1.24.1" |          (rust-bootstrapped-package-pre-1.32 rust-1.23 "1.24.1" | ||||||
|                                     "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) |           "1vv10x2h9kq7fxh2v01damdq8pvlp5acyh1kzcda9sfjx12kv99y"))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|       (arguments |       (arguments | ||||||
|  | @ -643,7 +681,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| ;;; Keep using llvm 3.9.1 until builds become determenistic | ;;; Keep using llvm 3.9.1 until builds become determenistic | ||||||
| (define-public rust-1.25 | (define-public rust-1.25 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.24 "1.25.0" |          (rust-bootstrapped-package-pre-1.32 rust-1.24 "1.25.0" | ||||||
|           "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf" |           "0baxjr99311lvwdq0s38bipbnj72pn6fgbk6lcq7j555xq53mxpf" | ||||||
|           #:patches '("rust-1.25-accept-more-detailed-gdb-lines.patch")))) |           #:patches '("rust-1.25-accept-more-detailed-gdb-lines.patch")))) | ||||||
|     (package |     (package | ||||||
|  | @ -674,7 +712,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.26 | (define-public rust-1.26 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.25 "1.26.2" |          (rust-bootstrapped-package-pre-1.32 rust-1.25 "1.26.2" | ||||||
|           "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv" |           "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv" | ||||||
|           #:patches '("rust-coresimd-doctest.patch" |           #:patches '("rust-coresimd-doctest.patch" | ||||||
|                       "rust-1.25-accept-more-detailed-gdb-lines.patch")))) |                       "rust-1.25-accept-more-detailed-gdb-lines.patch")))) | ||||||
|  | @ -729,13 +767,13 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.27 | (define-public rust-1.27 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.26 "1.27.2" |          (rust-bootstrapped-package-pre-1.32 rust-1.26 "1.27.2" | ||||||
|                                     "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs" |           "0pg1s37bhx9zqbynxyydq5j6q7kij9vxkcv8maz0m25prm88r0cs" | ||||||
|                                     #:patches |           #:patches | ||||||
|                                     '("rust-coresimd-doctest.patch" |           '("rust-coresimd-doctest.patch" | ||||||
|                                       "rust-bootstrap-stage0-test.patch" |             "rust-bootstrap-stage0-test.patch" | ||||||
|                                       "rust-1.25-accept-more-detailed-gdb-lines.patch" |             "rust-1.25-accept-more-detailed-gdb-lines.patch" | ||||||
|                                       "rust-reproducible-builds.patch")))) |             "rust-reproducible-builds.patch")))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|       (arguments |       (arguments | ||||||
|  | @ -758,13 +796,13 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.28 | (define-public rust-1.28 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.27 "1.28.0" |          (rust-bootstrapped-package-pre-1.32 rust-1.27 "1.28.0" | ||||||
|                                     "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx" |           "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx" | ||||||
|                                     #:patches |           #:patches | ||||||
|                                     '("rust-coresimd-doctest.patch" |           '("rust-coresimd-doctest.patch" | ||||||
|                                       "rust-bootstrap-stage0-test.patch" |             "rust-bootstrap-stage0-test.patch" | ||||||
|                                       "rust-1.25-accept-more-detailed-gdb-lines.patch" |             "rust-1.25-accept-more-detailed-gdb-lines.patch" | ||||||
|                                       "rust-reproducible-builds.patch")))) |             "rust-reproducible-builds.patch")))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|       (inputs |       (inputs | ||||||
|  | @ -792,22 +830,22 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.29 | (define-public rust-1.29 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.28 "1.29.2" |          (rust-bootstrapped-package-pre-1.32 rust-1.28 "1.29.2" | ||||||
|                                     "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h" |           "1jb787080z754caa2w3w1amsygs4qlzj9rs1vy64firfmabfg22h" | ||||||
|                                     #:patches |           #:patches | ||||||
|                                     '("rust-1.25-accept-more-detailed-gdb-lines.patch" |           '("rust-1.25-accept-more-detailed-gdb-lines.patch" | ||||||
|                                       "rust-reproducible-builds.patch")))) |             "rust-reproducible-builds.patch")))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust)))) |       (inherit base-rust)))) | ||||||
| 
 | 
 | ||||||
| (define-public rust-1.30 | (define-public rust-1.30 | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.29 "1.30.1" |          (rust-bootstrapped-package-pre-1.32 rust-1.29 "1.30.1" | ||||||
|                                     "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn" |           "0aavdc1lqv0cjzbqwl5n59yd0bqdlhn0zas61ljf38yrvc18k8rn" | ||||||
|                                     #:patches |           #:patches | ||||||
|                                     '("rust-1.25-accept-more-detailed-gdb-lines.patch" |           '("rust-1.25-accept-more-detailed-gdb-lines.patch" | ||||||
|                                       "rust-1.30-gdb-llvm.patch" |             "rust-1.30-gdb-llvm.patch" | ||||||
|                                       "rust-reproducible-builds.patch")))) |             "rust-reproducible-builds.patch")))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|       (inputs |       (inputs | ||||||
|  | @ -839,19 +877,16 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\" | ||||||
|                    ;; these for now |                    ;; these for now | ||||||
|                    (("fn include") "#[ignore]\nfn include") |                    (("fn include") "#[ignore]\nfn include") | ||||||
|                    (("fn exclude") "#[ignore]\nfn exclude")) |                    (("fn exclude") "#[ignore]\nfn exclude")) | ||||||
|                    #t)) |                    #t))))))))) | ||||||
|              ;; Appears that this test isn't currently running and has been |  | ||||||
|              ;; moved elsewhere, so the patch doesn't apply. |  | ||||||
|              (delete 'disable-amd64-avx-test)))))))) |  | ||||||
| 
 | 
 | ||||||
| (define-public rust | (define-public rust | ||||||
|   (let ((base-rust |   (let ((base-rust | ||||||
|          (rust-bootstrapped-package rust-1.30 "1.31.1" |          (rust-bootstrapped-package-pre-1.32 rust-1.30 "1.31.1" | ||||||
|                                     "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli" |           "0sk84ff0cklybcp0jbbxcw7lk7mrm6kb6km5nzd6m64dy0igrlli" | ||||||
|                                     #:patches |           #:patches | ||||||
|                                     '("rust-1.25-accept-more-detailed-gdb-lines.patch" |           '("rust-1.25-accept-more-detailed-gdb-lines.patch" | ||||||
|                                       "rust-1.30-gdb-llvm.patch" |             "rust-1.30-gdb-llvm.patch" | ||||||
|                                       "rust-reproducible-builds.patch")))) |             "rust-reproducible-builds.patch")))) | ||||||
|     (package |     (package | ||||||
|       (inherit base-rust) |       (inherit base-rust) | ||||||
|       (arguments |       (arguments | ||||||
|  |  | ||||||
		Reference in a new issue