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

update libz-sys version to fix macOS compile error #10941

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Oct 10, 2020

[ci skip-build-wheels]

Problem

Compile error on macOS 10.15.6 with libz-sys crate after pulling to latest master commit with Rust 1.47.0 upgrade:

The following warnings were emitted during compilation:

warning: src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
warning:         (void)snprintf(state->path, len + 1, "%s", (const char *)path);
warning:               ^
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
warning: 1 error generated.

error: failed to run custom build command for `libz-sys v1.0.25`

Solution

Ran cargo update -p libz-sys to upgrade libz-sys crate from v1.0.25 to v1.1.2.

Most of the churn in the Cargo.lock is probably from a newer version of Cargo which now pins versions by using a checksum field in the stanza for each crate.

Result

Ran ./pants --version with the upgraded libz-sys and native engine rebuilt successfully.

@tdyas
Copy link
Contributor Author

tdyas commented Oct 10, 2020

Full error log:

The following warnings were emitted during compilation:

warning: src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
warning:         (void)snprintf(state->path, len + 1, "%s", (const char *)path);
warning:               ^
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
warning: 1 error generated.

error: failed to run custom build command for `libz-sys v1.0.25`

Caused by:
  process didn't exit successfully: `/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-660c6406c657a956/build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
  cargo:rerun-if-changed=build.rs
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c"
  exit code: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/compress.o" "-c" "src/zlib/compress.c"
  exit code: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/crc32.o" "-c" "src/zlib/crc32.c"
  exit code: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/deflate.o" "-c" "src/zlib/deflate.c"
  exit code: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/gzclose.o" "-c" "src/zlib/gzclose.c"
  exit code: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/gzlib.o" "-c" "src/zlib/gzlib.c"
  cargo:warning=src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
  cargo:warning=        (void)snprintf(state->path, len + 1, "%s", (const char *)path);
  cargo:warning=              ^
  cargo:warning=src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
  cargo:warning=1 error generated.
  exit code: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "/Users/tdyas/TC/pants/src/rust/engine/target/release/build/libz-sys-8727e44b316d3267/out/build/src/zlib/gzlib.o" "-c" "src/zlib/gzlib.c" with args "cc" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
error: build failed

Failed to build native engine.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling be129bd on tdyas:update_libz_sys_crate into 842b9e2 on pantsbuild:master.

@tdyas
Copy link
Contributor Author

tdyas commented Oct 10, 2020

And it is failing on:

thread 'tests::invalidate_randomly' panicked at 'In 0 iterations, observed a maximum of 1 distinct context values.', graph/src/tests.rs:193:3

https://travis-ci.com/github/pantsbuild/pants/jobs/397852400#L765

But which passes locally:

running 16 tests
test tests::critical_path ... ok
test tests::create ... ok
test tests::uncacheable_deps_is_cleaned_for_the_session ... ok
test tests::cyclic_failure ... ok
test tests::invalidate_and_rerun ... ok
test tests::invalidate_with_changed_dependencies ... ok
test tests::uncacheable_dependents_of_uncacheable_node ... ok
test tests::invalidate_and_clean ... ok
test tests::cyclic_dirtying ... ok
test tests::dirtied_uncacheable_deps_node_re_runs ... ok
test tests::poll_uncacheable ... ok
test tests::poll_cacheable ... ok
test tests::invalidate_randomly ... ok
test tests::retries ... ok
test tests::uncacheable_node_only_runs_once ... ok
test tests::canceled_immediately ... ok

test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests graph

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@tdyas
Copy link
Contributor Author

tdyas commented Oct 11, 2020

Now it passes after restarting the shard.

@tdyas tdyas merged commit b4b0d04 into pantsbuild:master Oct 11, 2020
@tdyas tdyas deleted the update_libz_sys_crate branch October 11, 2020 00:20
@Eric-Arellano Eric-Arellano mentioned this pull request Oct 11, 2020
Eric-Arellano added a commit that referenced this pull request Oct 12, 2020
Internal only changes left off from the changelog:

* Use cpython types in Rust functions that manipulate python objects (#10942)
  `PR #10942 <https://github.com/pantsbuild/pants/pull/10942>`_

* update libz-sys version to fix macOS compile error (#10941)
  `PR #10941 <https://github.com/pantsbuild/pants/pull/10941>`_

* Upgrade to Rust stable 1.47.0. (#10933)
  `PR #10933 <https://github.com/pantsbuild/pants/pull/10933>`_

* Finish CreateDigest Directory cleanup. (#10935)
  `PR #10935 <https://github.com/pantsbuild/pants/pull/10935>`_

* Hotfix broken import from merge conflict (#10934)
  `PR #10934 <https://github.com/pantsbuild/pants/pull/10934>`_

* Revert "Port nailgun client to rust (#10865)" (#10929)
  `PR #10929 <https://github.com/pantsbuild/pants/pull/10929>`_

* An ExternalTool for downloading the grpc_python_plugin. (#10927)
  `PR #10927 <https://github.com/pantsbuild/pants/pull/10927>`_

* Port nailgun client to rust (#10865)
  `PR #10865 <https://github.com/pantsbuild/pants/pull/10865>`_

* print stacktraces during import errors (#10906)
  `PR #10906 <https://github.com/pantsbuild/pants/pull/10906>`_

* fs.Digest is declared in Rust (#10905)
  `PR #10905 <https://github.com/pantsbuild/pants/pull/10905>`_

* add requests_ca_bundle to settable_env_vars (#10909)
  `PR #10909 <https://github.com/pantsbuild/pants/pull/10909>`_

[ci skip-rust]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants