vscode-dev-containers icon indicating copy to clipboard operation
vscode-dev-containers copied to clipboard

Issue 704: Adding enabling and disabling of RBENV and RVM packages

Open KanishkT123 opened this issue 3 years ago • 4 comments

Work Item ID

Description


Allows for RBENV and RVM tools to be enabled or disabled in the Ruby dev container.

PR Checklist


Use the check-list below to ensure your branch is ready for PR. If the item is not applicable, leave it blank.

  • [X] I have updated the documentation accordingly.
  • [X] I have added tests to cover my changes.
  • [X] All new and existing tests passed.
  • [X] My code follows the code style of this project.
  • [X] I ran the lint checks which produced no new errors nor warnings for my changes.
  • [X] I have checked to ensure there aren't other open Pull Requests for the same update/change.

Does this introduce a breaking change?


  • [ ] Yes
  • [X] No

If this introduces a breaking change, please describe the impact and migration path for existing applications below.

Testing


  • Instructions for testing and validation of your code: All smoke testing is done in the CI pipeline of the VS Code Remote Containers Repository. A sample run can be found here: https://github.com/microsoft/vscode-dev-containers/runs/5378725362?check_suite_focus=true

Other information or known dependencies

PR has been reviewed and approved internally by @juzuluag , @bderusha and @dnastrain


  • Any other information or known dependencies that is important to this PR.
  1. Changes to ruby-debian.sh script that modifies the bashrc and zshrc files in a devcontainer to allow conditional enabling of rbenv and rvm.
  2. Changes to devcontainer.json to include two new ENV Variables for built containers: RBENV_ENABLED and RVM_ENABLED which are read by the bashrc and zshrc to enable/disable RBENV and RVM
  3. Default enables rbenv and rvm in base.Dockerfile in order to reduce workflow disruption.
  4. Default disables rbenv and rvm in devcontainer.json in order to reduce tooling overhead for devcontainer users.

KanishkT123 avatar Mar 03 '22 15:03 KanishkT123

So reviewing this - the changes look good... but one thing that is flummoxing me is it still seems like somehow rvm is getting sourced when I set "RVM_ENABLED":"false" Are you seeing that as well? I am seeing rbenv not be found as expected - it's just rvm.

Chuxel avatar Mar 08 '22 00:03 Chuxel

Ah - found it. It looks like rvm is installing a file at /etc/profile.d/rvm.sh that we didn't expect. This is getting picked up when VS Code starts rather than when a new terminal is created.

I suspect this will need to have the same condition added to it.

Chuxel avatar Mar 08 '22 01:03 Chuxel

Ah - found it. It looks like rvm is installing a file at /etc/profile.d/rvm.sh that we didn't expect. This is getting picked up when VS Code starts rather than when a new terminal is created.

I suspect this will need to have the same condition added to it.

I'm not sure exactly how this works. Do you mean modifying the rvm.sh file directly, or do you mean maybe having the .bashrc file delete the rvm.sh file in profile.d?

KanishkT123 avatar Mar 14 '22 14:03 KanishkT123

@KanishkT123 Yeah, that is a reasonable way to handle it I think. I don't think this originally happened but got added somewhere along the way by the rvm installer.

Chuxel avatar Mar 15 '22 14:03 Chuxel