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

env_config: infer HOMEBREW_FORBID_PACKAGES_FROM_PATHS from HOMEBREW_DEVELOPER #18379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlocab
Copy link
Member

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

If HOMEBREW_DEVELOPER is not set, then let's make
HOMEBREW_FORBID_PACKAGES_FROM_PATHS default to true.

I used a custom implementation here because we don't currently support
setting defaults for booleans. (See calls to define_method below.)

Closes #18371.

…EVELOPER

If `HOMEBREW_DEVELOPER` is not set, then let's make
`HOMEBREW_FORBID_PACKAGES_FROM_PATHS` default to true.

I used a custom implementation here because we don't currently support
setting defaults for booleans. (See calls to `define_method` below.)

Closes #18371.
@carlocab
Copy link
Member Author

Since this is a breaking change, we may want to save this for a minor release.

@carlocab
Copy link
Member Author

Looks like a lot of tests will need fixing.

@carlocab carlocab requested a review from a team September 23, 2024 14:19
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Feels like a good quick win here but a little clunky for long-term.

👍🏻 to ship as-is (with or without suggestion) and iterate.

Comment on lines +538 to +540
ENVS.fetch(:HOMEBREW_FORBID_PACKAGES_FROM_PATHS)
.fetch(:default)
.call
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ENVS.fetch(:HOMEBREW_FORBID_PACKAGES_FROM_PATHS)
.fetch(:default)
.call
developer?

feels a bit nice?

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.

Don't allow installing formulae from paths without HOMEBREW_DEVELOPER
2 participants