Skip to content

Build Failed in old MacOS version #2137

Description

@niu541412

Bug Description

This error attached below was encountered when I built https://github.com/nicolargo/glances in Homebrew. Homebrew will build package from source in deprecated MacOS.

It seems caused by the outdated rust cc package in the requirements and only occurred in old MacOS versions. It has been fixed since 1.0.94, rust-lang/cc-rs#1007.

           Running `rustc --crate-name build_script_build --edition=2015 /Users/jomic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C metadata=aa68bac46a22054c -C extra-filename=-aa68bac46a22054c --out-dir /private/var/folders/8t/xrq5dqhs3jx522fngh9_09km0000h1/T/pip-install-x6vdobi6/maturin_35b459eb6be54f839f892996ead8406f/target/release/build/stacker-aa68bac46a22054c -C strip=debuginfo -L dependency=/private/var/folders/8t/xrq5dqhs3jx522fngh9_09km0000h1/T/pip-install-x6vdobi6/maturin_35b459eb6be54f839f892996ead8406f/target/release/deps --extern cc=/private/var/folders/8t/xrq5dqhs3jx522fngh9_09km0000h1/T/pip-install-x6vdobi6/maturin_35b459eb6be54f839f892996ead8406f/target/release/deps/libcc-eb9d8d76e92bae18.rlib --cap-lints allow`
      The following warnings were emitted during compilation:
      
      warning: psm@0.1.21: clang: error: invalid version number in '-mmacosx-version-min=1.1'
      
      error: failed to run custom build command for `psm v0.1.21`
      Caused by:
        process didn't exit successfully: `/private/var/folders/8t/xrq5dqhs3jx522fngh9_09km0000h1/T/pip-install-x6vdobi6/maturin_35b459eb6be54f839f892996ead8406f/target/release/build/psm-d1eb973c58b921d9/build-script-build` (exit status: 1)
        --- stdout
        OPT_LEVEL = Some("3")
        TARGET = Some("x86_64-apple-darwin")
        HOST = Some("x86_64-apple-darwin")
        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 = None
        cargo:rerun-if-env-changed=HOST_CC
        HOST_CC = None
        cargo:rerun-if-env-changed=CC
        CC = 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=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 = None
        cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None
        cargo:rustc-cfg=asm
        cargo:rustc-cfg=switchable_stack
        cargo:warning=clang: error: invalid version number in '-mmacosx-version-min=1.1'
      
        --- stderr
      
      
        error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "--target=x86_64-apple-darwin" "-mmacosx-version-min=1.1" "-Wall" "-Wextra" "-xassembler-with-cpp" "-DCFG_TARGET_OS_macos" "-DCFG_TARGET_ARCH_x86_64" "-DCFG_TARGET_ENV_" "-o" "/private/var/folders/8t/xrq5dqhs3jx522fngh9_09km0000h1/T/pip-install-x6vdobi6/maturin_35b459eb6be54f839f892996ead8406f/target/release/build/psm-d1192970f7a0e986/out/e4479bd7784abb10-x86_64.o" "-c" "src/arch/x86_64.s" with args "cc" did not execute successfully (status code exit status: 1).
      
      

Your maturin version (maturin --version)

1.6.0

Your Python version (python -V)

python 3.12

Your pip version (pip -V)

24.1

What bindings you're using

None

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

pip install --no-binary :all: --only-binary :none: 'maturin>=1,<2'
in MacOS High Sierra 10.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions