Closed zacknewman closed 1 year ago
ah. I missed that, sorry. embedded llvm needs patching.
for now, you could manually apply the following diff at lang/rust (another diff might be need if you are building on sparc64)
I will look to add that in the script.
Tangentially related, what's the reason for the lack of a rust-nightly
package? I believe such a package would be useful even in -release/-stable. Asked differently without the air of entitlement, would such a package/port be accepted if a maintainer could be found? Nightly is useful even when it's not the newest version of rustc
. People that only have rust
installed would be unaffected, and people that go through the "hassle" of building nightly would likely prefer simply installing the package/port. I realize people can also use the RUSTC_BOOTSTRAP
hack to get stable to compile nightly features, but that should be avoided if one can help it. One can then use an alias
for cargo
in the event they want the default to be nightly.
On -current this would make the lack of rustup
practically moot.
for now, you could manually apply the following diff at lang/rust (another diff might be need if you are building on sparc64)
I'll try. Embarrassingly, I am not terribly familiar with applying diffs and patches. As for your sparc64 remark, the script is currently only configured to work on i386 and amd64; so that architecture is not relevant:
case $(arch -s) in
i386)
triple_arch='i686-unknown-openbsd'
;;
amd64)
triple_arch='x86_64-unknown-openbsd'
;;
*)
echo "error: unsupported arch" >&2
exit 1
;;
esac
I am not confident enough to patch build.sh
myself, but I was finally able to compile nightly on -stable with the following changes:
build$ diff build.sh build_rust/build.sh
193,202d192
< ## openssl-sys: libressl in -current isn't explicitly supported
< echo "patching: openssl-sys: libressl in -current isn't explicitly supported"
< # keep last supported version in hold space
< # when seeing last entry (error), replace with hold space (as generic)
< sed -i -e "/ => ('.', '.'),/h" \
< -e "/ => ('.', '.', '.'),/h" \
< -e "/_ => version_error(),/{g; s/(.*) =>/_ =>/; }" \
< "${rustc_xdir}/vendor/openssl-sys/build/main.rs"
< sed -i 's/"files":{[^}]*}/"files":{}/' "${rustc_xdir}/vendor/openssl-sys/.cargo-checksum.json"
<
228a219,222
> ## patch embedded llvm
> echo 'patching: embedded llvm'
> sed -i 's/set(suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})/set(suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES} ".so.[0-9]+.[0-9]+")/' "${rustc_xdir}/src/llvm-project/llvm/cmake/modules/GetLibraryName.cmake"
The removal of the patch to openssl-sys
was simply because that crate supports the version of LibreSSL on -stable.
I successfully compiled some silly code with nightly features just to make sure it works, and it does.
I did run into an issue where I needed to set LD_LIBRARY_PATH=/home/zack/build_rust/install_dir/nightly/lib
, or more aggressively ldconfig -m /home/zack/build_rust/install_dir/nightly/lib
. I am sure that is obvious to you, but it was not to me; therefore it may make sense to add that to README.md
perhaps near where you state to amend the PATH
variable.
it should have been fixed in last commits (d9bfaeb0e508dfa16e9e666f37774ff3f8725b91). thanks.
Forgive the noise if this issue is due to trying to compile nightly on -stable, but I get the following error:
when compiling
rustc_driver v0.0.0
. Here is the last portion of the build:I have successfully built the version of
rust
from -current on -stable and made sure to use an embedded version of LLVM per your suggestion.