Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 874885 - dev-lang/rust-1.64.0-r1[wasm,rust-analyzer]: Build failure: cannot find function `home_dir_inner` in this scope
Summary: dev-lang/rust-1.64.0-r1[wasm,rust-analyzer]: Build failure: cannot find funct...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-04 14:26 UTC by Randy Barlow
Modified: 2023-01-12 22:37 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
compressed build.log (build.log.xz,690.63 KB, application/x-xz)
2022-10-04 14:49 UTC, Randy Barlow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Barlow 2022-10-04 14:26:29 UTC
I've found that rust-1.64.0-r1 will build with the wasm USE flag disabled, but fails with it enabled:

error[E0425]: cannot find function `home_dir_inner` in this scope
  /rustc/1.64.0/vendor/home/src/lib.rs:65:5

I'll attach the build.log for context.

Reproducible: Always

Steps to Reproduce:
1. Enable wasm USE flag
Actual Results:  
The build fails, with "cannot find function `home_dir_inner` in this scope".

Expected Results:  
The build should succeed.

Portage 3.0.37 (python 3.10.6-final-0, default/linux/amd64/17.1/desktop/gnome/systemd, gcc-11.3.0, glibc-2.35-r8, 5.19.12-gentoo-dist x86_64)                                                                                                 
=================================================================                                                      
System uname: Linux-5.19.12-gentoo-dist-x86_64-Intel-R-_Core-TM-_i7-10750H_CPU_@_2.60GHz-with-glibc2.35                
KiB Mem:    32486860 total,   9044088 free
KiB Swap:          0 total,         0 free          
Timestamp of repository gentoo: Mon, 03 Oct 2022 21:00:01 +0000                                                                                                                                                                               
Head commit of repository gentoo: 657428f74b9c22b6d5c7d5f7254f314bdfcebb9a                                             
sh bash 5.1_p16-r1            
ld GNU ld (Gentoo 2.38 p4) 2.38                                                                                                                                                                                                               
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo                                                                                                                                                                                                 
dev-lang/perl:             5.34.1-r3::gentoo                                                                                                                                                                                                  
dev-lang/python:           3.10.6_p4::gentoo
dev-lang/rust:             1.64.0-r1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          251.4::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo                                                                                                                                                                                   
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo
sys-devel/gcc:             11.3.0::gentoo                                                                                                                                                                                                     
sys-devel/gcc-config:      2.5-r1::gentoo                                                                                                                                                                                                     
sys-devel/libtool:         2.4.7::gentoo                                                                                                                                                                                                      
sys-devel/lld:             14.0.6::gentoo                                                                                                                                                                                                     
sys-devel/llvm:            14.0.6-r2::gentoo                                                                                                                                                                                                  
sys-devel/make:            4.3::gentoo                                                                                                                                                                                                        
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)                                                                                                                                                                               
sys-libs/glibc:            2.35-r8::gentoo                                                                                                                                                                                                    Repositories:                                                                                                                                                                                                                                                                                                                                                                                                                                                                               gentoo           
    location: /var/db/repos/gentoo                                                                                                                                                                                                            
    sync-type: rsync                                                                                                                                                                                                                          
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage      
    priority: -1000                                        
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

local
    location: /usr/local/portage
    masters: gentoo

guru
    location: /var/lib/layman/guru
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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 -pipe -march=native"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox 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 -pipe -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12 -l25"
PKGDIR="/var/cache/binpkgs"
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 alsa amd64 bluetooth branding btrfs bzip2 cairo cdda cdr cli colord crypt cups dbus dist-kernel dri dts dvd dvdr eds encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gui iconv icu introspection ipv6 jpeg lcms libglvnd libnotify libsecret libtirpc mad mng mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl nvidia ogg opengl openh264 openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline screencast sdl seccomp spell split-usr ssl startup-notification svg sysprof systemd tiff tracker truetype udev udisks unicode upower usb v4l vdpau vorbis wayland webp wxwidgets x264 x265 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX WebAssembly X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Randy Barlow 2022-10-04 14:49:52 UTC
Created attachment 818524 [details]
compressed build.log

