Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,35 @@ jobs:

cc:
runs-on: ubuntu-22.04
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
# Ensures --all-features builds correctly, the current logic will mean it
# uses stock zlib, not cmake nor cc
- run: |
cargo test --target $TARGET_TRIPLE --all-features
cargo run --target $TARGET_TRIPLE --manifest-path systest/Cargo.toml --all-features
cargo test --all-features
cargo run --manifest-path systest/Cargo.toml --all-features
# Ensures zlib-ng builds and runs, though zlib-ng _could_ change internally
# and not use all optimizations available to the CI runner, we do this here
# just for x86_64-unknown-linux-gnu to validate a common target compiles
# on a more recent compiler than the incredibly ancient one currently used by cross
- run: |
cargo test --target $TARGET_TRIPLE --no-default-features --features zlib-ng-no-cmake-experimental-community-maintained || echo "::warning::failed to build libz-ng with --features zlib-ng-no-cmake-experimental-community-maintained"
cargo run --target $TARGET_TRIPLE --manifest-path systest/Cargo.toml --no-default-features --features zlib-ng-no-cmake-experimental-community-maintained || echo "::warning::failed to run systest with --features zlib-ng-no-cmake-experimental-community-maintained"
cargo test --no-default-features --features zlib-ng-no-cmake-experimental-community-maintained || echo "::warning::failed to build libz-ng with --features zlib-ng-no-cmake-experimental-community-maintained"
cargo run --manifest-path systest/Cargo.toml --no-default-features --features zlib-ng-no-cmake-experimental-community-maintained || echo "::warning::failed to run systest with --features zlib-ng-no-cmake-experimental-community-maintained"


# ensures packaging works
package:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
- run: |
cargo package --all-features
cargo package --no-default-features --features zlib-ng-no-cmake-experimental-community-maintained
cargo package --no-default-features --features zlib-ng

linux:
runs-on: ubuntu-latest
Expand Down
21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libz-sys"
version = "1.1.17"
version = "1.1.18"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Josh Triplett <josh@joshtriplett.org>",
Expand All @@ -18,10 +18,27 @@ include = [
"LICENSE*",
"/README.md",
"build.rs",
"zng/cc.rs",
"zng/cmake.rs",
"src/*.rs",
"src/*.c",
"src/zlib/*.[ch]",
"src/zlib/*.pc.in",
# zlib-ng
"src/zlib-ng/**.[ch]",
"src/zlib-ng/arch/arm/**.[ch]",
"src/zlib-ng/arch/generic/**.[ch]",
"src/zlib-ng/arch/power/**.[ch]",
"src/zlib-ng/arch/riscv/**.[ch]",
"src/zlib-ng/arch/s390x/**.[ch]",
"src/zlib-ng/arch/x86/**.[ch]",
"src/zlib-ng/*.[ch].in",
"src/zlib-ng/*.pc.in",
"src/zlib-ng/zlib_name_mangling.h.empty",
# zlib-ng cmake
"src/zlib-ng/CMakeLists.txt",
"src/zlib-ng/zlib.pc.cmakein",
"src/zlib-ng/cmake",
]

[workspace]
Expand All @@ -37,7 +54,7 @@ libc = { version = "0.2.43", optional = true }

[build-dependencies]
pkg-config = "0.3.9"
cc = "1.0.18"
cc = "1.0.97"
cmake = { version = "0.1.50", optional = true }
vcpkg = "0.2"

Expand Down
12 changes: 11 additions & 1 deletion zng/cc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ struct Build {

impl Build {
fn new(cfg: cc::Build) -> Self {
let is_msvc = cfg.get_compiler().is_like_msvc();
// cc currently has a bug where they create a named temp file in a directory
// without ensuring the directory exists first, so apply this workaround
// until it can be fixed upstream
let mut pb = PathBuf::from(env::var_os("OUT_DIR").expect("this should always be set"));
pb.push("lib");
if let Err(err) = std::fs::create_dir_all(&pb) {
panic!("failed to create {:?}: {}", pb, err);
}

let is_msvc = cfg.try_get_compiler().unwrap().is_like_msvc();

Self { cfg, is_msvc }
}

Expand Down