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

secp256k1-sys 0.10.1 compilation fails on Windows using Rust 1.63.0 #748

Open
arik-so opened this issue Sep 27, 2024 · 5 comments
Open

secp256k1-sys 0.10.1 compilation fails on Windows using Rust 1.63.0 #748

arik-so opened this issue Sep 27, 2024 · 5 comments

Comments

@arik-so
Copy link
Contributor

arik-so commented Sep 27, 2024

Not sure if this is duplicative of #45, but I keep running into CI issues compiling on Rust 1.63.0 on Windows. When running this command: cargo build -p secp256k1-sys --verbose -vv, it just gets stuck with this output and never advances further:

Compiling secp256k1-sys v0.10.1
Running set CARGO=\\?\C:\Users\runneradmin\.rustup\toolchains\1.63.0-x86_64-pc-windows-msvc\bin\cargo.exe&& set CARGO_CRATE_NAME=build_script_build&& set CARGO_MANIFEST_DIR=C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\secp256k1-sys-0.10.1&& set CARGO_PKG_AUTHORS="Dawid Ciężarkiewicz <[email protected]>:Andrew Poelstra <[email protected]>:Steven Roose <[email protected]>"&& set CARGO_PKG_DESCRIPTION="FFI for Pieter Wuille's libsecp256k1library."&& set CARGO_PKG_HOMEPAGE=https://github.com/rust-bitcoin/rust-secp256k1/&& set CARGO_PKG_LICENSE=CC0-1.0&& set CARGO_PKG_LICENSE_FILE=""&& set CARGO_PKG_NAME=secp256k1-sys&& set CARGO_PKG_REPOSITORY=https://github.com/rust-bitcoin/rust-secp256k1/&& set CARGO_PKG_RUST_VERSION=1.56.1&& set CARGO_PKG_VERSION=0.10.1&& set CARGO_PKG_VERSION_MAJOR=0&& set CARGO_PKG_VERSION_MINOR=10&& set CARGO_PKG_VERSION_PATCH=1&& set CARGO_PKG_VERSION_PRE=""&& set CARGO_PRIMARY_PACKAGE=1&& set PATH="D:\a\rust-musig2\rust-musig2 RunningD:\a\rust-musig2\rust-musig2\target\debug\build\secp256k1-sys-6fd357bb890dc581\build-script-build`
[secp256k1-sys 0.10.1] OUT_DIR = Some(D:\a\rust-musig2\rust-musig2\target\debug\build\secp256k1-sys-bee6840c18499fe7\out)
[secp256k1-sys 0.10.1] TARGET = Some(x86_64-pc-windows-msvc)
[secp256k1-sys 0.10.1] OPT_LEVEL = Some(0)
[secp256k1-sys 0.10.1] HOST = Some(x86_64-pc-windows-msvc)
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=VCINSTALLDIR
[secp256k1-sys 0.10.1] VCINSTALLDIR = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath
[secp256k1-sys 0.10.1] VSTEL_MSBuildProjectFullPath = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE
[secp256k1-sys 0.10.1] VSCMD_ARG_VCVARS_SPECTRE = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=WindowsSdkDir
[secp256k1-sys 0.10.1] WindowsSdkDir = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=WindowsSDKVersion
[secp256k1-sys 0.10.1] WindowsSDKVersion = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=LIB
[secp256k1-sys 0.10.1] LIB = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=PATH
[secp256k1-sys 0.10.1] PATH = Some(D:\a\rust-musig2\rust-musig2\target\debug\deps;D:\a\rust-musig2\rust-musig2\target\debug;C:\Users\runneradmin.rustup\toolchains\1.63.0-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib;C:\Program Files\PowerShell\7;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.1.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.1\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=INCLUDE
[secp256k1-sys 0.10.1] INCLUDE = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
[secp256k1-sys 0.10.1] CC_x86_64-pc-windows-msvc = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
[secp256k1-sys 0.10.1] CC_x86_64_pc_windows_msvc = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=HOST_CC
[secp256k1-sys 0.10.1] HOST_CC = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CC
[secp256k1-sys 0.10.1] CC = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
[secp256k1-sys 0.10.1] CRATE_CC_NO_DEFAULTS = None
[secp256k1-sys 0.10.1] CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
[secp256k1-sys 0.10.1] DEBUG = Some(true)
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
[secp256k1-sys 0.10.1] CFLAGS_x86_64-pc-windows-msvc = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
[secp256k1-sys 0.10.1] CFLAGS_x86_64_pc_windows_msvc = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=HOST_CFLAGS
[secp256k1-sys 0.10.1] HOST_CFLAGS = None
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CFLAGS
[secp256k1-sys 0.10.1] CFLAGS = None
[secp256k1-sys 0.10.1] OUT_DIR = Some(D:\a\rust-musig2\rust-musig2\target\debug\build\secp256k1-sys-bee6840c18499fe7\out)
[secp256k1-sys 0.10.1] cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT

This notably does not occur on later Rust versions, but due to MSRV reasons, 1.63.0 cannot be avoided for the time being. Should we be pinning an older version, or is there some easy fix for this?

@apoelstra
Copy link
Member

Unfortunately I don't think this library will compile with older versions anymore, so you won't be able to pin to an older version.

I also don't have any Windows boxes where I can check on this behavior. Our usage of cc here is pretty boring. It could be an upstream issue.

Maybe try pinning different versions of cc? In particular see the one in our Cargo-minimal.lock.

@raress96
Copy link

raress96 commented Oct 10, 2024

I am getting a similar error when trying to build for WASM using Rust-Optimizer: (https://github.com/CosmWasm/optimizer/tree/v0.16.0, which uses Rust 1.78 version)

warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `clang` installed?

error: failed to run custom build command for `secp256k1-sys v0.10.1`

Caused by:
  process didn't exit successfully: `/target/release/build/secp256k1-sys-53184cd91cd70182/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-musl")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `clang` installed?

Shouldn't this library support WASM?

@apoelstra
Copy link
Member

That error definitely has nothing to do with this library. It looks like it's related to cc.

@raress96
Copy link

I am guessing it has something to do with the context being wasm32-unknown-unknown, maybe cc is not available there. Will have to further debug.

@arik-so
Copy link
Contributor Author

arik-so commented Oct 11, 2024

Pinning cc to 1.0.28 did the trick!

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

No branches or pull requests

3 participants