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

Prevent Shadowenv from mutating BUNDLE_GEMFILE #2874

Merged

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Nov 18, 2024

Motivation

I finally understood the issue we were seeing of some folks requiring completely incompatible versions of add-ons.

If they used Shadowenv to override BUNDLE_GEMFILE, then it would cause the LSP to skip composing the bundle, which then leads to finding add-ons with Gem.find_files without having setup the bundle first.

That results in finding all addon.rb files defined by every installed gem, which might be ordered alphabetically and then results in requiring an old and incompatible Rails add-on version.

Implementation

We cannot let Shadowenv override BUNDLE_GEMFILE because that fully messes up our entire composed bundle setup. I started deleting that key from the activated environment.

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Nov 18, 2024 — with Graphite App
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock marked this pull request as ready for review November 18, 2024 19:59
@vinistock vinistock requested a review from a team as a code owner November 18, 2024 19:59
Copy link
Contributor

@andyw8 andyw8 left a comment

Choose a reason for hiding this comment

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

🤯

Copy link
Member Author

Merge activity

  • Nov 18, 3:26 PM EST: Graphite couldn't merge this PR because it failed for an unknown reason.

@vinistock vinistock merged commit 670defb into main Nov 18, 2024
38 checks passed
@vinistock vinistock deleted the 11-18-prevent_shadowenv_from_mutating_bundle_gemfile branch November 18, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants