Opened 6 years ago

Closed 20 months ago

#57058 closed defect (fixed)

rust@1.28.0: Failed to build

Reported by: mfacorcoran Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: zack112358 (Zachary McCord), Dave-Allured (Dave Allured), MartinBuchmann (Martin Buchmann), physicsbeany, Blokkendoos (Johan), macdeport, mascguy (Christopher Nielsen)
Port: rust

Description

I just tried to selfupdate and upgrade outdated and go the following error when upgrading rust from rust@1.27.2_0 to rust@1.28.0:

--->  Computing dependencies for rust
--->  Building rust
Error: Failed to build rust: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_lang_rust/rust/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

I've attached rust/main.log

Attachments (4)

main.log (1.0 MB) - added by mfacorcoran 6 years ago.
rust main.log
zjm-main.log (129.7 KB) - added by zack112358 (Zachary McCord) 6 years ago.
rust_install_failure_BJK.log (299.1 KB) - added by physicsbeany 5 years ago.
main.2.log (71.9 KB) - added by MartinBuchmann (Martin Buchmann) 5 years ago.
build log

Download all attachments as: .zip

Change History (38)

Changed 6 years ago by mfacorcoran

Attachment: main.log added

rust main.log

comment:1 Changed 6 years ago by jmroot (Joshua Root)

Owner: set to g5pw
Status: newassigned
:warn:clean Xcode does not appear to be installed; most ports will likely fail to build.

Do you in fact have Xcode installed? What does xcodebuild -version say?

comment:2 Changed 6 years ago by mfacorcoran

I don't have the xcode app installed but do have the command line tools installed. Other ports build without issue. for example:

Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for py-healpy
--->  Fetching archive for py-healpy
--->  Attempting to fetch py-healpy-1.12.4_0.darwin_17.noarch.tbz2 from https://packages.macports.org/py-healpy
--->  Attempting to fetch py-healpy-1.12.4_0.darwin_17.noarch.tbz2 from http://lil.fr.packages.macports.org/py-healpy
--->  Attempting to fetch py-healpy-1.12.4_0.darwin_17.noarch.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/py-healpy
--->  Fetching distfiles for py-healpy
--->  Verifying checksums for py-healpy
--->  Extracting py-healpy
--->  Configuring py-healpy
--->  Building py-healpy
--->  Staging py-healpy into destroot
--->  Installing py-healpy @1.12.4_0
--->  Cleaning py-healpy

Changed 6 years ago by zack112358 (Zachary McCord)

Attachment: zjm-main.log added

comment:3 Changed 6 years ago by zack112358 (Zachary McCord)

I have the same problem, and I'm attaching my log file as well as zjm-main.log

~ 0 $ sudo port install rust
Password:
--->  Computing dependencies for rust
--->  Building rust
Error: Failed to build rust: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port rust failed

~ 64 $ xcodebuild -version
Xcode 6.4
Build version 6E35b

I do have xcode.app.

Last edited 6 years ago by zack112358 (Zachary McCord) (previous) (diff)

comment:4 Changed 6 years ago by zack112358 (Zachary McCord)

Cc: zack112358 added

comment:5 in reply to:  3 Changed 6 years ago by zack112358 (Zachary McCord)

Ah, to clarify: I'm trying to install Rust for the first time. But I am also having a mysterious build failure, like original poster.

main.log says

:info:build RuntimeError: failed to run: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.28.0-src/build/bootstrap/debug/bootstrap build -v -j4

Running that command manually

$ sudo /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.28.0-src/build/bootstrap/debug/bootstrap build -vv -j4
$ echo $?
139

doesn't produce any output, just exit status 139.

Last edited 6 years ago by zack112358 (Zachary McCord) (previous) (diff)

comment:6 Changed 6 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:7 Changed 6 years ago by MartinBuchmann (Martin Buchmann)

Cc: MartinBuchmann added

comment:8 Changed 6 years ago by g5pw (Aljaž Srebrnič)

That is a pretty mysterious build failure. What OS/hardware are you building this on? Does the build still fail with latest rust?

comment:9 Changed 6 years ago by MartinBuchmann (Martin Buchmann)

I am seeing this error on a Mid 2011 iMac (2,7GHz i5) running OS X 10.10.5.

Last edited 6 years ago by MartinBuchmann (Martin Buchmann) (previous) (diff)

comment:10 in reply to:  8 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to g5pw:

Does the build still fail with latest rust?

Yes, the latest rust fails to build on Yosemite. See also #56614.

comment:11 Changed 6 years ago by macdeport

Cc: macdeport added

Changed 5 years ago by physicsbeany

comment:12 Changed 5 years ago by physicsbeany

Having same problem on a 2018 Macbook Pro (running High Sierra 10.13.6) --- just uploaded log file ("rust_install_failure_BJK.log").

I don't care about rust per se, but it's a dependency for FFMPEG, which I *do* want.

comment:13 Changed 5 years ago by physicsbeany

Cc: physicsbeany added

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

I would suggest you:

