diff mbox series

[bug#64804,5/5] gnu: rust: Update to 1.71.

Message ID 5a852a27410291cb2dda00ed3f137b3cfbbca645.1690176958.git.fries1234@protonmail.com
State New
Headers show
Series [bug#64804,1/5] gnu: rust: Add rust-1.69. | expand

Commit Message

Fries July 24, 2023, 5:36 a.m. UTC
* gnu/packages/rust.scm (rust): Update to 1.71.
[arguments]: Extend the disable-tests-requiring-git and
disable-tests-requiring-mercurial phases to ignore more tests that will
fail the build.
---
 gnu/packages/rust.scm | 55 +++++++++++++++++++++++++++++++------------
 1 file changed, 40 insertions(+), 15 deletions(-)

Comments

Fries July 24, 2023, 5:51 a.m. UTC | #1
git-send-email wouldn't let me make a cover letter as the teams script thought 
it was an invalid patch so i'm going to send this email here.

this patch series updates the rust package to rust 1.71.0! this means programs 
that require newer std api's like the stablized OnceCell API that was added in 
rust 1.70 can be used! i submitted this patch before and i got some feedback 
from juliana so i split my patches into a patch series. 

i don't know what branch this should go in but i checked the submitting patch 
webpage and i think as a rust update would mean a lot of rebuilding, i think 
it should go into the core-updates branch but i see theres also a rust-team 
branch. i don't know which one would be optimal.
Efraim Flashner Oct. 1, 2023, 7:10 a.m. UTC | #2
On Mon, Jul 24, 2023 at 05:51:24AM +0000, Fries wrote:
> git-send-email wouldn't let me make a cover letter as the teams script thought 
> it was an invalid patch so i'm going to send this email here.
> 
> this patch series updates the rust package to rust 1.71.0! this means programs 
> that require newer std api's like the stablized OnceCell API that was added in 
> rust 1.70 can be used! i submitted this patch before and i got some feedback 
> from juliana so i split my patches into a patch series. 
> 
> i don't know what branch this should go in but i checked the submitting patch 
> webpage and i think as a rust update would mean a lot of rebuilding, i think 
> it should go into the core-updates branch but i see theres also a rust-team 
> branch. i don't know which one would be optimal.

Thanks for the patches!

Sorry it took me a while to get back to you, I had some time off during
the summer and needed a bit of a break after the last rust team merge.

I've applied patches 1, 2 and 4. I wasn't able to get rust-1.71 to build
so in the mean time I've bumped rust to 1.70 on the rust-team branch.
diff mbox series

Patch

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 03681d55ac..505075b9d6 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -776,7 +776,7 @@  (define rust-1.71
 ;;; Here we take the latest included Rust, make it public, and re-enable tests
 ;;; and extra components such as rustfmt.
 (define-public rust
-  (let ((base-rust rust-1.67))
+  (let ((base-rust rust-1.71))
     (package
       (inherit base-rust)
       (outputs (cons "rustfmt" (package-outputs base-rust)))
@@ -811,23 +811,42 @@  (define-public rust
                     (which "env")))))
              (add-after 'unpack 'disable-tests-requiring-git
                (lambda _
-                 (substitute* "src/tools/cargo/tests/testsuite/new.rs"
-                   (("fn author_prefers_cargo")
-                    "#[ignore]\nfn author_prefers_cargo")
-                   (("fn finds_author_git")
-                    "#[ignore]\nfn finds_author_git")
-                   (("fn finds_local_author_git")
-                    "#[ignore]\nfn finds_local_author_git"))))
+                 (substitute* "src/tools/cargo/tests/testsuite/git.rs"
+                    ,@(make-ignore-test-list
+                      '("fn fetch_downloads_with_git2_first_then_with_gitoxide_and_vice_versa"
+                        "fn git_fetch_cli_env_clean"
+                        "fn git_with_cli_force"
+                        "fn use_the_cli")))
+                  ;; Gitoxide tests require the network.
+                  (substitute* "src/tools/cargo/tests/testsuite/git_shallow.rs"
+                    ,@(make-ignore-test-list
+                      '("fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches"
+                        "fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again"
+                        "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness"
+                        "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch"
+                        "fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness"
+                        "fn gitoxide_clones_shallow_two_revs_same_deps"
+                        "fn gitoxide_git_dependencies_switch_from_branch_to_rev"
+                        "fn gitoxide_shallow_clone_followed_by_non_shallow_update"
+                        "fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency")))
+                  (substitute* "src/tools/cargo/tests/testsuite/offline.rs"
+                    ,@(make-ignore-test-list '("fn gitoxide_cargo_compile_offline_with_cached_git_dep_shallow_dep")))
+                  (substitute* "src/tools/cargo/tests/testsuite/patch.rs"
+                    ,@(make-ignore-test-list '("fn gitoxide_clones_shallow_old_git_patch")))))
              (add-after 'unpack 'disable-tests-requiring-mercurial
                (lambda _
                  (substitute*
-                   "src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/mod.rs"
-                   (("fn simple_hg_ignore_exists")
-                    "#[ignore]\nfn simple_hg_ignore_exists"))
+                  "src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/mod.rs"
+                  ,@(make-ignore-test-list '("fn case")))
                  (substitute*
                    "src/tools/cargo/tests/testsuite/init/mercurial_autodetect/mod.rs"
-                   (("fn mercurial_autodetect")
-                    "#[ignore]\nfn mercurial_autodetect"))))
+                   ,@(make-ignore-test-list '("fn case")))
+                 (substitute*
+                  "src/tools/cargo/tests/testsuite/init/simple_hg/mod.rs"
+                  ,@(make-ignore-test-list '("fn case")))
+                 (substitute*
+                  "src/tools/cargo/tests/testsuite/new.rs"
+                  ,@(make-ignore-test-list '("fn simple_hg")))))
              (add-after 'unpack 'disable-tests-broken-on-aarch64
                (lambda _
                  (with-directory-excursion "src/tools/cargo/tests/testsuite/"
@@ -870,7 +889,7 @@  (define-public rust
                ;; We skip the test since it's drastically unlikely Guix's
                ;; packaging will introduce a bug here.
                (lambda _
-                 (delete-file "src/test/ui/parser/shebang/sneaky-attrib.rs")))
+                 (delete-file "tests/ui/parser/shebang/sneaky-attrib.rs")))
              (add-after 'unpack 'patch-process-tests
                (lambda* (#:key inputs #:allow-other-keys)
                  (let ((bash (assoc-ref inputs "bash")))
@@ -903,11 +922,17 @@  (define-public rust
                                      "gdb = \"" gdb "/bin/gdb\"\n"))))))
              (replace 'build
                ;; Phase overridden to also build rustfmt.
-               (lambda* (#:key parallel-build? #:allow-other-keys)
+               (lambda* (#:key parallel-build? outputs #:allow-other-keys)
                  (let ((job-spec (string-append
                                   "-j" (if parallel-build?
                                            (number->string (parallel-job-count))
                                            "1"))))
+                   ;; Append the default output's lib folder to the RUSTFLAGS
+                   ;; environment variable. This lets programs like rustfmt
+                   ;; that depend on rustc's shared libraries like rustfmt work.
+                   (setenv "RUSTFLAGS"
+                    (format #f "-C link-arg=-Wl,-rpath,~a/lib"
+                      (assoc-ref outputs "out")))
                    (invoke "./x.py" job-spec "build"
                            "library/std" ;rustc
                            "src/tools/cargo"