Here is the build log. The noise about skylake and other CPU optimization flags are probably because of my RUSTFLAGS variable. It still fails when I don't set RUSTFLAGS.
Comment 2 Janos Zsitvai 2022-10-04 15:07:43 UTC
I see you have both wasm and rust-analyzer enabled, I get the same failure in this case. Separately both "-wasm rust-analyzer" and "wasm -rust-analyzer" build, but not together. (In the end I disabled all flags except system-bootstrap and system-llvm and used dev-util/rustup to install a full environment in my home directory.)
Comment 3 Randy Barlow 2022-10-04 15:10:42 UTC
(In reply to Janos Zsitvai from comment #2)
> I see you have both wasm and rust-analyzer enabled, I get the same failure
> in this case. Separately both "-wasm rust-analyzer" and "wasm
> -rust-analyzer" build, but not together. (In the end I disabled all flags
> except system-bootstrap and system-llvm and used dev-util/rustup to install
> a full environment in my home directory.)

Thanks for the info Janos! Indeed, I have both enabled.
Comment 4 Georgy Yakovlev archtester gentoo-dev 2022-10-06 22:11:58 UTC
so it trips on

pub fn home_dir() -> Option<PathBuf> {
    home_dir_inner()
}

#[cfg(windows)]
use windows::home_dir_inner;

#[cfg(any(unix, target_os = "redox"))]
fn home_dir_inner() -> Option<PathBuf> {
    #[allow(deprecated)]
    env::home_dir()
}

but since we are building for --target wasm32-unknown-unknown

that function is cfg-gated and only defined on unix, redox and windows. but not on wasm.


this needs a bit more investigation.
while I could make wasm and analyzer mutually exclusive I thing something else may be related, so I'll leave it as is.

please for now just choose what you rather install, analyzer or wasm target.
Comment 5 Larry the Git Cow gentoo-dev 2022-11-11 02:36:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d234fad42feda43bdf8697ee86b656d2c4dbe71

commit 6d234fad42feda43bdf8697ee86b656d2c4dbe71
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-11-11 02:27:37 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-11-11 02:32:56 +0000

    dev-lang/rust: rust-analyzer and wasm are mutually exclusive for now
    
    Bug: https://bugs.gentoo.org/874885
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/rust-1.65.0.ebuild | 3 +++
 1 file changed, 3 insertions(+)
Comment 6 12101111 2022-12-20 10:46:04 UTC
This is fixed in rust 1.66.0

https://github.com/rust-lang/rust/commit/5b7bd2fed899b7966a09a6d5552a2e1985bc7526
Comment 7 znjameswu 2023-01-12 03:13:55 UTC
(In reply to 12101111 from comment #6)
> This is fixed in rust 1.66.0
> 
> https://github.com/rust-lang/rust/commit/
> 5b7bd2fed899b7966a09a6d5552a2e1985bc7526

Can confirm that this is indeed fixed in the current rust-1.66.1 on amd64 platform. After reverting commit 6d234fad42feda43bdf8697ee86b656d2c4dbe71, rust 1.66.1 still emerged successfully with both rust-analyzer and wasm enabled.
Comment 8 CaptainBlood 2023-01-12 19:14:20 UTC
Fine indeed here:
Installed versions:  1.66.1-r0(stable/1.66)^t[1](17:51:48 12/01/2023)(clippy miri nightly profiler rust-analyzer rust-src rustfmt system-bootstrap verify-sig wasm -debug -dist -doc -llvm-libunwind -parallel-compiler -system-llvm -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" CPU_FLAGS_X86="sse2" LLVM_TARGETS="WebAssembly X86 -AArch64 -AMDGPU -ARM -AVR -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -XCore")
Comment 9 Georgy Yakovlev archtester gentoo-dev 2023-01-12 22:37:49 UTC
I've removed mutual exclusion in 1.66.1, thanks for letting me know.

closing, as 1.65.0 is going away soon.