Skip to content

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

Closed
pboling wants to merge 9 commits into
ruby:masterfrom
pboling:feat/271-devcontainer
Closed

πŸ§‘β€πŸ’» devcontainer for debugging with Ruby 2.5#272
pboling wants to merge 9 commits into
ruby:masterfrom
pboling:feat/271-devcontainer

Conversation

@pboling

@pboling pboling commented Jul 8, 2025

Copy link
Copy Markdown

@kou kou left a comment

Copy link
Copy Markdown
Member

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 thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment on lines +8 to +11
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"./apt-install": {}
},

Copy link
Copy Markdown
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
Copy Markdown
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.

@pboling pboling Jul 14, 2025

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
Comment thread .devcontainer/devcontainer.json Outdated
@pboling

pboling commented Jul 14, 2025

Copy link
Copy Markdown
Author

@kou Ready for review again.

@pboling

pboling commented Jul 16, 2025

Copy link
Copy Markdown
Author

@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.

Peter H. Boling and others added 9 commits July 16, 2025 03:16
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