[MacPorts] #69138: rust @1.75.0 : Does not build on macOS 10.11.6 - missing _getentropy and _clock_gettime
MacPorts
noreply at macports.org
Tue Jun 18 00:10:57 UTC 2024
#69138: rust @1.75.0 : Does not build on macOS 10.11.6 - missing _getentropy and
_clock_gettime
------------------------+---------------------------------
Reporter: snowflake | Owner: MarcusCalhoun-Lopez
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.8.99
Resolution: fixed | Keywords:
Port: rust |
------------------------+---------------------------------
Comment (by mqudsi):
After playing around with this some and trying it out against real-world
projects, I have unfortunately come to realize it might actually be
necessary to patch the toolchain to apply this automatically to work
around deficiencies in cargo's current abilities to specify linker flags
when building transitive dependencies that include proc macros or build
scripts (but only specifically where building for the host (i.e. sans
`--target`) or where building with `--target x86_64-apple-darwin`).
The problem is that Cargo intentionally does not pass through RUSTFLAGS to
build scripts and proc macros (directly or in your transitive
dependencies) if you build with an explicit `--target x86_64-apple-darwin`
(or any other target), *and* there is no known workaround to pass through
linker flags to the build scripts in this case. So for any rust project
that has a `*-sys` crate in its (transitive) dependencies, the link stage
will fail due to missing symbol errors and you can't do anything about it.
I [[https://github.com/rust-lang/cargo/issues/13981|bugged it upstream]]
and there's an active discussion going on, but it's tangential to
[[https://github.com/rust-lang/cargo/issues/4423|a long-standing known
issue]] with no resolution in sight.
The only "solution" I found was to hack the build scripts to remove
explicit `--target` from cargo calls then patch the install phase to copy
artifacts out of `$BUILD_DIR/cargo/build/{debug,release}` instead of
`$BUILD_DIR/cargo/build/x86_64-apple-darwin/{debug,release}`, but that's
not really a workable solution.
(I'm thinking in terms of solutions that would work to provide macports
ports for projects written in rust that explicitly specify `--target` via
their non-cargo build system on a target that requires LegacySupport.)
--
Ticket URL: <https://trac.macports.org/ticket/69138#comment:26>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list