public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mozjs128] rawhide: Fix build with latest rust
@ 2026-10-26 21:49 Yaakov Selkowitz
  0 siblings, 0 replies; only message in thread
From: Yaakov Selkowitz @ 2026-10-26 21:49 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/mozjs128
Branch : rawhide
Commit : 11a5aee536a5b73b90d819432c3457b9684ef54a
Author : Yaakov Selkowitz <yselkowi@redhat.com>
Date   : 2026-10-20T01:23:48-04:00
Stats  : +62/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/mozjs128/c/11a5aee536a5b73b90d819432c3457b9684ef54a?branch=rawhide

Log:
Fix build with latest rust

---
diff --git a/mozjs128.spec b/mozjs128.spec
index 26cb555..ac3bd31 100644
--- a/mozjs128.spec
+++ b/mozjs128.spec
@@ -68,6 +68,11 @@ Patch21:        D261512.1755672843.diff
 # GC patch - https://gitea.wildfiregames.com/0ad/0ad/issues/8757
 Patch22:        FixExtraGCTracing.diff
 
+# Fix target detection with latest rust
+# https://phabricator.services.mozilla.com/D311145
+# https://phabricator.services.mozilla.com/D330023
+Patch23:        rust-configure.patch
+
 BuildRequires:  cargo
 %if "%{toolchain}" == "clang"
 BuildRequires:  clang

diff --git a/rust-configure.patch b/rust-configure.patch
new file mode 100644
index 0000000..9df6ba1
--- /dev/null
+++ b/rust-configure.patch
@@ -0,0 +1,57 @@
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+index 5525c26a184d..35cb30416c64 100644
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -298,6 +298,12 @@ def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
+         elif not candidates:
+             return None
+ 
++        vendor = (
++            host_or_target.vendor
++            if any(c.target.vendor == host_or_target.vendor for c in candidates)
++            else "unknown"
++        )
++
+         # We have multiple candidates. There are two cases where we can try to
+         # narrow further down using extra information from the build system.
+         # - For windows targets, correlate with the C compiler type
+@@ -360,11 +364,19 @@ def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
+             else:
+                 suffix = ""
+             for p in prefixes:
+-                for c in candidates:
+-                    if c.rust_target.startswith(
+-                        "{}-".format(p)
+-                    ) and c.rust_target.endswith(suffix):
++                matches = [
++                    c
++                    for c in candidates
++                    if c.rust_target.startswith("{}-".format(p))
++                    and c.rust_target.endswith(suffix)
++                ]
++                if not matches:
++                    continue
++                # As below, correlate on the (normalized) vendor.
++                for c in matches:
++                    if c.target.vendor == vendor:
+                         return c.rust_target
++                return matches[0].rust_target
+ 
+         # See if we can narrow down on the exact alias.
+         # We use the sub_configure_alias to keep support mingw32 triplets as input.
+@@ -393,6 +405,15 @@ def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
+         elif narrowed:
+             candidates = narrowed
+ 
++        # Correlate on the (normalized) vendor, so vendor-specific targets (e.g.
++        # the *-oe-linux-gnu targets added in rust 1.98) don't shadow the
++        # generic ones for aliases whose vendor doesn't match a rust target.
++        narrowed = [c for c in candidates if c.target.vendor == vendor]
++        if len(narrowed) == 1:
++            return narrowed[0].rust_target
++        elif narrowed:
++            candidates = narrowed
++
+         # See if we can narrow down with the raw OS and raw CPU
+         narrowed = [
+             c

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-26 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 21:49 [rpms/mozjs128] rawhide: Fix build with latest rust Yaakov Selkowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox