Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRestrict where in the tree platform-specific cfgs may be mentioned #36807
Conversation
rust-highfive
assigned
aturon
Sep 28, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
Looks great to me! |
alexcrichton
reviewed
Sep 29, 2016
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| #[cfg(target_os = "windows")] |
This comment has been minimized.
This comment has been minimized.
brson
force-pushed the
brson:pal
branch
from
6b8065a
to
c6c89f0
Sep 29, 2016
This comment has been minimized.
This comment has been minimized.
|
Updated. |
brson
force-pushed the
brson:pal
branch
from
4efa10f
to
2086608
Sep 29, 2016
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
alexcrichton
and unassigned
aturon
Sep 29, 2016
This comment has been minimized.
This comment has been minimized.
|
I did some more refactoring, moving the argument handling around. That'll surely bounce a few times on misc platforms... |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
2086608
to
54440be
Sep 29, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
54440be
to
5cf31ba
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
5cf31ba
to
1472c45
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
1472c45
to
ba9e75e
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
ba9e75e
to
57cd2d6
Sep 30, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
brson
force-pushed the
brson:pal
branch
from
b710344
to
1a30e0f
Oct 1, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Oct 1, 2016
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
1a30e0f
to
405c010
Oct 1, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Oct 2, 2016
This comment has been minimized.
This comment has been minimized.
|
|
brson
force-pushed the
brson:pal
branch
from
405c010
to
61afff3
Oct 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Oct 2, 2016
This comment has been minimized.
This comment has been minimized.
|
|
brson
added some commits
Sep 22, 2016
brson
force-pushed the
brson:pal
branch
from
61afff3
to
4d76ac8
Oct 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
brson commentedSep 28, 2016
With the ports of Rust never ending, it's important that we keep things tidy. The main thing this PR does is introduce a new "pal" (platform abstraction layer) tidy check that limits where platform-specific CFGs may appear.
This is intended to maintain existing standards of code organization
in hopes that the standard library will continue to be refactored to
isolate platform-specific bits, making porting easier; where "standard
library" roughly means "all the dependencies of the std and test
crates".
This generally means placing restrictions on where
cfg(unix),cfg(windows),cfg(target_os)andcfg(target_env)may appear,the basic objective being to isolate platform-specific code to the
platform-specific
std::sysmodules, and to the allocation,unwinding, and libc crates.
Following are the basic rules, though there are currently
exceptions:
There are plenty of exceptions today though, noted in the whitelist.
The end-state, IMO, is for the standard library to be portable by porting only
std::sys(possibly extracted to its own crate), an allocator crate, an unwinder crate, and possibly a libc crate (if std depends on it); but that outcome is far off and independent of the utility of enforcing where such code lives today.cc @rust-lang/libs