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

If Nix profile environment exist, source it before installation check #100

Closed
wants to merge 4 commits into from

Conversation

domenkozar
Copy link
Member

@domenkozar domenkozar commented Oct 14, 2021

Fixes #98

@dhess
Copy link

dhess commented Oct 15, 2021

Trying this now.

@dhess
Copy link

dhess commented Oct 15, 2021

Unless I specified the action version incorrectly (I've never tried using a git rev before, but I'm pretty certain it's right), this does not fix the issue. The error is the same (/etc/bashrc.backup-before-nix exists and the installer aborts).

The log is here:

https://gist.github.com/dhess/86d3bf8c3310c688013fe5105de0cf00

@domenkozar
Copy link
Member Author

domenkozar commented Oct 15, 2021 via email

@dhess
Copy link

dhess commented Oct 15, 2021

Sorry, I posted the raw logs rather than the gist I created for them. Fixed.

@dhess
Copy link

dhess commented Oct 15, 2021

Same problem with take 2:

https://gist.github.com/dhess/1344497ff8ad3cf9e43af26bb7e3a2ea

I don't know much about how the runner works, but is it possible that it's cleaning up things like the runner home dir and even /nix, but not /etc? This should be easy to test by just adding an rm -rf /etc/bashrc.backup-before-nix near the beginning of the action and seeing how far it gets, even if that's not the proper fix that you want to commit to the main branch.

@dhess
Copy link

dhess commented Oct 15, 2021

FYI, I added this block to the workflow before the uses: cachix/install-nix-action@712fbc2bf94f397a90c5cf7ef2e4e5f159fbebab step and now it works fine:

    - name: Clean up in case this is a reused runner.
      run: |
        sudo rm -rf /etc/bashrc.backup-before-nix
        sudo rm -rf /etc/profile.d/nix.sh.backup-before-nix
        sudo rm -rf /etc/zshenv.backup-before-nix
        sudo rm -rf /etc/bash.bashrc.backup-before-nix

Logs: https://gist.github.com/dhess/e1ed3b0d08f422ebd66113d616a21f47

@dhess
Copy link

dhess commented Oct 15, 2021

Take 3 thinks that Nix is already installed, but either the path isn't set correctly, or Nix isn't actually installed:

https://gist.github.com/dhess/24b98976465d9db55b185a3a774df18f

@domenkozar
Copy link
Member Author

Closing this as it didn't fix the issue, will experiment further

@domenkozar domenkozar closed this Nov 30, 2021
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

Successfully merging this pull request may close these issues.

Breaks on (at least some) self-hosted runners
2 participants