-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix compiling for x86_64-unknown-linux-gnu when it's not the default target #1559
Conversation
crate_, version, target, crate_path | ||
); | ||
|
||
assert!(target_docs_present); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked and this does fail without the fix in this commit.
[2021-11-24T17:58:10Z DEBUG docs_rs::docbuilder::rustwide_builder] adding sources into database
[2021-11-24T17:58:10Z DEBUG docs_rs::db::add_package] Adding package into database
[2021-11-24T17:58:10Z DEBUG docs_rs::db::add_package] Adding doc coverage into database
[2021-11-24T17:58:10Z DEBUG docs_rs::db::add_package] Adding build into database
[2021-11-24T17:58:10Z INFO docs_rs::db::add_package] Updating crate data for xingapi
[2021-11-24T17:58:10Z DEBUG docs_rs::docbuilder::rustwide_builder] cleaning old storage folder rustdoc/xingapi/0.3.3/
[2021-11-24T17:58:10Z DEBUG docs_rs::docbuilder::rustwide_builder] cleaning old storage folder sources/xingapi/0.3.3/
[2021-11-24T17:58:11Z ERROR docs_rs::web::page::templates] Failed to load rustc resource suffix: missing rustc version
[2021-11-24T17:58:11Z INFO docs_rs::web] Running docs.rs web server on http://127.0.0.1:39737
thread 'docbuilder::rustwide_builder::tests::test_cross_compile_non_host_default' panicked at 'assertion failed: target_docs_present', src/docbuilder/rustwide_builder.rs:1004:13
failures:
docbuilder::rustwide_builder::tests::test_cross_compile_non_host_default
I think we probably want to override |
3fb8c49
to
7629bd8
Compare
-let source = build.host_target_dir().join("doc");
+let source = build.host_target_dir().join(HOST_TARGET).join("doc"); |
2c619f9
to
9672ae5
Compare
- only skip `--target` for proc-macros - don't try build non-host targets for proc-macros, since they're not supported anyway. - change rustwide_builder to look in the platform-specific target directory for the default target - stores all source docs in the target/{target_name} directory, rather than trying to special case anything - this also creates the `{target_name}` directory before copying, because `rename` delegates directly to the syscall and doesn't create parent directories
9672ae5
to
7007dc9
Compare
Yay, this is finally passing tests :) this should be ready for rereview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM now. Tested locally with a variety of proc-macro/non-proc-macro/default=host/default=non-host crates and all build variants appear to work correctly.
This was the previous behaviour before rust-lang#1559 for the default target and is most likely expected by users.
This was the previous behaviour before #1559 for the default target and is most likely expected by users.
Fixes #1556 by only special casing proc-macros instead of any crate targeting the host.
r? @Nemo157