axodotdev / axodotdev/cargo-dist

help users set a macos sdk deployment target

Open
#788 0 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

Even the newest macos sdks all have support for much older "deployment targets" (you can tell the 14 sdk to build for 10.12, for instance). This is governed by MACOSX_DEPLOYMENT_TARGET env var. At best, cargo-dist should default to automatically setting this to a reasonable value. At worst we should have docs telling people to set this in their cargo-dist env-vars (and we should test it works! i have a macos 11 intel macbook to test with).

Doing this would unblock us unabashedly using the apple silicon runners, which would be a huge win.

A former apple compiler engineer who now does a lot of rust dev [has informed me that this env-var has a ton of confusing discussion, and that the value rustc "defaults" to is just for the stdlib/itself](https://social.belkadan.com/@jrose/statuses/01HP64NSBHN5AK57QDKP8RNQ77), seemingly rust binaries you build default to deployment_target == sdk_version which is of course a portability nightmare.

For reference, rustc defaults to 10.12 for itself (`rustc --target x86_64-apple-darwin --print deployment-target`), which is super generous.

See also this (confusing) issue about how cargo doesn't set the env-var for build scripts, which makes cdeps very sad: https://github.com/rust-lang/cargo/issues/13115

Contributor guide

Open the contributing guide

Research direction

Start by tracing cargo-dist's env-vars handling and macOS build or runner configuration. Verify how MACOSX_DEPLOYMENT_TARGET reaches Rust builds and build scripts, then test on the reported macOS 11 Intel machine; done means older deployment targets work and Apple Silicon runners can be used safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
build-system, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.