Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help! Rust build Failures (also gnome-base/librsvg)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
cctsurf
Tux's lil' helper
Tux's lil' helper


Joined: 12 Oct 2006
Posts: 126

PostPosted: Wed Dec 04, 2024 4:01 pm    Post subject: Help! Rust build Failures (also gnome-base/librsvg) Reply with quote

I'm having trouble compiling with rust. I started writing this thinking only about gnome-base/librsvg, but I run into similar problems when I attempt to even build dev-lang/rust...

I get a build failure when I attempt to build gnome-base/librsvg-2.57.3
Code:

/opt/rust-bin-1.81.0/bin/cargo --locked build --verbose  --release --package librsvg-c \
&& cd /var/tmp/portage/gnome-base/librsvg-2.57.3-r2/work/librsvg-2.57.3-abi_x86_64.amd64 && /bin/sh ./libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -O2 -march=ivybridge -pipe -Wno-incompatible-pointer-types  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -o librsvg_c_api.la _rsvg_dummy.lo && cp /var/tmp/portage/gnome-base/librsvg-2.57.3-r2/work/librsvg-2.57.3-abi_x86_64.amd64/target/release/liblibrsvg_c.a .libs/librsvg_c_api.a
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/opt/rust-bin-1.81.0/bin/rustc - --crate-name ___ --print=file-names '{-C' 'target-cpu=native}' --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `{-C`)

As you can see, I'm running rust-bin-1.81.0.

Anyway, because I'm using rust-bin, I thought I might be having trouble because I'm on a 64 bit only system, or something like that... so I attempted to build rust normal...it was worth a try, but it failed:
Code:

>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src ...
Building bootstrap
running: /opt/rust-bin-1.81.0/bin/cargo build --manifest-path /var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/Cargo.toml --verbose --verbose --verbose --locked --frozen
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/opt/rust-bin-1.81.0/bin/rustc - --crate-name ___ --print=file-names '{-C' 'target-cpu=native}' -C linker=x86_64-pc-linux-gnu-gcc -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `{-C`)

Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/./x.py", line 50, in <module>
    bootstrap.main()
    ~~~~~~~~~~~~~~^^
  File "/var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1191, in main
    bootstrap(args)
    ~~~~~~~~~^^^^^^
  File "/var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 1158, in bootstrap
    build.build_bootstrap()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 904, in build_bootstrap
    run(args, env=env, verbose=self.verbose, cwd=self.rust_root)
    ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/bootstrap.py", line 186, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /opt/rust-bin-1.81.0/bin/cargo build --manifest-path /var/tmp/portage/dev-lang/rust-1.81.0-r100/work/rustc-1.81.0-src/src/bootstrap/Cargo.toml --verbose --verbose --verbose --locked --frozen


something is more broken than just that one build...

I'm running a full 64-bit system,
I attempted to build librsvg 2.58.5, and had a similar error...
I had "RUSTFLAGS="{-C target-cpu=native}", but I commented that out and nothing changed (I'm pretty sure that since I'm using rust-bin, they don't come into play anyway)
a couple of weeks ago, I did a emerge -1ev gnome-base/librsvg, but again it failed to build.
Any thoughts on what I'm doing wrong?
Thanks in advance!
Back to top
View user's profile Send private message
cctsurf
Tux's lil' helper
Tux's lil' helper


Joined: 12 Oct 2006
Posts: 126

PostPosted: Wed Dec 04, 2024 4:02 pm    Post subject: Reply with quote

