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

[email protected]: make keg-only #86469

Closed
wants to merge 2 commits into from

Conversation

branchvincent
Copy link
Member

@branchvincent branchvincent commented Oct 5, 2021

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Closes #86520

#84626 (comment)

cc: @carlocab

@BrewTestBot BrewTestBot added the automerge-skip `brew pr-automerge` will skip this pull request label Oct 5, 2021
@branchvincent branchvincent added the CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. label Oct 5, 2021
@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

This should involve a revision bump or existing installations won't be made keg only.

@branchvincent
Copy link
Member Author

does that imply this can't be a syntax-only pr?

@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021 via email

@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

link_overwrite can also be removed when made keg-only.

@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

Other adjustments to make, if I haven't missed anything:

-    # post_install happens after link
-    %W[pip3 wheel3 pip#{version.major_minor}].each do |e|
-      (HOMEBREW_PREFIX/"bin").install_symlink bin/e
-    end
-
   def caveats
     <<~EOS
       Python has been installed as
-        #{HOMEBREW_PREFIX}/bin/python3
+        #{opt_bin}/python3
 
       Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
       `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
         #{opt_libexec}/bin
 
       You can install Python packages with
-        pip3 install <package>
+        #{opt_bin}/pip3 install <package>

@branchvincent
Copy link
Member Author

branchvincent commented Oct 5, 2021

happy to fix those, but CI will take several days correct? I was assuming we needed a quick fix, because we currently have [email protected] and [email protected] both installing as $(brew --prefix)/bin/python3.

if that's the case and I'm not misunderstanding, then perhaps we should first make [email protected] keg-only?

@carlocab
Copy link
Member

carlocab commented Oct 5, 2021

If we want something quick we could add conflicts_with for now to produce a better error message until we can make this keg-only.

@branchvincent
Copy link
Member Author

branchvincent commented Oct 5, 2021

seems the last python migration went like this:

  1. Add [email protected]+1 as keg-only in a single PR
  2. Update one formula per PR to depends_on "[email protected]+1
  3. Make [email protected]+1 the main python

if we're following that again, then we just missed making [email protected] keg-only, right? i think a PR to correct that should be quick

@carlocab
Copy link
Member

carlocab commented Oct 5, 2021

seems the last python migration went like this:

  1. Add [email protected]+1 as keg-only in a single PR
  2. Update one formula per PR to depends_on "[email protected]+1
  3. Make [email protected]+1 the main python

if we're following that again, then we just missed making [email protected] keg-only, right? i think a PR to correct that should be quick

Sounds good!

@BrewTestBot BrewTestBot added legacy Relates to a versioned @ formula and removed automerge-skip `brew pr-automerge` will skip this pull request labels Oct 5, 2021
@carlocab carlocab changed the title [email protected]: make keg-only [email protected]: make keg-only Oct 5, 2021
@branchvincent branchvincent removed the CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. label Oct 5, 2021
@BrewTestBot BrewTestBot added the automerge-skip `brew pr-automerge` will skip this pull request label Oct 5, 2021
@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

but CI will take several days correct?

Well, one day maybe - not several.

Though I'm also fine with the 3.10 keg only approach for now.

@carlocab
Copy link
Member

carlocab commented Oct 5, 2021

We also need to do [email protected]. Can be a separate PR.

Also, more changes might be needed here -- IIRC what we do with ensurepip here isn't done in the older Python formulae because it installs stuff directly into HOMEBREW_PREFIX (rather than into the formula prefix in HOMEBREW_CELLAR) so it breaks the formula being keg-only.

At least, I think that's what I found when I tried backporting the changes to [email protected]. I may have just done things wrong or am misremembering.

@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

Installing to /usr/local/lib/python3.9/site-packages is fine as our keg only formulae still symlink to there (intentionally). If ensurepip only touches that then it's fine, if not then it's worth looking to fix that.

@carlocab
Copy link
Member

carlocab commented Oct 5, 2021

I think ensurepip installs a /usr/local/bin/pip (or pip3?).

@Bo98
Copy link
Member

Bo98 commented Oct 5, 2021

A quick test in the CI is to ask it to print the contents of HOMEBREW_PREFIX/bin at the end of postinstall (and might as well do python-tk at the same time since that'll be a couple more runs).

@branchvincent
Copy link
Member Author

branchvincent commented Oct 5, 2021

seems neither HOMEBREW_PREFIX/"bin/pip3" nor HOMEBREW_PREFIX/"bin/pip" get created

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

Thanks @branchvincent!

@@ -23,6 +24,8 @@ class PythonAT310 < Formula
# build packages later. Xcode-only systems need different flags.
pour_bottle? only_if: :clt_installed

keg_only :versioned_formula

depends_on "pkg-config" => :build
Copy link
Member

Choose a reason for hiding this comment

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

Actually, does this have OpenSSL 1.1 in its dep tree other than through here? If so we should use OpenSSL 3.0.

Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't use OpenSSL 3.0 until it or 1.1 is keg only, or we're just going to reintroduce the problem #86520 is having.

Copy link
Member

Choose a reason for hiding this comment

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

Also that person was probably right in saying we should avoid anything too important while that old macOS build issue is still a thing.

@BrewTestBot
Copy link
Member

:shipit: @branchvincent has triggered a merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge-skip `brew pr-automerge` will skip this pull request legacy Relates to a versioned @ formula python-3.10-migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[email protected] overrides /usr/local/bin/python3 etc. installed by [email protected]
5 participants