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

Library/Homebrew: move stdin ruby scripts to files under utils. #17204

Merged
merged 1 commit into from May 2, 2024

Conversation

MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented May 2, 2024

This avoids can avoid UID/EUID related issues with Ruby scripts passed over stdin clashing with Ruby security features.

It's also just a bit nicer to have Ruby scripts in files instead.

While we're here:

  • refactor some shared logic into a new setup-gem-home-bundle-gemfile function in ruby.sh
  • do some general cleanup of lock.sh
  • prioritise flock over python in lock.sh

Fixes #17008

This avoids can avoid UID/EUID related issues with Ruby scripts passed
over `stdin` clashing with Ruby security features.

It's also just a bit nicer to have Ruby scripts in files instead.

While we're here:
- refactor some shared logic into a new `setup-gem-home-bundle-gemfile`
  function in `ruby.sh`
- do some general cleanup of `lock.sh`
- prioritise `flock` over `python` in `lock.sh`
Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

Looks fine to me!

Personally I'd put the ruby scripts in utils/ruby, but this is fine to me too.

@MikeMcQuaid
Copy link
Member Author

Personally I'd put the ruby scripts in utils/ruby, but this is fine to me too.

I think I prefer the *_sh directories. For example, if you moved them and did require utils/ruby_check_version" (which seems, on the surface, a reasonable thing to so): the Ruby process will immediately exit upon require`ing 😅.

@MikeMcQuaid MikeMcQuaid merged commit b5b37d8 into master May 2, 2024
24 checks passed
@MikeMcQuaid MikeMcQuaid deleted the ruby_scripts_to_utils_files branch May 2, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants