[Jerbie] New package, v0.1.0 - #14413
Conversation
| # cross-compiling (can't run a Darwin binary on the Linux BB sandbox). Fetch | ||
| # the real, unmodified crate fresh and apply a minimal diff (preprocess-only | ||
| # instead of execute) rather than vendoring a modified copy in this repo. | ||
| git clone https://gitlab.com/tspiteri/gmp-mpfr-sys.git "$WORKSPACE/gmp-mpfr-sys-fixed" |
There was a problem hiding this comment.
This should be in the list of "sources"
| # Copyright © 2017-2026 Trevor Spiteri | ||
| # | ||
| # Copying and distribution of this file, with or without | ||
| # modification, are permitted in any medium without royalty provided | ||
| # the copyright notice and this notice are preserved. This file is | ||
| # offered as-is, without any warranty. | ||
| # | ||
| # We also install a copy of gmp-mpfr-sys's LGPL license alongside Jerbie's. |
There was a problem hiding this comment.
Why is this here? If the license is bundled with the jll, this here can go. If not that should be changed
There was a problem hiding this comment.
The license bundled with the jll is of gmp-mpfr-sys. This is the license that is specifically on the build script of that package which is patched here. It is not the same as the license used for the source code.
There was a problem hiding this comment.
If I understand this correctly, then this license MUST also end up in the jll.
(other Yggy maintainers, please correct me)
There was a problem hiding this comment.
Agreed that this makes little sense here.
There was a problem hiding this comment.
solved in the lastest commit : pull/14413/changes/369eda08a820d037b43faa829c4d774ced4e5418
| cat >> Cargo.toml <<EOF | ||
| [patch.crates-io] | ||
| gmp-mpfr-sys = { path = "$WORKSPACE/gmp-mpfr-sys-fixed" } | ||
| EOF |
There was a problem hiding this comment.
please instead use a patch file
| # Copyright © 2017-2026 Trevor Spiteri | ||
| # | ||
| # Copying and distribution of this file, with or without | ||
| # modification, are permitted in any medium without royalty provided | ||
| # the copyright notice and this notice are preserved. This file is | ||
| # offered as-is, without any warranty. | ||
| # | ||
| # We also install a copy of gmp-mpfr-sys's LGPL license alongside Jerbie's. |
There was a problem hiding this comment.
Agreed that this makes little sense here.
| # gmp-mpfr-sys's use-system-libs system-lib detection normally compiles AND | ||
| # executes a test binary to read off preprocessor macros, which fails when | ||
| # cross-compiling (can't run a Darwin binary on the Linux BB sandbox). Apply | ||
| # a minimal diff (preprocess-only instead of execute) to the fetched source. | ||
| patch -d "$WORKSPACE/srcdir/gmp-mpfr-sys-fixed/gmp-mpfr-sys" -p1 < gmp-mpfr-sys-cross-compile-fix.diff | ||
|
|
||
| patch -p1 < gmp-mpfr-sys-cargo-patch.diff | ||
|
|
There was a problem hiding this comment.
I don't quite understand what's going on here. But if the point is to build an executable for the host, rather than for the target, you can more simply do that (which I believe involves calling /opt/bin/${MACH_TYPE}/rustc or something like that) instead of patching anything.
There was a problem hiding this comment.
Building it for the host instead isn't equivalent: the probe needs to read the target's GMP_jll (GMP_LIMB_BITS is 32 on armv6l/armv7l vs 64 on the x86_64 host), so a host-compiled probe would link against the wrong GMP and give wrong ABI values into the generated bindings.
There was a problem hiding this comment.
To clarify, the build script for gmp-mpfr-sys ordinarily also compiles gmp/mpfr/mpc. However, their cross compilation here doesn't work for apple-aarch64-darwin. We can make it use system binaries for gmp/mpfr/etc with a flag, but that causes it to try and compile a C script that prints out the versions of those binaries. With cross compilation enabled, the build script compiles the binaries for the target while running them on the host. This patches that behavior.
There was a problem hiding this comment.
is this question answered ?
|
@giordano @lgoettgens , bumping . |
|
Before bumping it'd be good to address all questions raised already 🙂 |
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
No description provided.