# emerge --info gnome-base/librsvg
Portage 3.0.66.1 (python 3.11.10-final-0, default/linux/amd64/23.0/split-usr/desktop/plasma, gcc-14, glibc-2.40-r5, 6.12.1-gentoo x86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-6.12.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-3632QM_CPU_@_2.20GHz-with-glibc2.40
KiB Mem: 16204060 total, 5866560 free
KiB Swap: 16777212 total, 16777212 free
Timestamp of repository gentoo: Wed, 04 Dec 2024 15:00:00 +0000
Head commit of repository gentoo: 3f27e15942d41c89e2a5e2a46b9bbe4801ae819c
Head commit of repository brave-overlay: 1ed453730611099e54d7bbcb964a19b96469f179

sh bash 5.2_p37
ld GNU ld (Gentoo 2.43 p3) 2.43.1
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils: 1.3.8::gentoo
app-shells/bash: 5.2_p37::gentoo
dev-build/autoconf: 2.72-r1::gentoo
dev-build/automake: 1.16.5-r2::gentoo
dev-build/cmake: 3.30.6::gentoo
dev-build/libtool: 2.4.7-r4::gentoo
dev-build/make: 4.4.1-r100::gentoo
dev-build/meson: 1.5.2::gentoo
dev-java/java-config: 2.3.4::gentoo
dev-lang/perl: 5.40.0::gentoo
dev-lang/python: 3.10.15_p2::gentoo, 3.11.10_p1::gentoo, 3.12.7_p1::gentoo, 3.13.0::gentoo
dev-lang/rust-bin: 1.81.0-r100::gentoo
sys-apps/baselayout: 2.17::gentoo
sys-apps/openrc: 0.54.2::gentoo
sys-apps/sandbox: 2.39::gentoo
sys-devel/binutils: 2.43-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang: 18.1.8::gentoo
sys-devel/gcc: 14.2.1_p20241116::gentoo
sys-devel/gcc-config: 2.11::gentoo
sys-devel/llvm: 18.1.8-r1::gentoo
sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc: 2.40-r5::gentoo
Repositories:

gentoo
location: /usr/portage
sync-type: rsync
sync-uri: rsync://rsync.gentoo.org/gentoo-portage
priority: -1000
volatile: True
sync-rsync-verify-jobs: 1
sync-rsync-extra-opts:
sync-rsync-verify-max-age: 24
sync-rsync-verify-metamanifest: yes

brave-overlay
location: /var/db/repos/brave-overlay
sync-type: git
sync-uri: https://gitlab.com/jason.oliveira/brave-overlay.git
masters: gentoo
volatile: False

crossdev
location: /usr/local/portage
masters: gentoo
priority: 0
volatile: True

local
location: /var/db/repos/local
masters: gentoo
volatile: False

Binary Repositories:

binhost
priority: 9999
sync-uri: https://mirrors.gethosted.online/gentoo/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=ivybridge -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=ivybridge -pipe"
DISTDIR="/mnt/nfs_portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --buildpkg-exclude "virtual/* sys-kernel/*-sources""
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=ivybridge -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait metadata-transfer multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=ivybridge -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo-mirror.flux.utah.edu/ http://www.gtlib.gatech.edu/pub/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="en en_US en-US"
MAKEOPTS="-j8 -l5"
PKGDIR="/mnt/nfs_portage/packages_tov"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="{-C target-cpu=native}"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet crypt cups dbus declarative dri dts dv dvd dvdr elogind encode exif ffmpeg flac gdbm gif gimp gpm gtk gui iconv icu jpeg kde kf6compat kwallet lame lcms libnotify libtirpc linguas_en linguas_en_US lm-sensors mad mng mp3 mp4 mpeg mpv mtp ncurses networkmanager nls nsplugin ogg oggvorbis opengl openmp openssl pam pango pcre pdf pipewire pipewire-alsa plasma png policykit ppds pulseaudio qml qt qt5 qt6 readline screencast sdl seccomp semantic-desktop smp sound spell split-usr ssl startup-notification svg test-rust threads tiff truetype udev udisks unicode upower usb vorbis vulkan wayland webkit widgets wxwidgets x264 xattr xcb xft xinerama xml xmp xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" ALSA_CARDS="hda-intel usb-audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="directory samsung" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64 pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en_US en-US" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PERL_FEATURES="ithreads" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_10 python3_11" RUBY_TARGETS="ruby32 ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="intel i965 vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
Package Settings
=================================================================

gnome-base/librsvg-2.57.3::gentoo was built with the following:
USE="introspection vala -debug -gtk-doc"
CFLAGS="-march=ivybridge -O2 -pipe -Wno-incompatible-pointer-types"
CXXFLAGS="-march=ivybridge -O2 -pipe"
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2002

PostPosted: Wed Dec 04, 2024 4:05 pm    Post subject: Reply with quote

Your RUSTFLAGS are invalid as they contain {} unnecessarily.
Back to top
View user's profile Send private message
cctsurf
Tux's lil' helper
Tux's lil' helper


Joined: 12 Oct 2006
Posts: 126

PostPosted: Wed Dec 04, 2024 4:23 pm    Post subject: Solved: Help! Rust build Failures (also gnome-base/librsvg) Reply with quote

Quote:
Your RUSTFLAGS are invalid as they contain {} unnecessarily.

Wow! Duh! It built now! I wonder where I got that.
Thanks!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5184
Location: Bavaria

PostPosted: Wed Dec 04, 2024 4:47 pm    Post subject: Reply with quote

sam_ wrote:
Your RUSTFLAGS are invalid as they contain {} unnecessarily.

Sam, please let me add a question:

In our Handbook ( https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage#RUSTFLAGS ) is the recommendation:
Code:
RUSTFLAGS="${RUSTFLAGS} -C target-cpu=native"

while in the wiki article (https://wiki.gentoo.org/wiki/Rust#Environment_variables ) is a:
Code:
RUSTFLAGS="-C target-cpu=native"

Are both correct? What is the difference?

Thank you very much for helping here! :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2002

PostPosted: Wed Dec 04, 2024 5:18 pm    Post subject: Reply with quote

The first one avoids clobbering the value if it was set earlier on in the file.

For example:
Code:

RUSTFLAGS="-C target-cpu=native"
RUSTFLAGS="-C link-arg=-Wl,-z,pack-relative-relocs" # clobbers the first value, the final value is RUSTFLAGS="-C link-arg=-Wl,-z,pack-relative-relocs"

vs
Code:

RUSTFLAGS="-C target-cpu=native"
RUSTFLAGS="${RUSTFLAGS} -C link-arg=-Wl,-z,pack-relative-relocs" # prepends the first value, the final value is RUSTFLAGS="-C target-cpu=native -C link-arg=-Wl,-z,pack-relative-relocs"


Using X="${X} ..." in examples like this helps reduce copy-paste confusion if users copy it into their config.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3954

PostPosted: Wed Dec 04, 2024 6:15 pm    Post subject: Reply with quote

From a portage perspective;

When setting value to a variable is additive to the previous value of that variable
Code:
user ~ # grep ^FEATURES /etc/portage/make.conf
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...
user ~ # emerge --info|grep ^FEATURES
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...
user ~ # FEATURES="-assume-digests" emerge --info|grep ^FEATURES
FEATURES="binpkg-docompress binpkg-dostrip binpkg-logs...
user ~ # grep ^FEATURES /etc/portage/make.conf
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...
FEATURES="-assume-digests"
user ~ # emerge --info|grep ^FEATURES
FEATURES="binpkg-docompress binpkg-dostrip binpkg-logs...
user ~ # FEATURES="assume-digests" emerge --info|grep ^FEATURES
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...
When setting value to a variable cancels the previous value of that variable
Code:

user ~ # grep ^RUSTFLAGS /etc/portage/make.conf
user ~ #
user ~ # emerge --info|grep RUSTFLAGS
RUSTFLAGS="-Ctarget-cpu=native -Cllvm-args=-x86-branches-within-32B-boundaries "
user ~ # RUSTFLAGS="-Ctarget-cpu=dummy" emerge --info|grep RUSTFLAGS
RUSTFLAGS="-Ctarget-cpu=dummy"
user ~ # grep ^RUSTFLAGS /etc/portage/make.conf
RUSTFLAGS="-Ctarget-cpu=dummy"
user ~ # emerge --info|grep RUSTFLAGS
RUSTFLAGS="-Ctarget-cpu=dummy"

Silly use case
Code:
user ~ # grep ^FEATURES /etc/portage/make.conf
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...
FEATURES="-assume-digests ${FEATURES}"
user ~ # emerge --info|grep ^FEATURES
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs...

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum