-
Notifications
You must be signed in to change notification settings - Fork 128
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
Actually pass through the env vars to the Haskell installer #139
Conversation
Responds to my own dumb dumb mishaps with env vars and passing through sudo (since it's a different shell) #94 (comment) @DaneWeber Is this commit/fix what you had in mind? Signed-off-by: Jacob Hummer <jcbhmr@outlook.com>
Actually need more vars
This should be thoroughly checked before being merged to avoid things like #136 and others. |
I just saw this notification. I'll test it out locally in a minute. |
Something is weird about the install. GHCI, Cabal, and Stack are getting installed and are accessible, but they aren't being managed by GHCup. Results from this PR's Feature:
If I run the following as a non-root user in the same base image but without the Feature installed, I get the following behavior: Setup commands in place of Feature:
Results of the above non-root install:
I'm going to dig a little more, but it seems like something is getting a little messed up with the |
@DaneWeber I actually have no idea why it's different. 🤷♂️ Maybe we should ask the official source? https://github.com/haskell/ghcup-hs Btw thanks for testing this! Your quick and easy $HOME bodge is looking better and better, but this way's more fun. 😉 |
That likely means that the shell you are testing this in doesn't have |
@hasufell I don't know 🤔. It seems like it should be set to https://github.com/jcbhmr/devcontainers-contrib-features/blob/patch-1/src/haskell/install.sh#L32 export GHCUP_USE_XDG_DIRS=1 https://github.com/jcbhmr/devcontainers-contrib-features/blob/patch-1/src/haskell/install.sh#L57 export GHCUP_USE_XDG_DIRS='$GHCUP_USE_XDG_DIRS'
# This is inside the sudo <<EOF heredoc, thus the $GHCUP_USE_XDG_DIRS *should* be replaced with '1'
# before it gets passed to the bash interpreter, so the bash interpreter sees:
export GHCUP_USE_XDG_DIRS='1'
# ...Right? But then again, I don't really know 🤷♂️ |
Test it via |
Ahh. As in, the install is actually working fine, but when I open the terminal as the nonroot user, |
That's it! Thanks, @hasufell! 🎉 Test results:
Now we just need to add that env var to the |
#139 (comment) Co-authored-by: Dane Weber <DaneWeber@users.noreply.github.com> Signed-off-by: Jacob Hummer <jcbhmr@outlook.com>
🎉 Nice job @hasufell and @DaneWeber! |
Fixes the env vars not being passed to the sudo command as detailed in #94 (comment)
@DaneWeber Is this commit/fix what you had in mind?
This PR will...