Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.sh miplaces codegen-backends directory with libdir = "/lib/something" #93

Closed
gyakovlev opened this issue May 28, 2019 · 1 comment

Comments

@gyakovlev
Copy link

gyakovlev commented May 28, 2019

if someone passes libdir = "lib/rust-1.x.x" via config.toml
install.sh misplaces codegen-backends directory

this code here at fault:

if echo "$_file" | grep "^lib/" > /dev/null
then
local _f="$(echo "$_file" | sed 's/^lib\///')"
_file_install_path="$CFG_LIBDIR/$_f"
fi

imagine this scenario

part of config.toml

[install]
libdir = "lib/rust-1.34.2"

DESTDIR=/var/tmp/portage/dev-lang/rust-1.34.2/image ./x.py install

install.sh gets "--libdir=/var/tmp/portage/dev-lang/rust-1.34.2/image/usr/lib/rust-1.34.2" as one of args.

minimal reproducer

#!/bin/sh

CFG_LIBDIR=/var/tmp/portage/dev-lang/rust-1.34.2/image/usr/lib/rust-1.34.2
files=(
	lib/rustlib/i686-unknown-linux-gnu/lib/libLLVM-8-rust-1.34.2-stable.so
	lib/rust-1.34.2/rustlib/i686-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
	lib/libsyntax_pos-3b2f33a4aab1c362.so
)
for _file in ${files[@]}; do
	if echo "$_file" | grep "^lib/" > /dev/null; then
		_f="$(echo "$_file" | sed 's/^lib\///')"
		_file_install_path="$CFG_LIBDIR/$_f"
	fi
	echo $_file_install_path
done
sh test.sh
/var/tmp/portage/dev-lang/rust-1.34.2/image/usr/lib/rust-1.34.2/rustlib/i686-unknown-linux-gnu/lib/libLLVM-8-rust-1.34.2-stable.so
/var/tmp/portage/dev-lang/rust-1.34.2/image/usr/lib/rust-1.34.2/rust-1.34.2/rustlib/i686-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
/var/tmp/portage/dev-lang/rust-1.34.2/image/usr/lib/rust-1.34.2/libsyntax_pos-3b2f33a4aab1c362.so

so the resulting codegen-backends gets installed into /usr/lib/rust-1.34.2/rust-1.34.2

it can't be observed on x86_64 hosts because installer replaces lib/, not for lib64/

this breaks rustc as it can't find librustc_codegen_llvm-llvm.so until it's moved to proper location.

@gyakovlev
Copy link
Author

fixed by rust-lang/rust@661f42a in bootstrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant