git: cb6d9d1a623b - main - lang/rust-nightly: Update to 1.62.0.20220502

From: Tobias Kortkamp <tobik_at_FreeBSD.org>
Date: Tue, 03 May 2022 10:28:30 UTC
The branch main has been updated by tobik:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cb6d9d1a623b5dc4ed815d69211d264819be036e

commit cb6d9d1a623b5dc4ed815d69211d264819be036e
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2022-05-03 08:39:44 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2022-05-03 10:28:03 +0000

    lang/rust-nightly: Update to 1.62.0.20220502
    
    https://github.com/rust-lang/rust/compare/f4a7ce997a1d7546d2b737f8b87d36907bcea2ad...bed05e996e37e44b1a3980b84754af621fd3c4ce
---
 lang/rust-nightly/Makefile                           |  4 +---
 lang/rust-nightly/distinfo                           |  6 +++---
 .../files/no-hardlinks/patch-src_bootstrap_native.rs | 14 +++++++++-----
 .../files/patch-src_bootstrap_builder.rs             | 20 ++++++++++++++++++++
 .../files/patch-src_bootstrap_install.rs             |  8 ++++----
 lang/rust/Makefile                                   |  2 ++
 6 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/lang/rust-nightly/Makefile b/lang/rust-nightly/Makefile
index 72cc3b06a6ff..69510560fe8f 100644
--- a/lang/rust-nightly/Makefile
+++ b/lang/rust-nightly/Makefile
@@ -16,9 +16,7 @@ MASTERDIR=	${.CURDIR}/../rust
 PATCHDIR=	${.CURDIR}/files
 DISTINFO_FILE=	${.CURDIR}/distinfo
 
-OPTIONS_EXCLUDE=	DOCS
-
-NIGHTLY_DATE=		2022-04-09
+NIGHTLY_DATE=		2022-05-02
 BOOTSTRAPS_DATE=	2022-04-05
 RUST_BOOTSTRAP_VERSION=	beta
 
diff --git a/lang/rust-nightly/distinfo b/lang/rust-nightly/distinfo
index 6e397a600a31..8bfb4d5e8109 100644
--- a/lang/rust-nightly/distinfo
+++ b/lang/rust-nightly/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1649492829
-SHA256 (rust/2022-04-09/rustc-nightly-src.tar.xz) = b31ec602bf925d2af2ea242ca7d539b5e25332590d4b41da188d997cb7ce3fc3
-SIZE (rust/2022-04-09/rustc-nightly-src.tar.xz) = 136886400
+TIMESTAMP = 1651565397
+SHA256 (rust/2022-05-02/rustc-nightly-src.tar.xz) = 21cfcbc8ddc69b0dfc6dfc17c818cf327f94140f182633613d6f7d77387d2ce9
+SIZE (rust/2022-05-02/rustc-nightly-src.tar.xz) = 135572540
 SHA256 (rust/2022-04-05/rustc-beta-x86_64-unknown-freebsd.tar.xz) = 5b461322da60b08554f2557deb69485d3991abf13b75750a307c004d6547a42f
 SIZE (rust/2022-04-05/rustc-beta-x86_64-unknown-freebsd.tar.xz) = 77575576
 SHA256 (rust/2022-04-05/rust-std-beta-x86_64-unknown-freebsd.tar.xz) = d457f1c09dd446e30e94e4bcb1e3b5fde9cc54080cbe5e0a329ee810ab07d312
diff --git a/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs b/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs
index c1469453237d..1484fdeee67e 100644
--- a/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs
+++ b/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs
@@ -3,11 +3,11 @@ for building rust-lld.  Attempt to improve reliability of the build
 by not using it.  llvm-config-wrapper is a hack in the first place
 that is only really needed on Windows.
 
---- src/bootstrap/native.rs.orig	2020-07-17 17:26:27 UTC
+--- src/bootstrap/native.rs.orig	2022-05-01 20:28:31 UTC
 +++ src/bootstrap/native.rs
