[MacPorts] #72272: clonefile() and family in legacy-support and reasons to block Rust to 1.78.0 on OS <= 10.12
MacPorts
noreply at macports.org
Wed Apr 2 16:52:35 UTC 2025
#72272: clonefile() and family in legacy-support and reasons to block Rust to
1.78.0 on OS <= 10.12
-----------------------------------+--------------------
Reporter: RJVB | Owner: (none)
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: legacy-support, rust |
-----------------------------------+--------------------
Description changed by RJVB:
Old description:
> port:rust is currently being kept frozen to v1.78.0, which is beginning
> to cause obsolescence issues and is probably not really justified.
>
> Two observations to support that:
>
> - using Rustup, the latest version of the official binaries that can be
> made to run on 10.9 is 1.80.1, provided the binaries are relinked to
> libMacportsLegacySystem.b.dylib . I am not equipped to test this but the
> port:legacy-support maintainers should be able to assess how far back
> that support can go.
> - Using any newer version raises an error about a missing
> `fclonefileat()` function. Which BTW was introduced in 10.12 if I'm not
> mistaken!
>
> AFAICT that function is extremely easy to emulate: it just needs to
> return an error with `ENOTSUP` when an attempt is made to use it on an
> unsupported (= non-APFS) filesystem. On any Darwin version that doesn't
> support APFS the "official" function would raise that error, and any code
> using `clonefile()` and family must be prepared to handle that situation
> (gracefully unless it means to support APFS only).
> IOW, on 10.11 and earlier this simple emulation should suffice because
> those OS versions do not support APFS anyway (or via Fuse only).
>
> I tested this by adding just a runtime implementation to my copy of `port
> :legacy-support`: https://github.com/RJVB/macstrop/blob/master/devel
> /legacy-support/files/patch-clonefile-runtime-functions.diff . Note that
> the emulation is slightly more complex: following the in-kernel
> implementation it checks for argument correctness before raising ENOTSUP.
>
> Lo-and-behold, `fclonefileat()` turns out to be the only function used in
> even the current version of Rust that is not available on 10.9, and my
> emulation allows me to install the current stable toolchain via my
> [https://github.com/RJVB/macstrop/blob/master/_resources/port1.0/group/rustup-1.0.tcl
> rustup PortGroup] and build rustup itself.
New description:
port:rust is currently being kept frozen to v1.78.0, which is beginning to
cause obsolescence issues and is probably not really justified.
Two observations to support that:
- using Rustup, the latest version of the official binaries that can be
made to run on 10.9 is 1.80.1, provided the binaries are relinked to
libMacportsLegacySystem.b.dylib . I am not equipped to test this but the
port:legacy-support maintainers should be able to assess how far back that
support can go.
- Using any newer version raises an error about a missing `fclonefileat()`
function. Which BTW was introduced in 10.12 if I'm not mistaken!
AFAICT that function is extremely easy to emulate: it just needs to return
an error with `ENOTSUP` when an attempt is made to use it on an
unsupported (= non-APFS) filesystem. On any Darwin version that doesn't
support APFS the "official" function would raise that error, and any code
using `clonefile()` and family must be prepared to handle that situation
(gracefully unless it means to support APFS only).
IOW, on 10.11 and earlier this simple emulation should suffice because
those OS versions do not support APFS anyway (or via Fuse only).
I tested this by adding just a runtime implementation to my copy of `port
:legacy-support`: https://github.com/RJVB/macstrop/blob/master/devel
/legacy-support/files/patch-clonefile-runtime-functions.diff . Note that
the emulation is slightly more complex: following the in-kernel
implementation it checks for argument correctness before raising ENOTSUP.
Lo-and-behold, `fclonefileat()` turns out to be the only function used in
even the current version of Rust that is not available on 10.9, and my
emulation allows me to install the current stable toolchain via my
[https://github.com/RJVB/macstrop/blob/master/_resources/port1.0/group/rustup-1.0.tcl
rustup PortGroup] and build rustup itself with it.
--
--
Ticket URL: <https://trac.macports.org/ticket/72272#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list