-
Notifications
You must be signed in to change notification settings - Fork 78
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
git and crates.io behave differently #204
Comments
That is very interesting indeed! From all I can tell, after running Something I wonder is if the crate In any case, maybe the reason for this is in the build script, it's quite complex by now. |
I made a better diff https://gist.github.com/folkertdev/0b0dcb12f934d318a1dd1a9deaae8376#file-difference-diff, and actually now it looks like the commands are quite similar. (a diff viewer with line wrapping is the easiest way to see that the only real differences are in hashes and git/checkout/... instead of registry/...). So, then it could be some sort of environment variable? It's difficult to debug of course because the failing version is the
so that's a separate thing to fix, given that it sort of should run the same logic as |
edit to the above: apparently even for So then,
the whole 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",
] where Now it appears that on My theory is that |
this is a weird one. I see different behavior between these dependency declarations
that really is the commit of the
1.1.18
tag: https://github.com/rust-lang/libz-sys/releases/tag/1.1.18, and I expect those two commands to be equivalent. Yet, one fails and the other succeeds. When I look with-vvv
, they really do quite different things.The problem occurs when trying to cross-compile for the
s390x-unknown-linux-gnu
target, see cmake output below.Logs
error: failed to run custom build command for
libz-sys v1.1.18
Caused by:
process didn't exit successfully:
/home/runner/work/zlib-rs/zlib-rs/target/debug/build/libz-sys-62ddb766a49e0499/build-script-build
(exit status: 101)--- stdout
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=zng/cmake.rs
cargo:rerun-if-changed=zng/cc.rs
CMAKE_TOOLCHAIN_FILE_s390x-unknown-linux-gnu = None
CMAKE_TOOLCHAIN_FILE_s390x_unknown_linux_gnu = None
TARGET_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_s390x-unknown-linux-gnu = None
CMAKE_GENERATOR_s390x_unknown_linux_gnu = None
TARGET_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
CMAKE_PREFIX_PATH_s390x-unknown-linux-gnu = None
CMAKE_PREFIX_PATH_s390x_unknown_linux_gnu = None
TARGET_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_s390x-unknown-linux-gnu = None
CMAKE_s390x_unknown_linux_gnu = None
TARGET_CMAKE = None
CMAKE = None
running: cd "/home/runner/work/zlib-rs/zlib-rs/target/s390x-unknown-linux-gnu/debug/build/libz-sys-337d39c9c58d4b39/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-sys-1.1.18/src/zlib-ng" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=ON" "-DZLIB_ENABLE_TESTS=OFF" "-DWITH_GZFILEOP=ON" "-DWITH_DFLTCC_DEFLATE=1" "-DWITH_DFLTCC_INFLATE=1" "-DCMAKE_SYSTEM_NAME=Linux" "-DCMAKE_SYSTEM_PROCESSOR=s390x" "-DCMAKE_INSTALL_PREFIX=/home/runner/work/zlib-rs/zlib-rs/target/s390x-unknown-linux-gnu/debug/build/libz-sys-337d39c9c58d4b39/out" "-DCMAKE_C_FLAGS= -DDFLTCC_LEVEL_MASK=0x7e -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_C_COMPILER=/usr/bin/s390x-linux-gnu-gcc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_COMPILER=/usr/bin/s390x-linux-gnu-g++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_ASM_COMPILER=/usr/bin/s390x-linux-gnu-gcc" "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
-- Using CMake version 3.30.2
-- ZLIB_HEADER_VERSION: 1.3.0
-- ZLIBNG_HEADER_VERSION: 2.1.6
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/s390x-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Arch not recognized, falling back to cmake arch: 's390x'
-- Basearch of 's390x' has been detected as: 's360'
-- Performing Test FNO_LTO_AVAILABLE
-- Performing Test FNO_LTO_AVAILABLE - Success
-- Looking for arm_acle.h
-- Looking for arm_acle.h - not found
-- Looking for sys/auxv.h
-- Looking for sys/auxv.h - found
-- Looking for sys/sdt.h
-- Looking for sys/sdt.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for aligned_alloc
-- Looking for aligned_alloc - found
-- Performing Test HAVE_NO_INTERPOSITION
-- Performing Test HAVE_NO_INTERPOSITION - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN - Success
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL
-- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL - Success
-- Performing Test HAVE_ATTRIBUTE_ALIGNED
-- Performing Test HAVE_ATTRIBUTE_ALIGNED - Success
-- Performing Test HAVE_BUILTIN_CTZ
-- Performing Test HAVE_BUILTIN_CTZ - Success
-- Performing Test HAVE_BUILTIN_CTZLL
-- Performing Test HAVE_BUILTIN_CTZLL - Success
-- Performing Test HAVE_PTRDIFF_T
-- Performing Test HAVE_PTRDIFF_T - Success
-- Performing Test HAVE_S390_INTRIN
-- Performing Test HAVE_S390_INTRIN - Success
-- Performing Test HAVE_VGFMA_INTRIN
-- Performing Test HAVE_VGFMA_INTRIN - Success
-- Architecture-specific source files: arch/s390/s390_features.c;arch/s390/dfltcc_common.c;arch/s390/dfltcc_deflate.c;arch/s390/dfltcc_inflate.c;arch/s390/crc32-vx.c
-- The following features have been enabled:
-- The following features have been disabled:
-- Configuring done (3.0s)
--- stderr
CMake Error at CMakeLists.txt:1059 (add_library):
Cannot find source file:
arch/s390/s390_features.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
CMake Error at CMakeLists.txt:1059 (add_library):
No SOURCES given to target: zlib
CMake Generate step failed. Build files cannot be regenerated correctly.
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:
command did not execute successfully, got: exit status: 1
build script failed, must exit now
stack backtrace:
0: rust_begin_unwind
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
1: core::panicking::panic_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14
2: cmake::fail
at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
3: cmake::run
at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1076:9
4: cmake::Config::build
at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:813:13
5: build_script_build::zng::build_zng::build_zlib_ng
at ./zng/cmake.rs:21:23
6: build_script_build::build_zlib_ng
at ./build.rs:201:5
7: build_script_build::main
at ./build.rs:22:16
8: core::ops::function::FnOnce::call_once
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.warning: build failed, waiting for other jobs to finish...
error: command
/home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo test --no-run --message-format json-render-diagnostics --target s390x-unknown-linux-gnu
exited with code 101Error: Process completed with exit code 101.
So, wth? is the tag different in practice from the release on crates.io? That would be bad, I think? Other crates.io versions also have this problem though.
with
cargo -vvv
you can actually see the cmake logs, and they really are very different!https://gist.github.com/folkertdev/0b0dcb12f934d318a1dd1a9deaae8376
The text was updated successfully, but these errors were encountered: