Skip to content

Commit

Permalink
CI image builder: fix profile loading for gentoo
Browse files Browse the repository at this point in the history
We need to load various environment variables from /etc/profile. We
cannot unconditionally load it, because opensuse sources env_vars and
their /etc/profile has a fatal bug in it that causes it to return
nonzero and abort under `set -e` (which is *amazing* as a thing to have
in /etc/profile specifically -- just saying).

Alas, even /etc/profile.env is not enough since Java support depends on
profile.d logic. Re-conditionalize this check to only be added to
env_vars.sh for the image named "gentoo".
  • Loading branch information
eli-schwartz committed Feb 9, 2024
1 parent c166b13 commit 3c7bc8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ concurrency:
on:
push:
branches:
- master
paths:
- 'ci/ciimage/**'
- '.github/workflows/images.yml'
Expand Down
9 changes: 5 additions & 4 deletions ci/ciimage/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ def gen_bashrc(self) -> None:
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
if [ -f /etc/profile.env ]; then
source /etc/profile.env
fi
'''

if self.data_dir.name == 'gentoo':
out_data += '''
source /etc/profile
'''

out_file.write_text(out_data, encoding='utf-8')

# make it executable
Expand Down

0 comments on commit 3c7bc8c

Please sign in to comment.