Skip to content

πŸ§‘β€πŸ’» devcontainer for debugging with Ruby 2.5 #272

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Jul 8, 2025

Please help me support open source by sponsoring me - @pboling

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm not familiar with devcontainer...)

Comment on lines 8 to 11
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"./apt-install": {}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?
It seems that install.sh installs needless packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It very well could, but I'm not sure which they are, especially after upgrading to not-slim. The packages can be trimmed later too. It was my goal that this be the minimal set to install Ruby, but I may have collected too many.

Copy link
Contributor Author

@pboling pboling Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and the reason there is a Java package is I am trying to additionally test everything against JRuby going forward.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that all packages are needless because:

  • We don't need to build CRuby (ruby:2.5-buster already has built CRuby)
  • We don't need JRuby (We should use separated jruby image instead)

BTW, how can I test the current configuration on local...? I'm not a Visual Studio Code user. So I want to test without Visual Studio Code...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only done it from within RubyMine (in which case you just right click on the file to start the container with a local RubyMine inside the container and a cross mounted project).

But this is how I would do it from the CLi:

https://containers.dev/supporting#devcontainer-cli

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove the apt install script and see if that works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified the feature to setup bundler instead of installing apt packages.

root@d5a0bdd30fe3:/IdeaProjects/rexml# bundle -v
Bundler version 2.3.27
root@d5a0bdd30fe3:/IdeaProjects/rexml# bundle exec rake
/usr/local/bin/ruby test/run.rb
Loaded suite test
Started
Finished in 4.109169655 seconds.
-----------------------------------------------------------------------------------------------------------
716 tests, 2170 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------
174.24 tests/s, 528.09 assertions/s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In doing so I noticed that this gem has bundler as a dependency in the Gemfile, and that's not a good idea, unless the gem is literally something that hacks on bundler. This gem only uses bundler in the normal, vanilla, way, so it should not have bundler, even as a development dependency. Added as #276

@kou This PR is ready for review.

@pboling
Copy link
Contributor Author

pboling commented Jul 14, 2025

@kou Ready for review again.

@pboling pboling requested a review from kou July 14, 2025 10:45
@pboling pboling force-pushed the feat/271-devcontainer branch 2 times, most recently from cf8bd52 to 739bbba Compare July 15, 2025 18:57
@pboling
Copy link
Contributor Author

pboling commented Jul 16, 2025

@kou this is ready for review. The Gemfile for Ruby 2.5 is now copied fresh each time the devcontainer is run, and is gitignored.

pboling and others added 9 commits July 16, 2025 03:16
@pboling pboling force-pushed the feat/271-devcontainer branch from 2fb8881 to 5f58340 Compare July 16, 2025 03:19
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.

2 participants