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

Fix bundle.bat re-execution #8101

Merged

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Oct 3, 2024

What was the end-user or developer problem that led to this PR?

Failing CI in https://github.com/rubygems/compact_index/ under mswin, because Bundler was trying to run a .bat script using ruby:

$ C:\Windows\system32\cmd.exe /D /S /C "D:\ruby-mswin\bin\bundle.bat install --jobs 4"
Bundler 2.6.0.dev is running, but your lockfile was generated with 2.4.12. Installing Bundler 2.4.12 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.4.12
Installing bundler 2.4.12
D:/ruby-mswin/bin/bundle: --> D:/ruby-mswin/bin/bundle
'$(' is not allowed as a global variable nameunexpected '(', expecting end-of-input
  2  {
> 3    bindir=$(dirname "$0")
> 4    exec "$bindir/ruby" "-x" "$0" "$@"
  5  }
D:/ruby-mswin/bin/bundle:3: syntax errors found (SyntaxError)
  1 | #!
  2 | {
> 3 |   bindir=$(dirname "$0")
    |          ^~ '$(' is not allowed as a global variable name
    |           ^ expected a `=>` between the hash key and value
> 4 |   exec "$bindir/ruby" "-x" "$0" "$@" ...
    | ^ expected a `}` to close the hash literal
    |   ^~~~ unexpected local variable or method, expecting end-of-input
> 5 | }
    | ^ unexpected '}', ignoring it
  6 | #!/usr/bin/env ruby
  7 | #

What is your fix for the problem, implemented in this PR?

.bat scripts don't have ruby code, so we should not prepend ruby to the command the re-execute it.

This fixes https://github.com/rubygems/compact_index CI as proved by rubygems/compact_index#67.

Make sure the following tasks are checked

It does not have ruby code, so we should not prepend `ruby` to the
command the re-execute it.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/fix-bundle-bat-reexecution branch from 35008e6 to e04e00f Compare October 3, 2024 18:18
@deivid-rodriguez
Copy link
Member Author

I'll merge to get https://github.com/rubygems/compact_index/ CI back on track.

@deivid-rodriguez deivid-rodriguez merged commit 9c35e7b into master Oct 7, 2024
83 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/fix-bundle-bat-reexecution branch October 7, 2024 16:36
deivid-rodriguez added a commit that referenced this pull request Oct 9, 2024
…undle-bat-reexecution"

This reverts commit 9c35e7b, reversing
changes made to 4968b90.
deivid-rodriguez added a commit that referenced this pull request Oct 9, 2024
…undle-bat-reexecution"

This reverts commit 9c35e7b, reversing
changes made to 4968b90.
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.

1 participant