Skip to content

Commit

Permalink
Use RUSTFLAGS again to fix #427
Browse files Browse the repository at this point in the history
For some reason, this argument
  • Loading branch information
konstin committed Feb 18, 2021
1 parent a7b90a9 commit 7e34a32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 6 additions & 10 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (for the cli, not for the crate).

## 0.9.2 - 2021-02-17

* Escape version in wheel metadata by messense in [#420](https://github.com/PyO3/maturin/pull/420)
* Set executable bit on shared library by messense in [#421](https://github.com/PyO3/maturin/pull/421)
* Rename `classifier` to `classifiers` for pypi compatibility. The old `classifier` is still available and now also works with pypi
* Fix building for musl by automatically setting `-C target-feature=-crt-static`

## 0.9.4
## 0.9.4 - 2021-02-18

* Fix building a bin with musl

## 0.9.3

* CI failure

## 0.9.2
## 0.9.2 - 2021-02-17

* CI failure
* Escape version in wheel metadata by messense in [#420](https://github.com/PyO3/maturin/pull/420)
* Set executable bit on shared library by messense in [#421](https://github.com/PyO3/maturin/pull/421)
* Rename `classifier` to `classifiers` for pypi compatibility. The old `classifier` is still available and now also works with pypi
* Fix building for musl by automatically setting `-C target-feature=-crt-static`

## 0.9.1 - 2021-01-13

Expand Down
8 changes: 4 additions & 4 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ fn compile_target(
.map(String::as_str)
.collect();

let mut rust_flags = env::var_os("RUSTFLAGS").unwrap_or_default();

// We need to pass --bins / --lib to set the rustc extra args later
// TODO: What do we do when there are multiple bin targets?
match bindings_crate {
Expand All @@ -121,8 +123,9 @@ fn compile_target(
shared_args.push("--lib");
// https://github.com/rust-lang/rust/issues/59302#issue-422994250
// We must only do this for libraries as it breaks binaries
// For some reason this value is ignored when passed as rustc argument
if context.target.is_musl_target() {
rustc_args.extend(&["-C", "target-feature=-crt-static"]);
rust_flags.push(" -C target-feature=-crt-static");
}
}
}
Expand Down Expand Up @@ -168,12 +171,9 @@ fn compile_target(
.iter()
.fold("cargo".to_string(), |acc, x| acc + " " + x);

let rust_flags = env::var_os("RUSTFLAGS").unwrap_or_default();

let mut let_binding = Command::new("cargo");
let build_command = let_binding
.args(&build_args)
.env("RUSTFLAGS", rust_flags)
// We need to capture the json messages
.stdout(Stdio::piped())
// We can't get colored human and json messages from rustc as they are mutually exclusive,
Expand Down

0 comments on commit 7e34a32

Please sign in to comment.