Skip to content

Commit

Permalink
chore: fix MacOS release target and missing npx binary for release
Browse files Browse the repository at this point in the history
Had MacOS error such as:

   Compiling group v0.12.1
   Compiling hmac v0.12.1
The following warnings were emitted during compilation:

warning: [email protected]: clang: error: invalid Darwin version number: macosx13.0
warning: [email protected]: clang: warning: overriding '-mmacosx-version-min=10.7.0' option with '--target=x86_64-apple-macosx13.0' [-Woverriding-t-option]
warning: [email protected]: clang: error: invalid version number in '--target=x86_64-apple-macosx13.0'

error: failed to run custom build command for `ring v0.17.8`

Caused by:
  process didn't exit successfully: `/target/release/build/ring-5ab6f4fa8a125f61/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
  OPT_LEVEL = Some(3)
  OUT_DIR = Some(/target/x86_64-apple-darwin/release/build/ring-aa28d4dfd2b794be/out)
  TARGET = Some(x86_64-apple-darwin)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_x86_64-apple-darwin
  CC_x86_64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_x86_64_apple_darwin
  CC_x86_64_apple_darwin = Some(x86_64-apple-darwin22-clang)
  cargo:rerun-if-env-changed=CC_KNOWN_WRAPPER_CUSTOM
  CC_KNOWN_WRAPPER_CUSTOM = None
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
  MACOSX_DEPLOYMENT_TARGET = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-apple-darwin
  CFLAGS_x86_64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_apple_darwin
  CFLAGS_x86_64_apple_darwin = Some(-stdlib=libc++ -fuse-ld=x86_64-apple-darwin22-ld)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:warning=clang: error: invalid Darwin version number: macosx13.0
  cargo:warning=clang: warning: overriding '-mmacosx-version-min=10.7.0' option with '--target=x86_64-apple-macosx13.0' [-Woverriding-t-option]
  cargo:warning=clang: error: invalid version number in '--target=x86_64-apple-macosx13.0'

  --- stderr

  error occurred in cc-rs: Command LC_ALL="C" "x86_64-apple-darwin22-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "--target=x86_64-apple-macosx13.0" "-I" "include" "-I" "/target/x86_64-apple-darwin/release/build/ring-aa28d4dfd2b794be/out" "-stdlib=libc++" "-fuse-ld=x86_64-apple-darwin22-ld" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-gfull" "-DNDEBUG" "-o" "/target/x86_64-apple-darwin/release/build/ring-aa28d4dfd2b794be/out/172e8fe49fe517e0-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args x86_64-apple-darwin22-clang did not execute successfully (status code exit status: 1).

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

  Adding MACOSX_DEPLOYMENT_TARGET variable solved the issue.

  Cross-building Mac locally is too flaky and painful, often breaking for whatever reason. Better use something like GitHub Mac runner ?
  • Loading branch information
PierreBeucher committed Dec 8, 2024
1 parent 7da9ab4 commit dd68fe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ pre-build = [
[target.x86_64-apple-darwin]
image = "x86_64-apple-darwin-cross:local"

[target.x86_64-apple-darwin.env]
passthrough = ["MACOSX_DEPLOYMENT_TARGET=macos13"]

[target.aarch64-apple-darwin]
image = "aarch64-apple-darwin-cross:local"
image = "aarch64-apple-darwin-cross:local"

[target.aarch64-apple-darwin.env]
passthrough = ["MACOSX_DEPLOYMENT_TARGET=macos13"]
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
packages = devShellPackages ++ [
pkgs.cargo-cross
pkgs.rustup
pkgs.nodejs_23 # for npx release-please
];

buildInputs = devShellBuildInputs;
Expand Down

0 comments on commit dd68fe4

Please sign in to comment.