-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
rustbuild: Implement make dist
#32237
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
r? @brson |
// installed | ||
t!(fs::create_dir_all(&overlay)); | ||
let cp = |file: &str| { | ||
t!(fs::copy(build.src.join(file), overlay.join(file))); |
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.
So the install script uses the install
command all over the place instead of just normal file copies. I'm... not really sure why, but maybe you know @brson? Was it to just explicitly control the permissions? I wouldn't mind adding a little wrapper to this module to do that, but I'm mainly just curious if there are reasons beyond permissions that install
is used.
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.
@alexcrichton Just permissions.
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.
And I think this code should change to set the permissions. The installer will actually set them all itself itself during install, but that's a hack because we've historically produced seemingly-broken tarballs that don't retain their permissions. The installer should not be doing that and the permissions should be configured correctly before packaging. Here's the permissions rust-installer expects.
f5fb248
to
689e6bb
Compare
For now this is also rebased on #32206, but the only relevant commit to this PR is the last one. |
2a01d58
to
c00fef1
Compare
This commit fixes our support for cross compiling a compiler to run on FreeBSD. Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1] which I hope to soon use to start producing FreeBSD nightly compilers. With the `make dist` support added in rust-lang#32237 we should be able to produce standard rustc/rust-std packages for FreeBSD through a new slave with this cross compiler. Currently, however, we don't "Just Work" when cross compiling FreeBSD and a number of changes were required (part of this PR). They include: * A few build fixes were needed in LLVM. Our own branch has been rebased on the actual 3.8 release and I applied one extra commit [2] which contains two fixes: 1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately this doesn't take into account when we're cross compiling, and as predicted the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which is what we're compiling for which fixes the problem. 2. The `PATH_MAX` constant is apparently defined in a different location than many other Unix systems, so a file which required this just needed some help to keep compiling. * Support for compiling compiler-rt with CMake has been added to rustbuild. It looks like it just emulates Linux in what it compiles as it didn't seem to naturally produce anything else... At least the architecture is right, so seems good for now at least! [1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile [2]: rust-lang/llvm@be89e4b5 [3]: https://bugs.webkit.org/show_bug.cgi?id=138420
☔ The latest upstream changes (presumably #32206) made this pull request unmergeable. Please resolve the merge conflicts. |
rustbuild: Fix cross compiling to FreeBSD This commit fixes our support for cross compiling a compiler to run on FreeBSD. Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1] which I hope to soon use to start producing FreeBSD nightly compilers. With the `make dist` support added in #32237 we should be able to produce standard rustc/rust-std packages for FreeBSD through a new slave with this cross compiler. Currently, however, we don't "Just Work" when cross compiling FreeBSD and a number of changes were required (part of this PR). They include: * A few build fixes were needed in LLVM. Our own branch has been rebased on the actual 3.8 release and I applied one extra commit [2] which contains two fixes: 1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately this doesn't take into account when we're cross compiling, and as predicted the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which is what we're compiling for which fixes the problem. 2. The `PATH_MAX` constant is apparently defined in a different location than many other Unix systems, so a file which required this just needed some help to keep compiling. * Support for compiling compiler-rt with CMake has been added to rustbuild. It looks like it just emulates Linux in what it compiles as it didn't seem to naturally produce anything else... At least the architecture is right, so seems good for now at least! [1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile [2]: rust-lang/llvm@be89e4b5 [3]: https://bugs.webkit.org/show_bug.cgi?id=138420
c00fef1
to
40449c4
Compare
I tried
Note that
Which seems to indicate that rustbuild is trying to run the rustc ARM binary. Then @alexcrichton suggested this patch. I applied and after calling
I hope this info helps to debug the problem! |
40449c4
to
942d609
Compare
Ok, I've pushed a commit which I believe fixes that problem. I... am not entirely sure how it fixes it but it seems to work locally. |
Confirmed to work:
r? @brson |
rust-buildbot expects that as part of |
cp("LICENSE-MIT"); | ||
cp("README.md"); | ||
// tiny morsel of metadata is used by rust-packaging | ||
let version = &build.version; |
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 think this value is incorrect. It should be something like rustc 1.9.0-nightly (c66d2380a 2016-03-15)
, exactly what rustc prints for --version
.
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.
Oh looks like I actually managed to accomodate for this!
942d609
to
cff833f
Compare
This commit implements the `make dist` command in the new rustbuild build system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount of complexity between those two files, not all of which is likely justified, so the Rust implementation is *much* smaller. Currently the implementation still shells out to rust-installer as well as some python scripts, but ideally we'd rewrite it all in the future to not shell out and be in Rust proper.
cff833f
to
6cc06b3
Compare
re-r? @brson Added an |
@bors r+ |
📌 Commit 6cc06b3 has been approved by |
rustbuild: Implement `make dist` This commit implements the `make dist` command in the new rustbuild build system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount of complexity between those two files, not all of which is likely justified, so the Rust implementation is *much* smaller. Currently the implementation still shells out to rust-installer as well as some python scripts, but ideally we'd rewrite it all in the future to not shell out and be in Rust proper.
💔 Test failed - auto-win-gnu-64-nopt-t |
@bors: retry On Wed, Mar 16, 2016 at 7:44 PM, bors notifications@github.com wrote:
|
rustbuild: Implement `make dist` This commit implements the `make dist` command in the new rustbuild build system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount of complexity between those two files, not all of which is likely justified, so the Rust implementation is *much* smaller. Currently the implementation still shells out to rust-installer as well as some python scripts, but ideally we'd rewrite it all in the future to not shell out and be in Rust proper.
This commit implements the
make dist
command in the new rustbuild buildsystem, porting over
dist.mk
andprepare.mk
into Rust. There's a huge amountof complexity between those two files, not all of which is likely justified, so
the Rust implementation is much smaller.
Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.