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

Add some enviroment variables to /builddir/.bashrc in mock os but doesn't work when build rpm. #1382

Closed
duanhaomiao opened this issue Jun 6, 2024 · 0 comments

Comments

@duanhaomiao
Copy link

Short description of the problem

I'm doing secondary development on autospec project(use mock) to support golang. I configure config_opts['chroot_setup_cmd']='go' in .cfg file but it only installs one version of go, so I use curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer|sh command to manually install gvm to mock os to switch go verisons before using mock *.src.rpm command to build rpm.
Used command like this: /usr/bin/mock --root=/etc/mock/clear.cfg shell "curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer|sh; " --uniqueext=rclone --no-cleanup-after

But when i use chroot command to login the os again, i find the gvm not installed and there's no ~/.bashrc or /builddir/.bashrc file. After that, i change my command to /usr/bin/mock --root=/etc/mock/clear.cfg shell "touch ~/.bashrc; chmod 755 /builddir/; curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer|sh; " --uniqueext=rclone --no-cleanup-after , creating .bashrc successfully and it contains gvm env scripts.

But then i run
/usr/bin/mock --root=/etc/mock/clear.cfg --result=results/ results/rclone-1.56.0-1.src.rpm --uniqueext=rclone --no-clean command to build rpm, i found gvm env scripts in ~/.bashrc not loaded when executing mock build command , because i check error log and find ${GOPATH} is printed empty.

So how can i make my gvm env scripts in ~/.bashrc loaded successfully when use mock to build rpm? thank you.

@github-project-automation github-project-automation bot moved this to Needs triage in CPT Kanban Jun 6, 2024
@praiskup praiskup moved this from Needs triage to Done in CPT Kanban Jun 10, 2024
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