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

Preserve relative path sources in standalone setup #6327

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

composerinteralia
Copy link
Contributor

@composerinteralia composerinteralia commented Jan 31, 2023

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

Fixes #5317

When specifying gems with the :path option, bundler --standalone generates a bundler/setup.rb with absolute paths for those gems.

This makes good sense when the :path is absolute (the behavior was explicitly added in #4792 to handle absolute paths).

But when the :path option is relative, it is not always desirable to have absolute paths in bundler/setup.rb. For example, I work on an application that runs bundler --standalone in CI to build a deploy artifact, but because the root directory in CI does not match the root in production we are unable to use the generated bundler/setup.rb directly.

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

As suggested in #5317 (comment), this commit reverts back to bundler-setup-relative paths in if the :path option is relative. It preserves the current behavior of using absolute paths only when the :path option is absolute.

Make sure the following tasks are checked

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

Fixes rubygems#5317

When specifying gems with the `:path` option, `bundler --standalone`
generates a `bundler/setup.rb` with absolute paths for those gems.

This makes good sense when the `:path` is absolute (the behavior was
explicitly added in rubygems#4792 to
handle absolute paths).

But when the `:path` option is relative, it is not always desirable to
have absolute paths in `bundler/setup.rb`. For example, I work on an
application that runs `bundler --standalone` in CI to build a deploy
artifact, but because the root directory in CI does not match the root
in production we are unable to use the generated bundler/setup.rb
directly.

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

This commit reverts back to bundler-setup-relative paths in if the
`:path` option is relative. It preserves the current behavior of using
absolute paths only when the `:path` option is absolute.
Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

This is great, thanks so much for tackling this!

@simi simi merged commit 9f8bae3 into rubygems:master Feb 1, 2023
deivid-rodriguez pushed a commit that referenced this pull request Feb 15, 2023
…aths

Preserve relative path sources in standalone setup

(cherry picked from commit 9f8bae3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants