Skip to content

Commit

Permalink
v0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Feb 17, 2021
1 parent d4faadb commit 53dd4c2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["konstin <[email protected]>"]
name = "maturin"
version = "0.9.3"
version = "0.9.4"
description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
exclude = ["test-crates/**/*", "sysconfig/*", "test-data/*", "ci/*", "tests/*"]
readme = "Readme.md"
Expand Down
12 changes: 12 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* 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

* Fix building a bin with musl

## 0.9.3

* CI failure

## 0.9.2

* CI failure

## 0.9.1 - 2021-01-13

* Error when the `abi3` feature is selected but no minimum version
Expand Down
29 changes: 15 additions & 14 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ fn compile_target(
) -> Result<HashMap<String, PathBuf>> {
let mut shared_args = vec!["--manifest-path", context.manifest_path.to_str().unwrap()];

// 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 {
BridgeModel::Bin => shared_args.push("--bins"),
BridgeModel::Cffi | BridgeModel::Bindings(_) | BridgeModel::BindingsAbi3(_, _) => {
shared_args.push("--lib")
}
}

shared_args.extend(context.cargo_extra_args.iter().map(String::as_str));

if context.release {
Expand All @@ -116,14 +107,26 @@ fn compile_target(
shared_args.push(target);
}

let cargo_args = vec!["rustc", "--message-format", "json"];

let mut rustc_args: Vec<&str> = context
.rustc_extra_args
.iter()
.map(String::as_str)
.collect();

// 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 {
BridgeModel::Bin => shared_args.push("--bins"),
BridgeModel::Cffi | BridgeModel::Bindings(_) | BridgeModel::BindingsAbi3(_, _) => {
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
if context.target.is_musl_target() {
rustc_args.extend(&["-C", "target-feature=-crt-static"]);
}
}
}

// https://github.com/PyO3/pyo3/issues/88#issuecomment-337744403
if context.target.is_macos() {
if let BridgeModel::Bindings(_) | BridgeModel::BindingsAbi3(_, _) = bindings_crate {
Expand Down Expand Up @@ -153,9 +156,7 @@ fn compile_target(
}
}

if context.target.is_musl_target() {
rustc_args.extend(&["-C", "target-feature=-crt-static"]);
}
let cargo_args = vec!["rustc", "--message-format", "json"];

let build_args: Vec<_> = cargo_args
.iter()
Expand Down
1 change: 0 additions & 1 deletion src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ pub fn source_distribution(
));
writer.add_directory(&root_dir)?;
for (target, source) in target_source {
println!("{} {}", target.display(), source.display());
writer.add_file(root_dir.join(target), source)?;
}

Expand Down

0 comments on commit 53dd4c2

Please sign in to comment.