Repository: spack/spack

Issue:
Installation issue: Rust
### Steps to reproduce the issue

```console
Input spec
--------------------------------
 -   rust

Concretized
--------------------------------
 -   rust@1.70.0%gcc@11.4.0~analysis+clippy~docs+rustfmt+src build_system=generic arch=linux-ubuntu22.04-skylake
[+]      ^cmake@3.26.3%gcc@11.4.0~doc+ncurses+ownlibs~qt build_system=generic build_type=Release arch=linux-ubuntu22.04-skylake
[+]          ^ncurses@6.4%gcc@11.4.0~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^zlib@1.2.13%gcc@11.4.0+optimize+pic+shared build_system=makefile arch=linux-ubuntu22.04-skylake
[+]      ^curl@8.1.2%gcc@11.4.0~gssapi~ldap~libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs=shared,static tls=mbedtls,openssl arch=linux-ubuntu22.04-skylake
[+]          ^libssh2@1.10.0%gcc@11.4.0+shared build_system=autotools crypto=mbedtls patches=011d926 arch=linux-ubuntu22.04-skylake
[+]          ^mbedtls@2.28.2%gcc@11.4.0+pic build_system=makefile build_type=Release libs=shared,static arch=linux-ubuntu22.04-skylake
[+]          ^nghttp2@1.48.0%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]      ^libgit2@1.5.0%gcc@11.4.0~curl~ipo+mmap+ssh build_system=cmake build_type=Release generator=make https=system arch=linux-ubuntu22.04-skylake
[+]          ^gmake@4.4.1%gcc@11.4.0~guile build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^pcre@8.45%gcc@11.4.0~jit+multibyte+utf build_system=autotools arch=linux-ubuntu22.04-skylake
[+]      ^ninja@1.11.1%gcc@11.4.0+re2c build_system=generic arch=linux-ubuntu22.04-skylake
[+]          ^re2c@2.2%gcc@11.4.0 build_system=generic arch=linux-ubuntu22.04-skylake
[+]      ^openssl@3.1.1%gcc@11.4.0~docs~shared build_system=generic certs=mozilla arch=linux-ubuntu22.04-skylake
[+]          ^ca-certificates-mozilla@2023-05-30%gcc@11.4.0 build_system=generic arch=linux-ubuntu22.04-skylake
[+]          ^perl@5.38.0%gcc@11.4.0+cpanm+opcode+open+shared+threads build_system=generic arch=linux-ubuntu22.04-skylake
[+]              ^berkeley-db@18.1.40%gcc@11.4.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-skylake
[+]      ^pkgconf@1.9.5%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]      ^python@3.10.12%gcc@11.4.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,7d40923,f2fd060 arch=linux-ubuntu22.04-skylake
[+]          ^bzip2@1.0.8%gcc@11.4.0~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-skylake
[+]              ^diffutils@3.9%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^expat@2.5.0%gcc@11.4.0+libbsd build_system=autotools arch=linux-ubuntu22.04-skylake
[+]              ^libbsd@0.11.7%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]                  ^libmd@1.0.4%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^gdbm@1.23%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^gettext@0.21.1%gcc@11.4.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-ubuntu22.04-skylake
[+]              ^libiconv@1.17%gcc@11.4.0 build_system=autotools libs=shared,static arch=linux-ubuntu22.04-skylake
[+]              ^libxml2@2.10.3%gcc@11.4.0~python build_system=autotools arch=linux-ubuntu22.04-skylake
[+]              ^tar@1.34%gcc@11.4.0 build_system=autotools zip=pigz arch=linux-ubuntu22.04-skylake
[+]                  ^pigz@2.7%gcc@11.4.0 build_system=makefile arch=linux-ubuntu22.04-skylake
[+]                  ^zstd@1.5.5%gcc@11.4.0+programs build_system=makefile compression=none libs=shared,static arch=linux-ubuntu22.04-skylake
[+]          ^libffi@3.4.4%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^libxcrypt@4.4.35%gcc@11.4.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-ubuntu22.04-skylake
[+]          ^readline@8.2%gcc@11.4.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-skylake
[+]          ^sqlite@3.42.0%gcc@11.4.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^util-linux-uuid@2.38.1%gcc@11.4.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]          ^xz@5.4.1%gcc@11.4.0~pic build_system=autotools libs=shared,static arch=linux-ubuntu22.04-skylake
[+]      ^rust-bootstrap@1.70.0%gcc@11.4.0 build_system=generic arch=linux-ubuntu22.04-skylake

```


### Error message

Ping maintainer @alecbcs 

Thanks for looking into this!

<details><summary>Error message</summary>

<pre>
1 error found in build log:
     109    More details here: https://curl.se/docs/sslcerts.html
     110    
     111    curl failed to verify the legitimacy of the server and therefore could not
     112    establish a secure connection to it. To learn more about this situation and
     113    how to fix it, please visit the web page mentioned above.
     114    
  >> 115    error: failed to download llvm from ci
     116    
     117        help: old builds get deleted after a certain time
     118        help: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:
     119    
     120        [llvm]
     121        download-ci-llvm = false

</pre></details>


### Information on your system

* **Spack:** 0.21.0.dev0 (a8301709a8d925e062e31942123535dc8536fd4f)
* **Python:** 3.10.12
* **Platform:** linux-ubuntu22.04-skylake
* **Concretizer:** clingo

### Additional information

(no .txt allowed -> zip)
[spack-build-env.zip](https://github.com/spack/spack/files/12227240/spack-build-env.zip)
[spack-build-out.zip](https://github.com/spack/spack/files/12227241/spack-build-out.zip)


### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py
--- a/var/spack/repos/builtin/packages/rust/package.py
+++ b/var/spack/repos/builtin/packages/rust/package.py
@@ -116,6 +116,9 @@ def configure(self, spec, prefix):
         opts.append(f"build.cargo={spec['rust-bootstrap'].prefix.bin.cargo}")
         opts.append(f"build.rustc={spec['rust-bootstrap'].prefix.bin.rustc}")
 
+        # Disable bootstrap LLVM download.
+        opts.append("llvm.download-ci-llvm=false")
+
         # Convert opts to '--set key=value' format.
         flags = [flag for opt in opts for flag in ("--set", opt)]
 


Test patch: