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

Adjust some #[cfg]s to take non-Unix non-Windows operating systems into account #83013

Merged
merged 1 commit into from Mar 12, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Mar 11, 2021

This makes compilation to such targets (e.g. wasm32-wasi) easier.

cc rust-lang/miri#722 bb6d1d0#r48100619

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 11, 2021
@@ -1238,6 +1238,11 @@ fn exec_linker(
err.raw_os_error() == Some(ERROR_FILENAME_EXCED_RANGE)
}

#[cfg(not(any(unix, windows)))]
fn command_line_too_big(_: &io::Error) -> bool {
false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if true is more suitable here, since returning false means it will never fallback to an @-file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. On one hand defaulting to true could cause linking to fail in some cases. On the other hand it would be a slight performance regression that is likely small enough that no-one will investigate, while failed linking would cause people to notice it and patch rustc to add an implementation of command_line_too_big for their platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it false for now.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2021

r? @bjorn3

@rust-highfive rust-highfive assigned bjorn3 and unassigned oli-obk Mar 11, 2021
@bjorn3
Copy link
Member

bjorn3 commented Mar 11, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Mar 11, 2021

📌 Commit 00c0872 has been approved by bjorn3

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 11, 2021
@bjorn3
Copy link
Member

bjorn3 commented Mar 11, 2021

@bors rollup=maybe

@ghost
Copy link
Author

ghost commented Mar 11, 2021

rollup=maybe

Did you mean always? Isn't the default maybe?

screenshot

@bjorn3
Copy link
Member

bjorn3 commented Mar 11, 2021

Yeah

@bors rollup=always

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 11, 2021
Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account

This makes compilation to such targets (e.g. `wasm32-wasi`) easier.

cc rust-lang/miri#722 rust-lang@bb6d1d0#r48100619
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 11, 2021
Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account

This makes compilation to such targets (e.g. `wasm32-wasi`) easier.

cc rust-lang/miri#722 rust-lang@bb6d1d0#r48100619
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2021
Rollup of 11 pull requests

Successful merges:

 - rust-lang#80385 (Clarify what `Cell::replace` returns)
 - rust-lang#82571 (Rustdoc Json: Add tests for Reexports, and improve jsondocck)
 - rust-lang#82860 (Add `-Z unpretty` flag for the THIR)
 - rust-lang#82950 (convert slice doc link to intra-doc links)
 - rust-lang#82965 (Add spirv extension handling in compiletest)
 - rust-lang#82966 (update MSYS2 link in README)
 - rust-lang#82979 (Fix "run" button position in error index)
 - rust-lang#83001 (Ignore Vim swap files)
 - rust-lang#83003 (rustdoc: tweak the search index format)
 - rust-lang#83013 (Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account)
 - rust-lang#83018 (Reintroduce accidentally deleted assertions.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5ab8f53 into rust-lang:master Mar 12, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 12, 2021
@ghost ghost deleted the cfg-unix-windows branch March 13, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants