Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use syntax crate on FreeBSD with nightly #32984

Closed
saghm opened this issue Apr 15, 2016 · 6 comments
Closed

Unable to use syntax crate on FreeBSD with nightly #32984

saghm opened this issue Apr 15, 2016 · 6 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@saghm
Copy link

saghm commented Apr 15, 2016

When I try to compile a simple program using the syntax crate on FreeBSD, it seems to be unable to find the syntax library:

#![feature(rustc_private)]
extern crate syntax;

fn main() {
}

// error: can't find crate for `syntax`

I first got the error when trying to compile docopt_macros, but from the above test it seems clear that the issue is not in the crate itself.

I'm currently running nightly-2016-04-13 (installed from the newly-avaliable multirust toolchain for FreeBSD). In case it's helpful to know, there does seem to be a libsyntax-[hash].so in ~/.multirust/toolchains/nightly/lib, but I'm not sure how to figure out why I'm unable to use it.

@japaric
Copy link
Member

japaric commented Apr 15, 2016

I'm seeing the same on host=armv7-unknown-linux-gnueabihf (installed via rustup). But I think this is expected because there is no libsyntax.rlib in the .multirust directory.

cc @alexcrichton

@alexcrichton alexcrichton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Apr 15, 2016
@alexcrichton
Copy link
Member

Oh man, first off thanks for testing FreeBSD :). Second, thanks for the report!

Third, gah this is a rustbuild bug. It turns out that the rust-std package is actually "all target libraries" in the sense that it's more than just libstd, it's every target library we have available for that platform. Consequently, rustbuild needs to package librustc target libs into the rust-std package if the target is configured as a host.

cc @brson, seems surprising in the sense that "rust-std" is an odd name, but makes sense in terms of "that package contains all libraries for the target we have available".

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 15, 2016
Currently the `rust-std` package produced by rustbuild only contains the
standard library plus libtest, but the makefiles actually produce a `rust-std`
package with all known target libraries (including libsyntax, librustc, etc).
Tweak the behavior so the dependencies of the `dist-docs` step in rustbuild
depend on the compiler libraries as well (so that they're all packaged).

Closes rust-lang#32984
@hgrecco
Copy link

hgrecco commented Apr 17, 2016

Same problem in a RaspberryPi

pi@raspberrypi:~/demo $ rustup update
info: syncing channel updates for 'nightly-armv7-unknown-linux-gnueabihf'
info: checking for self-updates
info: rustup is up to date

  nightly-armv7-unknown-linux-gnueabihf unchanged - rustc 1.10.0-nightly (2174bd97c 2016-04-14)

pi@raspberrypi:~/demo $ cat x.rs
#![feature(rustc_private)]
extern crate syntax;

fn main() {
}
pi@raspberrypi:~/demo $ rustc x.rs
x.rs:2:1: 2:21 error: can't find crate for `syntax` [E0463]
x.rs:2 extern crate syntax;
       ^~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

@japaric
Copy link
Member

japaric commented Apr 17, 2016

@hgrecco I already mentioned the same problem happens on host=armv7-unknown-linux-gnueabihf 😄. And there's a fix in #33011.

OT: @hgrecco Is that an RPi 1 or RPi 2? Because you are not supposed to use the armv7-unknown-linux-gnueabihf target with the RPi 1. I actually expect rustc would crash in that case.

@hgrecco
Copy link

hgrecco commented Apr 17, 2016

@japaric Sorry about that!. I am using RPi 2.

@japaric
Copy link
Member

japaric commented Apr 17, 2016

Sorry about that!

It's okay! We got a confirmation of the bug 👍.

I am using RPi 2.

Never mind what I said then. (I was wondering if there was a bug where armv7 toolchain gets installed on the RPi 1. I'm glad that's not the case!)

bors added a commit that referenced this issue Apr 20, 2016
rustbuild: Package librustc & co for cross-hosts

Currently the `rust-std` package produced by rustbuild only contains the
standard library plus libtest, but the makefiles actually produce a `rust-std`
package with all known target libraries (including libsyntax, librustc, etc).
Tweak the behavior so the dependencies of the `dist-docs` step in rustbuild
depend on the compiler libraries as well (so that they're all packaged).

Closes #32984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants