<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/eb9275fb1b0b4b9cbdb76fca3624d01b7b74094f">https://github.com/macports/macports-ports/commit/eb9275fb1b0b4b9cbdb76fca3624d01b7b74094f</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new eb9275fb1b0 rust: fix arm64/x86_64 build & remove jemalloc dep
</span>eb9275fb1b0 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit eb9275fb1b0b4b9cbdb76fca3624d01b7b74094f
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sun Jan 1 14:50:37 2023 -0700
<span style='display:block; white-space:pre;color:#404040;'> rust: fix arm64/x86_64 build & remove jemalloc dep
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Rust builds its own copy of jemalloc
</span><span style='display:block; white-space:pre;color:#404040;'> Removing it as a dependency as part of this commit minimizes rebuilds
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes https://trac.macports.org/ticket/66591
</span>---
lang/rust/Portfile | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/rust/Portfile b/lang/rust/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index f4d32939ac1..5e5e7d934a7 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/rust/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/rust/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,7 +8,7 @@ name rust
</span>
# keep in mind that you also need to update cargo.crates at the end of this file
version 1.66.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span>
categories lang devel
license {MIT Apache-2} BSD zlib NCSA Permissive
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -39,9 +39,6 @@ depends_build-append path:bin/cmake:cmake \
</span> if { ${configure.ccache} } {
depends_build-append port:ccache
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if { ${os.platform} eq "darwin" && ${os.major} > 14 } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_lib-append port:jemalloc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span> depends_lib-append port:curl \
port:libiconv \
port:libgit2 \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -56,9 +53,16 @@ depends_skip_archcheck cmake \
</span>
dist_subdir rust
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# the downloaded Rust compiler must run on the machine
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# since binaries must run anyway, simplify build by using Rosetta and not worry about cross-compiling
</span> muniversal.run_binaries yes
triplet.add_host all
triplet.add_build all
<span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach arch {arm64 x86_64 i386 ppc ppc64} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { [option muniversal.can_run.${arch}] && [option muniversal.is_cross.${arch}] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ muniversal.is_cross.${arch} no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
distname rustc-${version}-src
distfiles ${distname}${extract.suffix}:apple_vendor
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -135,6 +139,12 @@ if { ${os.platform} eq "darwin" && ${os.major} < 9 } {
</span> }
if { ${os.platform} eq "darwin" && ${os.major} > 14 } {
configure.args-append --set=rust.jemalloc
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${os.arch} eq "arm" } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # specify the number of significant virtual address bits in jmalloc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the configure script calls cpuid, but it does not work properly on Rosetta 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # see https://github.com/jemalloc/jemalloc/issues/1997#issuecomment-1041589117
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build.env.x86_64-append JEMALLOC_SYS_WITH_LG_VADDR=48
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
foreach arch ${muniversal.architectures} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -168,6 +178,10 @@ test.target check
</span>
rust::append_envs RUST_BACKTRACE=1
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# lists of installed files, so they should include files from all architectures
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+muniversal.combine ${prefix}/lib/rustlib/components \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${prefix}/lib/rustlib/manifest-rustc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-destroot {
if {${subport} eq "rust-src"} return
delete ${destroot}${prefix}/lib/rustlib/install.log
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -175,6 +189,10 @@ post-destroot {
</span> xinstall -d -m 0755 ${destroot}${prefix}/share/${name}
xinstall -m 0644 ${worksrcpath}/src/etc/ctags.rust \
${destroot}${prefix}/share/${name}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|${destroot}||g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/lib/rustlib/manifest-rustc \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/lib/rustlib/manifest-rustfmt-preview \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/lib/rustlib/manifest-clippy-preview
</span> }
subport rust-src {
</pre><pre style='margin:0'>
</pre>