[MacPorts] #73711: py313-maturin @1.12.6_0: failed to parse manifest
MacPorts
noreply at macports.org
Tue Sep 1 15:43:42 UTC 2026
#73711: py313-maturin @1.12.6_0: failed to parse manifest
-------------------------------------+-------------------------------------
Reporter: thetrial | Owner: tobypeterson
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.12.4
Resolution: | Keywords: legacy-os leopard
Port: py313-maturin, | snowleopard lion mountainlion
py313-cryptography | mavericks yosemite elcapitan sierra
-------------------------------------+-------------------------------------
Comment (by JULWAL1):
I have a custom-rust 1.92 installed on my macOS Sierra 10.12.6 (via git
and using a customised config.toml file).\\
After installing it and **editing the PATH environment variable** ''so
that the custom-rust folder is searched first and then the MacPorts folder
afterwards'', I was then able to build py313-maturin 1.12.6 and above with
the ''edition2024'' feature:
{{{
$ port installed py313-maturin
The following ports are currently installed:
py313-maturin @1.9.6_0
py313-maturin @1.10.2_0
py313-maturin @1.12.6_0
py313-maturin @1.13.1_0
py313-maturin @1.13.3_0
py313-maturin @1.14.1_0 (active)
}}}
To overcome the **_SecTrustEvaluateWithError** error:
{{{
:info:build = note: some arguments are omitted. use `--verbose` to show
all linker arguments
:info:build = note: Undefined symbols for architecture x86_64:
:info:build "_SecTrustEvaluateWithError", referenced from:
:info:build
security_framework::trust::SecTrust::evaluate_with_error::h072a01f71ffd8d21
in libsecurity_framework-1dab1e2990453433.rlib(security_framework-
1dab1e2990453433.security_framework.d4784b2e59be8a30-cgu.14.rcgu.o)
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1
(use -v to see invocation)
:info:build
:info:build error: could not compile `maturin` (bin "maturin") due to 1
previous error
}}}
you will need to add the following to the bottom of the Portfile:
{{{
# Fix for missing SecTrustEvaluateWithError on macOS Sierra (10.12)
if {${os.platform} eq "darwin" && ${os.major} == 16} {
pre-build {
ui_info "Creating SecTrustEvaluateWithError stub library for macOS
Sierra..."
# 1. Write the clean C stub file inside the work path
set stub_c_file [open "${workpath}/sectrust_stub.c" w]
puts $stub_c_file "#include <CoreFoundation/CoreFoundation.h>"
puts $stub_c_file "Boolean SecTrustEvaluateWithError(void* trust,
CFErrorRef *error) {"
puts $stub_c_file " if (error) { *error = NULL; }"
puts $stub_c_file " return false;"
puts $stub_c_file "}"
close $stub_c_file
# 2. Compile it cleanly into a static archive library
system "clang -c ${workpath}/sectrust_stub.c -o
${workpath}/sectrust_stub.o"
system "ar rcs ${workpath}/libsectrust_stub.a
${workpath}/sectrust_stub.o"
# 3. Create a .cargo directory inside the extracted source code
root
file mkdir "${worksrcpath}/.cargo"
# 4. Write a native Cargo config to instruct the linker without
touching RUSTFLAGS
set cargo_config [open "${worksrcpath}/.cargo/config.toml" w]
puts $cargo_config "\[target.x86_64-apple-darwin\]"
puts $cargo_config "rustflags = \[\"-L\", \"${workpath}\", \"-l\",
\"static=sectrust_stub\"\]"
close $cargo_config
}
}
}}}
For the custom-rust that I installed, I had to add the following straight
after the {{{ checksums }}} block in the Portfile, so that MacPorts knows
where to find the custom rustc and cargo binaries:
{{{
# Force custom rustc and cargo paths
configure.env-append RUSTC=/opt/local/rust-custom/bin/rustc \
CARGO=/opt/local/rust-custom/bin/cargo
build.env-append RUSTC=/opt/local/rust-custom/bin/rustc \
CARGO=/opt/local/rust-custom/bin/cargo
# Ensure the custom bin directory is searched first
configure.env-append PATH=/opt/local/rust-custom/bin:$env(PATH)
build.env-append PATH=/opt/local/rust-custom/bin:$env(PATH)
pre-build {
system -W ${worksrcpath} "${prefix}/rust-custom/bin/cargo update
--offline"
}
}}}
Once py313-maturin 1.13.1 or above is installed, you will then be able to
build recent versions of py313-hypothesis, py313-cryptography, etc for
example,
as well as the PyIP package ''pipdeptree 4.x.y'' with using:
{{{
python -m pip install --no-cache-dir --config-settings=setup-
args=-Dpython.allow_limited_api=true pipdeptree==4.2.0
}}}
Note: The C stub file that is create via the Portfile is just to create
the missing symbol ''_SecTrustEvaluateWithError'' and does not properly
address: [https://trac.macports.org/ticket/66749] and
[https://trac.macports.org/ticket/65178] - It's not a true implementation
of
[https://developer.apple.com/documentation/security/sectrustevaluatewitherror(_:_:)]
Hope this helps.
--
Ticket URL: <https://trac.macports.org/ticket/73711#comment:21>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list