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

Conversation

Projects
None yet
4 participants
@semarie
Copy link
Contributor

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

semarie added some commits Dec 17, 2016

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

Fixes #38429
@semarie

This comment has been minimized.

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

This comment has been minimized.

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.

OpenBSD has two stdc++ libraries: use the newer
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.

@semarie semarie force-pushed the semarie:openbsd-rustbuild branch from ba025b2 to 2c39ee1 Dec 18, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Dec 18, 2016

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

@semarie

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

alexcrichton commented Dec 19, 2016

@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

This comment has been minimized.

Copy link
Member

alexcrichton commented Dec 19, 2016

@bors: r+

In any case, changes look good to me!

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 19, 2016

📌 Commit 2c39ee1 has been approved by alexcrichton

@semarie

This comment has been minimized.

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

Rollup merge of rust-lang#38451 - semarie:openbsd-rustbuild, r=alexcr…
…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

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

Rollup merge of rust-lang#38451 - semarie:openbsd-rustbuild, r=alexcr…
…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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 21, 2016

mk: Fix compile with makefiles
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

Auto merge of #38506 - alexcrichton:fix-makefiles, r=brson
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 semarie:openbsd-rustbuild branch Dec 21, 2016

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 19, 2017

brson added a commit to brson/rust that referenced this pull request Jan 19, 2017

mk: Fix compile with makefiles
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 referenced this pull request Jan 19, 2017

Merged

Beta next #39189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.