semarie / build-rust

Script helper for building rustc and cargo from source on OpenBSD (without rustup)
59 stars 15 forks source link

Building nightly fails #6

Closed ltratt closed 7 years ago

ltratt commented 7 years ago

Although building beta works fine, when I try and build nightly I get this:

$ ./build.sh nightly
Tue Apr 25 09:50:16 BST 2017: target: nightly - x86_64-unknown-openbsd
Tue Apr 25 09:50:16 BST 2017: fetching (cache hit): rust-src-nightly.tar.gz
Tue Apr 25 09:50:16 BST 2017: fetching (cache hit): rust-src-nightly.tar.gz
Tue Apr 25 09:50:16 BST 2017: removing /home/ltratt/tmp/build-rust/build_dir/rustc/rust-src-nightly
Tue Apr 25 09:50:24 BST 2017: extracting rust-src-nightly.tar.gz
Tue Apr 25 09:50:29 BST 2017: patching nightly
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|https://github.com/llvm-mirror/llvm/commit/f92d91a710f48a26e44451f18f0081b6af0670b7
|--- src/llvm/include/llvm/Support/Threading.h.orig     Wed Dec 21 00:36:08 2016
|+++ src/llvm/include/llvm/Support/Threading.h  Sun Jan 29 09:20:53 2017
--------------------------
Patching file src/llvm/include/llvm/Support/Threading.h using Plan A...
Hunk #1 succeeded at 20.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- src/bootstrap/lib.rs.orig  Sat Feb 25 10:19:47 2017
|+++ src/bootstrap/lib.rs       Sat Feb 25 10:19:57 2017
--------------------------
Patching file src/bootstrap/lib.rs using Plan A...
Hunk #1 succeeded at 872 with fuzz 1 (offset 54 lines).
done
Tue Apr 25 09:50:29 BST 2017: fetching (cache miss): cargo-nightly 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9    0     9    0     0     18      0 --:--:-- --:--:-- --:--:--    19
Tue Apr 25 09:50:30 BST 2017: patching cargo-nightly
error: no matching package named `fs2` found (required by `cargo`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: = 0.4.1

The particular failing crate varies each time, so it's not really anything to do with fs2. The part of build.sh that's failing is this:

"${build_rust}" "${target}" cargo-patch

which in my checkout is line 500.

I'm not really sure what the root cause is. What seems weird is that, even if I cd to that directory and try and run cargo (either the one built as part of this repo, or the one in /usr/local/bin/) it doesn't seem to download the crate index. I have no idea what's going on, and some hand-hacking hasn't really got me anywhere. I know that @vext01 has also seen this problem; I've tried it with nightlies from the last 3 days, so I don't think it's a one-off.

vext01 commented 7 years ago

Hi Sabastien,

I'm going to be needing a rust nightly soon. Any idea how to fix this issue? I also notice the patches seems to need revision too.

Thanks

semarie commented 7 years ago

I'm going to be needing a rust nightly soon. Any idea how to fix this issue? I also notice the patches seems to need revision too.

I was waiting for rustc 1.17.0 to be commited. landry@ did it today.

The patches aren't required for now: the script uses devel/llvm instead of building the embedded LLVM now.

semarie commented 7 years ago

the build of rustc creates a .cargo/config file with vendored directory. It works for building rustc, but not for building cargo. I updated build.sh to remove the file when cargo is built.

vext01 commented 7 years ago

Great, thanks. I'll give it a go today.

semarie commented 7 years ago

The current branch is still a bit experimental. I have already built beta and the build for nightly isn't terminated for now.

As usual after a new release, it is recommanded to do a full cleanup: removing build_dir and install_dir before building nightly ; and to have latest stable rust version from ports (rust-1.17.0).

vext01 commented 7 years ago

yep, i always start fresh, just to be sure.

vext01 commented 7 years ago

Great job:

arrakis> rustc --version
rustc 1.19.0-nightly

Thanks :)