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

adaptation to rustbuild for openbsd #38451

Merged
merged 4 commits into from
Dec 21, 2016
Merged

Conversation

semarie
Copy link
Contributor

@semarie semarie commented Dec 18, 2016

Since the switch to rustbuild, the build for openbsd is broken:

  • ar inference based on compiler name is wrong (OpenBSD usually use egcc, but ear doesn't exist)
  • make isn't GNU-make under OpenBSD (and others BSD platforms)
  • stdc++ isn't the right stdc++ library to link with (it should be estdc++)
  • corrects tests that don't pass anymore (problems related to rustbuild)

r? @alexcrichton

OpenBSD usually use an alternative compiler (`egcc') from ports. But the
`ar' is unprefixed as it comes from base.
the backtrace test doesn't work on openbsd as it doesn't
have support for libbacktrace without using filename.
the diff extends build_helper to provide an function to return the
expected name of GNU-make on the host: "make" or "gmake".

Fixes rust-lang#38429
@semarie
Copy link
Contributor Author

semarie commented Dec 18, 2016

The make commit will close #38429.

The implementation statically bound "gmake" to BSD and let "make" to others. Eventually, I could add the use of a variable MAKE to override the behaviour ?

@semarie
Copy link
Contributor Author

semarie commented Dec 18, 2016

I think I will keep some tests failing with vanilla configuration: the fact that egcc compiler isn't used (but cc) for some tests, make them to fail: cc (GCC 4.2) is unable to link properly estdc++ library when the test needs it.

A simple workaround is to have a directory in front of PATH with a symbolic link cc to egcc.

stdc++ is from base, and is an old library (GCC 4.2)
estdc++ is from ports, and is a recent library (GCC 4.9 currently)

as LLVM requires the newer version, use it if under OpenBSD.
@alexcrichton
Copy link
Member

Looks good to me, thanks! When this is ready just lemme know and I'll r+

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2016

I have a failing test (check-std-all) that seems related to build_helper and cargo features. I am unsure if it is related to my commits or not.

executing step Step { name: "check-std-all", stage: 2, host: "x86_64-unknown-openbsd", target: "x86_64-unknown-openbsd" }
Testing libstd stage2 (x86_64-unknown-openbsd -> x86_64-unknown-openbsd)
running: "/data/semarie/obj/rust-installs/beta/bin/cargo" "test" "-j" "4" "--target" "x86_64-unknown-openbsd" "-v" "--release" "--frozen" "--manifest-path" "/data/semarie/src/rust/src/rustc/std_shim/Cargo.toml" "--features" "panic-unwind jemalloc backtrace" "-p" "std_shim" "-p" "std" "-p" "rand" "-p" "libc" "-p" "compiler_builtins" "-p"
"alloc" "-p" "collections" "-p" "unwind" "-p" "std_unicode" "-p" "panic_abort" "-p" "build_helper" "-p" "alloc_system" "-p" "core" "--"
error: Package `build_helper v0.1.0 (file:///data/semarie/src/rust/src/build_helper)` does not have these features: `backtrace, panic-unwind, jemalloc`


command did not execute successfully: "/data/semarie/obj/rust-installs/beta/bin/cargo" "test" "-j" "4" "--target" "x86_64-unknown-openbsd" "-v" "--release" "--frozen" "--manifest-path" "/data/semarie/src/rust/src/rustc/std_shim/Cargo.toml" "--features" "panic-unwind jemalloc backtrace" "-p" "std_shim" "-p" "std" "-p" "rand" "-p" "libc" "-p" "compiler_builtins" "-p" "alloc" "-p" "collections" "-p" "unwind" "-p" "std_unicode" "-p" "panic_abort" "-p"
"build_helper" "-p" "alloc_system" "-p" "core" "--"
expected success, got: exit code: 101

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2016

hum. it could be my cargo binary that is too old. It is a 0.13.0.

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2016

@alexcrichton it is ok now. My cargo was too old for correctly performing tests without errors.

As side note, I found it is more and more complex to build rustc now. I hope to not having to port a new platform (full cross-compiling isn't always possible) due to interdependance of rustc and cargo (and libc which needs cargo too to properly check it).

@semarie semarie changed the title WIP: adaptation to rustbuild for openbsd adaptation to rustbuild for openbsd Dec 19, 2016
@alexcrichton
Copy link
Member

@semarie I'm not sure I understand the sentiment that building is more complex now? The only difference is that building the compiler requires Cargo now as opposed to just a previous rustc. Otherwise the build system should take care of everything.

@alexcrichton
Copy link
Member

@bors: r+

In any case, changes look good to me!

@bors
Copy link
Contributor

bors commented Dec 19, 2016

📌 Commit 2c39ee1 has been approved by alexcrichton

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2016

If you already have "correct libc" + "rustc" + "cargo", there are no problem with the build system. But porting a new platform to Rust will require additionnal effort due to the interdependance of these three components.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
…ichton

adaptation to rustbuild for openbsd

Since the switch to rustbuild, the build for openbsd is broken:
  - [X] `ar` inference based on compiler name is wrong (OpenBSD usually use `egcc`, but `ear` doesn't exist)
  - [X] `make` isn't GNU-make under OpenBSD (and others BSD platforms)
  - [x] `stdc++` isn't the right stdc++ library to link with (it should be `estdc++`)
  - [x] corrects tests that don't pass anymore (problems related to rustbuild)

r? @alexcrichton
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit 2c39ee1 into rust-lang:master Dec 21, 2016
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 21, 2016
A tweak was made to dependencies in rust-lang#38451 but the makefiles weren't updated to
accompany this. Instead of trying to integerate the `build_helper` crate into
the makefiles (which currently isn't present) this commit takes the approach of
just duplicating the required logic, which should be small enough for now.
bors added a commit that referenced this pull request Dec 21, 2016
mk: Fix compile with makefiles

A tweak was made to dependencies in #38451 but the makefiles weren't updated to
accompany this. Instead of trying to integerate the `build_helper` crate into
the makefiles (which currently isn't present) this commit takes the approach of
just duplicating the required logic, which should be small enough for now.
@semarie semarie deleted the openbsd-rustbuild branch December 21, 2016 04:30
@brson brson added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 19, 2017
@brson
Copy link
Contributor

brson commented Jan 19, 2017

@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 19, 2017
brson pushed a commit to brson/rust that referenced this pull request Jan 19, 2017
A tweak was made to dependencies in rust-lang#38451 but the makefiles weren't updated to
accompany this. Instead of trying to integerate the `build_helper` crate into
the makefiles (which currently isn't present) this commit takes the approach of
just duplicating the required logic, which should be small enough for now.
@brson brson mentioned this pull request Jan 19, 2017
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants