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

Replace instance variable access with call to .elf. #7996

Merged
merged 2 commits into from Jul 15, 2020

Conversation

rmNULL
Copy link
Contributor

@rmNULL rmNULL commented Jul 13, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

.elf was introduced in gem release v1.1.0.
Resolves #7678 (comment)

…access with call to .elf.

patcher.elf was introduced in gem release v1.1.0.
@rmNULL
Copy link
Contributor Author

rmNULL commented Jul 13, 2020

cc @sjackman @woodruffw

@jonchang
Copy link
Contributor

We don’t have version requirements for the other gems. Should we update Gemfile.lock instead?

@woodruffw
Copy link
Member

We don’t have version requirements for the other gems. Should we update Gemfile.lock instead?

Perhaps both? We won't be able to function with versions of patchelf.rb below 1.1 from here on out, so it makes sense to me to enforce it in the Gemfile itself and also to check-in the relevant lockfile changes.

@rmNULL, could you do that?

@jonchang
Copy link
Contributor

jonchang commented Jul 14, 2020

Perhaps both? We won't be able to function with versions of patchelf.rb below 1.1 from here on out, so it makes sense to me to enforce it in the Gemfile itself and also to check-in the relevant lockfile changes.

Yeah, but it should always update to the latest in the lockfile, since setting HOMEBREW_PATCHELF_RB will always call install_bundler_gems!, which will always install the version specified in the lockfile.

I note that patchelf isn't currently specified in Gemfile.lock, so this means that it'll always be up to date assuming it doesn't conflict with other things in the lockfile.

@sjackman
Copy link
Member

For consistency with the rest of the Gemfile I agree with removing the version dependency.

@woodruffw
Copy link
Member

Yeah, but it should always update to the latest in the lockfile, since setting HOMEBREW_PATCHELF_RB will always call install_bundler_gems!, which will always install the version specified in the lockfile.

I note that patchelf isn't currently specified in Gemfile.lock, so this means that it'll always be up to date assuming it doesn't conflict with other things in the lockfile.

Good points. No objections here!

@jonchang
Copy link
Contributor

jonchang commented Jul 14, 2020

If anything, we should:

  • remove the ENV variable test in Gemfile
  • commit patchelf to Gemfile.lock

This is fine because (and correct me if I'm wrong) we always check for HOMEBREW_PATCHELF_RB and call install_vendor_gems! on all codepaths that would use patchelf.rb. This means that we no longer get dirty work trees when HOMEBREW_PATCHELF_RB is set, and anyone actually using the functionality will have the right gems installed on demand.

When we flip the switch so everyone uses patchelf.rb, we can use brew vendor-gems and commit patchelf.rb under vendor/.

@woodruffw
Copy link
Member

This is fine because (and correct me if I'm wrong) we always check for HOMEBREW_PATCHELF_RB and call install_vendor_gems! on all codepaths that would use patchelf.rb. This means that we no longer get dirty work trees when HOMEBREW_PATCHELF_RB is set, and anyone actually using the functionality will have the right gems installed on demand.

When we flip the switch so everyone uses patchelf.rb, we can use brew vendor-gems and commit patchelf.rb under vendor/.

Yeah, this sounds preferable to me. I can't recall why we didn't do this in the first place, other than maybe not wanting to install patchelf.rb unconditionally on all Homebrew boxes. But we'll be doing that when we vendor eventually, so I don't think it's a huge deal.

@jonchang
Copy link
Contributor

Now that HOMEBREW_DEVELOPER implies HOMEBREW_PATCHELF_RB there's no reason to avoid committing to the lockfile anymore. But prior to that change I think it made sense.

@Bo98 Bo98 mentioned this pull request Jul 14, 2020
6 tasks
@Bo98
Copy link
Member

Bo98 commented Jul 14, 2020

Now that HOMEBREW_DEVELOPER implies HOMEBREW_PATCHELF_RB there's no reason to avoid committing to the lockfile anymore. But prior to that change I think it made sense.

Would it affect Dependabot at all?

@jonchang
Copy link
Contributor

jonchang commented Jul 14, 2020

Would it affect Dependabot at all?

I think dependabot would push updates to the lockfile as usual.

@Bo98
Copy link
Member

Bo98 commented Jul 14, 2020

I asked since Dependabot can purge dependencies no longer used, and I wasn't sure how it did that internally.

@jonchang
Copy link
Contributor

I think dependabot basically does bundle update foo on the lockfile, so if we make the Gemfile more "standard" (not changing behavior based on environment variables) it'll make things easier for everyone, including the bots :)

@Bo98
Copy link
Member

Bo98 commented Jul 14, 2020

make the Gemfile more "standard" (not changing behavior based on environment variables)

👍 on this.

I missed that point earlier - I thought this was about committing the lockfile only.

@sjackman
Copy link
Member

Yeah, this sounds preferable to me. I can't recall why we didn't do this in the first place, other than maybe not wanting to install patchelf.rb unconditionally on all Homebrew boxes.

The conditional Gemfile was at Mike's request, and yes, that was the reasoning.

Library/Homebrew/Gemfile Outdated Show resolved Hide resolved
Co-authored-by: Shaun Jackman <sjackman@gmail.com>
Copy link
Member

@sjackman sjackman left a comment

Choose a reason for hiding this comment

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

LGTM!

@jonchang jonchang changed the title update patchelf.rb to '~> 1.1' in Gemfile. Replace instance variable access with call to .elf. Replace instance variable access with call to .elf. Jul 15, 2020
@jonchang jonchang merged commit 20e3d74 into Homebrew:master Jul 15, 2020
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 24, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants