Opened 4 years ago

Closed 21 months ago

#60438 closed defect (fixed)

ports that use rust no longer able to build universal with i386

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: g5pw (Aljaž Srebrnič), herbygillot (Herby Gillot), dbevans (David B. Evans), danchr (Dan Villiom Podlaski Christiansen), Raimondi (Israel Chauca Fuentes), roederja, mascguy (Christopher Nielsen), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: rust librsvg racer geckodriver newsboat sequoia-pgp

Description

I had librsvg installed with the +universal variant on macOS High Sierra. After changes to the rust port to remove i386 support, it is no longer possible to build librsvg with the universal variant when that includes the i386 architecture:

--->  Computing dependencies for librsvg
Error: Cannot install librsvg for the archs 'i386 x86_64' because
Error: its dependency rust only supports the arch 'x86_64'.

If I modify the librsvg port to skip the architecture check for rust:

diff --git a/graphics/librsvg/Portfile b/graphics/librsvg/Portfile
index aa2d199124d..546866e9fae 100644
--- a/graphics/librsvg/Portfile
+++ b/graphics/librsvg/Portfile
@@ -89,6 +89,8 @@ variant viewer description "Build the rsvg-view-3 viewer utility." {
     depends_build-append \
                     port:rust
 
+    depends_skip_archcheck rust
+
     # when CARGO_BUILD_TARGET is set, directory structure changes
     patchfiles-append \
                     patch-configure-rust_target_subdir.diff

then the build fails later with:

error[E0463]: can't find crate for `core`
  |
  = note: the `i686-apple-darwin` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `lazy_static`.
Caused by:
  process didn't exit successfully: `rustc --crate-name lazy_static /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_graphics_librsvg/librsvg/work/librsvg-2.48.4-i386/vendor/lazy_static/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C debuginfo=2 -C metadata=29620eabd57d5eee -C extra-filename=-29620eabd57d5eee --out-dir /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_graphics_librsvg/librsvg/work/librsvg-2.48.4-i386/target/i686-apple-darwin/release/deps --target i686-apple-darwin -L dependency=/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_graphics_librsvg/librsvg/work/librsvg-2.48.4-i386/target/i686-apple-darwin/release/deps -L dependency=/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_graphics_librsvg/librsvg/work/librsvg-2.48.4-i386/target/release/deps --cap-lints allow -C linker=/usr/bin/clang` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
make[2]: *** [librsvg_c_api.la] Error 101

I assume that other ports that use rust would experience the same problems, however I was not able to get to the point of observing this error with any of those other ports. newsboat seems to have a different problem when building universal. sequoia-pgp doesn't have a universal variant. racer and geckodriver fail to build for unrelated reasons with or without the universal variant; see other tickets.

If we can fix it so that i386 builds of ports that use rust are once again possible, that would be great (e.g. is it possible to have rust install the latest i386-supporting version alongside the newer x86_64 version?). If not, then the affected ports (and any ports that depend on them, and any ports that depend on them, etc.) should be marked as not supporting the i386 architecture (e.g. supported_archs x86_64), except that for librsvg it's more complicated than that because librsvg installs an older pre-rust version that still supports i386 on older systems.

Change History (8)

comment:1 Changed 4 years ago by kencu (Ken)

you could probably use the non-rust librsvg port for i386 (it's currently enabled for older systems).

comment:2 Changed 4 years ago by Gcenx

I know this ticket is half a year old but just Incase anyone else runs into this.

The easy solution is to force downgrade the cargo/rust Portfiles using a local Portfile repository just place yours above the macports default.

There is another options that doesn’t seem to have been considered however. Rust requires rust to compile itself aka a bootstrap, what’s stopping us from using rust version 1.41.1 to compile the very latest version?

comment:3 Changed 4 years ago by g5pw (Aljaž Srebrnič)

what’s stopping us from using rust version 1.41.1 to compile the very latest version?

Unfortunately it doesn't compile successfully.

comment:4 in reply to:  3 Changed 4 years ago by Gcenx

Replying to g5pw:

what’s stopping us from using rust version 1.41.1 to compile the very latest version?

Unfortunately it doesn't compile successfully.

Yeah it seems upstream rust has a lot of changes that require a newer version of rust to compile rust. But rust hasn't removed the i686 darwin target so can't we just use --target=i686_apple_darwin

Here's what I found on cross-compiling rust for a new platform https://www.reddit.com/r/rust/comments/5ag60z/how_do_i_bootstrap_rust_to_crosscompile_for_a_new/

But in our case we already have the support within rust source we just need binaries

comment:5 Changed 4 years ago by kencu (Ken)

what I did to get ghc on < 10.10 was go back to the last one that worked and then stepped forward from there.

comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:7 Changed 21 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:8 Changed 21 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

i386 support in Rust should now be available back to 10.5.

Note: See TracTickets for help on using tickets.