select the system certificates more reliably
The rust build requires cargo to connect to its servers, it needs system certificates to connect through MITM proxies or other various issues in corporate systems. This searches for more common locations to find those certificates and the name used by RHEL in addition to the usual debian convention. Fixes rust build on TOSS4.
This commit is contained in:
parent
367abcb801
commit
f80df0ca47
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
@ -92,8 +93,16 @@ def setup_build_environment(self, env):
|
|||||||
env.set("AR", ar.path)
|
env.set("AR", ar.path)
|
||||||
|
|
||||||
# Manually inject the path of openssl's certs for build.
|
# Manually inject the path of openssl's certs for build.
|
||||||
certs = join_path(self.spec["openssl"].prefix, "etc/openssl/cert.pem")
|
certs = None
|
||||||
env.set("CARGO_HTTP_CAINFO", certs)
|
for p in ("etc/openssl/cert.pem", "../etc/openssl/cert.pem",
|
||||||
|
"etc/ssl/certs/ca-bundle.crt", "../etc/ssl/certs/ca-bundle.crt"):
|
||||||
|
certs = join_path(self.spec["openssl"].prefix, p)
|
||||||
|
if os.path.exists(certs):
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
certs = None
|
||||||
|
if certs is not None:
|
||||||
|
env.set("CARGO_HTTP_CAINFO", certs)
|
||||||
|
|
||||||
def configure(self, spec, prefix):
|
def configure(self, spec, prefix):
|
||||||
opts = []
|
opts = []
|
||||||
|
Loading…
Reference in New Issue
Block a user