-@@ -542,26 +542,9 @@ impl Step for Lld {
+@@ -918,22 +918,6 @@ impl Step for Lld {
          let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld"));
-         configure_cmake(builder, target, &mut cfg, true);
+         configure_cmake(builder, target, &mut cfg, true, LdFlags::default());
  
 -        // This is an awful, awful hack. Discovered when we migrated to using
 -        // clang-cl to compile LLVM/LLD it turns out that LLD, when built out of
@@ -25,9 +25,13 @@ that is only really needed on Windows.
 -        // there's probably a lot of reasons you can't do that other than this.
 -        let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper");
 -
+         // Re-use the same flags as llvm to control the level of debug information
+         // generated for lld.
+         let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
+@@ -945,7 +929,7 @@ impl Step for Lld {
          cfg.out_dir(&out_dir)
-             .profile("Release")
--            .env("LLVM_CONFIG_REAL", &llvm_config)
+             .profile(profile)
+             .env("LLVM_CONFIG_REAL", &llvm_config)
 -            .define("LLVM_CONFIG_PATH", llvm_config_shim)
 +            .define("LLVM_CONFIG_PATH", &llvm_config)
              .define("LLVM_INCLUDE_TESTS", "OFF");
diff --git a/lang/rust-nightly/files/patch-src_bootstrap_builder.rs b/lang/rust-nightly/files/patch-src_bootstrap_builder.rs
new file mode 100644
index 000000000000..a694feae0641
--- /dev/null
+++ b/lang/rust-nightly/files/patch-src_bootstrap_builder.rs
@@ -0,0 +1,20 @@
+From 934145eb7023047e1add14f8bdad8e62a7c08d00 Mon Sep 17 00:00:00 2001
+From: alexey semenyuk <alexsemenyuk88@gmail.com>
+Date: Mon, 2 May 2022 19:24:50 +0000
+Subject: [PATCH] Enables option split-debuginfo on all platforms
+
+https://github.com/rust-lang/rust/pull/96648
+
+--- src/bootstrap/builder.rs.orig	2022-05-01 20:28:31 UTC
++++ src/bootstrap/builder.rs
+@@ -1406,9 +1406,7 @@ impl<'a> Builder<'a> {
+         // FIXME(davidtwco): #[cfg(not(bootstrap))] - #95612 needs to be in the bootstrap compiler
+         // for this conditional to be removed.
+         if !target.contains("windows") || compiler.stage >= 1 {
+-            if target.contains("linux") || target.contains("windows") {
+-                rustflags.arg("-Zunstable-options");
+-            }
++            rustflags.arg("-Zunstable-options");
+             match self.config.rust_split_debuginfo {
+                 SplitDebuginfo::Packed => rustflags.arg("-Csplit-debuginfo=packed"),
+                 SplitDebuginfo::Unpacked => rustflags.arg("-Csplit-debuginfo=unpacked"),
diff --git a/lang/rust-nightly/files/patch-src_bootstrap_install.rs b/lang/rust-nightly/files/patch-src_bootstrap_install.rs
index 59e25e10468d..e3afe8bad00c 100644
--- a/lang/rust-nightly/files/patch-src_bootstrap_install.rs
+++ b/lang/rust-nightly/files/patch-src_bootstrap_install.rs
@@ -4,14 +4,14 @@ It otherwise wastes significant time (there are a lot of individual
 files) and stages host docs, wasm docs, which unstages the host
 docs first.
 
---- src/bootstrap/install.rs.orig	2021-03-22 17:05:25 UTC
+--- src/bootstrap/install.rs.orig	2022-05-01 20:28:31 UTC
 +++ src/bootstrap/install.rs
-@@ -133,7 +133,7 @@ macro_rules! install {
+@@ -138,7 +138,7 @@ macro_rules! install {
  }
  
  install!((self, builder, _config),
--    Docs, "src/doc", _config.docs, only_hosts: false, {
-+    Docs, "src/doc", _config.docs, only_hosts: true, {
+-    Docs, path = "src/doc", _config.docs, only_hosts: false, {
++    Docs, path = "src/doc", _config.docs, only_hosts: true, {
          let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs");
          install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
      };
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 63cbce92cd92..f3fad6b4c84e 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -51,7 +51,9 @@ TMPDIR?=	${WRKDIR}
 
 OPTIONS_DEFINE=		DOCS GDB SOURCES WASM
 OPTIONS_DEFAULT=	SOURCES WASM
+.if !defined(NIGHTLY_DATE)
 OPTIONS_EXCLUDE=	DOCS # https://github.com/rust-lang/rust/issues/76526
+.endif
 
 GDB_DESC=	Install ports gdb (necessary for debugging rust programs)
 SOURCES_DESC=	Install source files