sudo port clean rust
sudo port clean librsvg
sudo port clean ffmpeg

then change librsvg to the last version that didn't require rust to build:

port edit librsvg
-or-
bbedit `port file librsvg`

then find this block in the Portfile:

if {${os.platform} eq "darwin" && ${os.major} < 14} {
    # revert to latest pre-cargo version
    version         2.40.20
    epoch           1

    checksums       rmd160  e697e1220779f77e81a890718ef5cda5b5e6b740 \
                    sha256  cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b \
                    size    1796376
} else {

and change that test to something that includes your system:

if {${os.platform} eq "darwin" && ${os.major} < 18} {
    # revert to latest pre-cargo version
    version         2.40.20
    epoch           1

    checksums       rmd160  e697e1220779f77e81a890718ef5cda5b5e6b740 \
                    sha256  cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b \
                    size    1796376
} else {

then save that, and you should be good to go. Somebody might get rust sorted out one day. I dunno, it's a real bear to work with, IMHO. Can't believe that's the only way to build a simple SVG library. Maybe we can find another SVG library that doesn't use it.

If you update MacPorts, your little tweak will get overwritten. If that gets boring after a while, you can set up your own local repository to keep your changes.

comment:15 Changed 5 years ago by Dave-Allured (Dave Allured)

@physicsbeany, FWIW, I just installed FFMPEG with no problems, including rust. I am on the same OS as you, High Sierra 10.13.6, and older Mac Pro. This was a full install starting with a clean empty build of MacPorts core 2.5.4 into a private install directory, not /opt/local; and without root privileges.

I did apply two known simple patches before starting port install ffmpeg: bash-completion and rust DESTROOT. I don't think either are related to your problem. Your rust build never got close to DESTROOT.

I noticed this at the top of your main.log:

:debug:sysinfo Xcode none
:warn:main Xcode does not appear to be installed; most ports will likely fail to build.

My Mac has the full XCode 10.0 installed, so I did not get these warnings. I am not a MacPorts expert, but I did find discussion that full XCode is not always needed, and command tools alone are sufficient for many ports. Other docs warn to always use the latest XCode version. You might look into your current XCode status. Also please check this FAQ about xcode-select:

ProblemHotlist#xcode-select

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:16 in reply to:  14 Changed 5 years ago by physicsbeany

Hi @kenku.

Thanks! That worked (though I don't look forward to maintaining it).

Replying to kencu:

I would suggest you:

sudo port clean rust
sudo port clean librsvg
sudo port clean ffmpeg

then change librsvg to the last version that didn't require rust to build:

port edit librsvg
-or-
bbedit `port file librsvg`

then find this block in the Portfile:

if {${os.platform} eq "darwin" && ${os.major} < 14} {
    # revert to latest pre-cargo version
    version         2.40.20
    epoch           1

    checksums       rmd160  e697e1220779f77e81a890718ef5cda5b5e6b740 \
                    sha256  cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b \
                    size    1796376
} else {

and change that test to something that includes your system:

if {${os.platform} eq "darwin" && ${os.major} < 18} {
    # revert to latest pre-cargo version
    version         2.40.20
    epoch           1

    checksums       rmd160  e697e1220779f77e81a890718ef5cda5b5e6b740 \
                    sha256  cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b \
                    size    1796376
} else {

then save that, and you should be good to go. Somebody might get rust sorted out one day. I dunno, it's a real bear to work with, IMHO. Can't believe that's the only way to build a simple SVG library. Maybe we can find another SVG library that doesn't use it.

If you update MacPorts, your little tweak will get overwritten. If that gets boring after a while, you can set up your own local repository to keep your changes.

comment:17 Changed 5 years ago by Blokkendoos (Johan)

Cc: Blokkendoos added

Changed 5 years ago by MartinBuchmann (Martin Buchmann)

Attachment: main.2.log added

build log

comment:18 Changed 5 years ago by MartinBuchmann (Martin Buchmann)

I have Xcode installed but still see this error with the latest version of rust which I need for other ports like ripgrep.

iBuchi:~ Martin$ xcodebuild -version
Xcode 7.2.1
Build version 7C1002

Any news regarding a fix?

comment:19 Changed 5 years ago by petrrr

Summary: Failed to build rustrust@1.28.0: Failed to build

comment:20 Changed 5 years ago by bussdriver

on OS 10.10 (xcode 7.2.1) it still does not build:

 Compiling chalk-engine v0.7.0
:info:build error: Could not compile `rustc_platform_intrinsics`.
:info:build warning: build failed, waiting for other jobs to finish...
:info:build error: build failed
:info:build command did not execute successfully: "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/build/stage0-x86_64/bin/cargo" "build" "--target" "x86_64-apple-darwin" "-j" "8" "--release" "--frozen" "--features" " jemalloc" "--manifest-path" "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/rustc/Cargo.toml" "--message-format" "json"
:info:build expected success, got: exit code: 101
:info:build thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1112:9
:info:build note: Run with `RUST_BACKTRACE=1` for a backtrace.
:info:build Traceback (most recent call last):
:info:build   File "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/bootstrap/bootstrap.py", line 867, in <module>
:info:build     main()
:info:build   File "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/bootstrap/bootstrap.py", line 850, in main
:info:build     bootstrap(help_triggered)
:info:build   File "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/bootstrap/bootstrap.py", line 841, in bootstrap
:info:build     run(args, env=env, verbose=build.verbose)
:info:build   File "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/bootstrap/bootstrap.py", line 151, in run
:info:build     raise RuntimeError(err)
:info:build RuntimeError: failed to run: /Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/build/bootstrap/debug/bootstrap build -v -j8
:info:build make: *** [all] Error 1
:info:build make: Leaving directory `/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src'
:info:build Command failed:  cd "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src" && /usr/bin/make -j8 -w all VERBOSE=1 BOOTSTRAP_ARGS="-v -j8" 
:info:build Exit code: 2
:error:build Failed to build rust: command execution failed

comment:21 Changed 5 years ago by bussdriver

make -j1 -w all VERBOSE=1 RUST_BACKTRACE=1 BOOTSTRAP_ARGS="-v -j1"

Compiling rustc_platform_intrinsics v0.0.0 (file:///Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/librustc_platform_intrinsics)

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
error: Could not compile `rustc_platform_intrinsics`.

running: "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/build/stage0-x86_64/bin/cargo" "build" "--target" "x86_64-apple-darwin" "-j" "1" "--release" "--frozen" "--features" " jemalloc" "--manifest-path" "/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/rustc/Cargo.toml" "--message-format" "json" "--verbose"

error: failed to parse manifest at `/Volumes/raid/opt/var/macports/build/_Volumes_raid_opt_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_rust/rust/work/rustc-1.30.1-src/src/tools/clippy/Cargo.toml`

Caused by:
  the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel

I do not know anything about rust.

Last edited 5 years ago by bussdriver (previous) (diff)

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

Try this:

ulimit -Hs 8192; sudo port upgrade rust

From here <https://github.com/rust-lang/rust/issues/51838>

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

Note there is also this patch from ionic which I guess he doesn't feel is production ready enough to submit to MacPorts at present, but apparently works for him <https://git.ionic.de/macports-overlay.git/blob/HEAD:/lang/rust/files/patch-src-librustc_driver-enable-extra-thread.diff>

comment:24 Changed 5 years ago by Ionic (Mihai Moldovan)

The problem with this patch is that it worked for me, BUT it also required a rust bootstrapping binary that is built with it, otherwise rustc will fail bootstrapping. I had to employ a very nasty hack to bootstrap against an installed rust version (copying the contents) instead of using the precompiled version provided by the rust team, which is/was not suitable for inclusion in MacPorts.

Luckily this issue seems to be resolved. 1.33.0 and 1.34.0 both always use an extra thread now, so no ulimit hackery (or using a specially modified rustc bootstrapper) should be necessary.

comment:25 Changed 5 years ago by g5pw (Aljaž Srebrnič)

Ok, so should we treat this one as resolved by the update? Or does the underlying issue still exist?

comment:26 Changed 5 years ago by MartinBuchmann (Martin Buchmann)

On my system it works fine now.

comment:27 Changed 5 years ago by Ionic (Mihai Moldovan)

Yes and no. The original issue is resolved within rust, but there is a new issue that prevents users building 1.34 from the precompiled binaries the rust project provides (which our port does).

So it sadly turns out that there is still no way to build rust from the official prebuilt binaries with a MacPorts clang compiler due to the packages shipping a customized version of libLLVM.dylib - which the build then picks up by setting DYLD_LIBRARY_PATH and then clang fails to execute. Upstream bug report here.

Ironically this is not a problem with the system compilers as shipped by Apple since they do not dynamically link against libLLVM. I guess that its linked statically, so these versions do not even need to look for such a shared library - and thus don't fail.

comment:28 Changed 5 years ago by mouse07410 (Mouse)

There are packages that are better off installed outside of Macports. IMHO, Rust is one of those. I've installed Rust via rustup, which also takes care of the toolchains updates. It also allows switching on-the-fly between stable, beta, and nightly - none of which is possible with Macports port (AFAIK).

And everything else Rust-based I install via Cargo, so far so good.

comment:29 Changed 5 years ago by macdeport

Cc: macdeport removed

comment:30 Changed 5 years ago by macdeport

Cc: macdeport added

comment:31 Changed 20 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:32 Changed 20 months ago by mascguy (Christopher Nielsen)

rust has been building fine everywhere, for quite a while. Can this ticket be closed?

comment:33 in reply to:  32 ; Changed 20 months ago by macdeport

Replying to mascguy:

rust has been building fine everywhere, for quite a while. Can this ticket be closed?

OK for me. Thank you.

comment:34 in reply to:  33 Changed 20 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Replying to macdeport:

OK for me. Thank you.

Great, thanks for letting us know!

Note: See TracTickets for help on using tickets.