You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!Warning: Your Xcode (15.2) is outdated.Please update to Xcode 15.4 (or delete it).Xcode can be updated from the App Store.
Verification
My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
I ran brew update twice and am still able to reproduce my issue.
I expected the mirroring to work correctly and not return a 404 and fallback.
I started digging into this and realized that Homebrew's mirror-handling code assumes that https://pypi.org/ and https://files.pythonhosted.org/ are both mirrored by a single URL and are interchangeable. However, the mirror we use (Artifactory) seems to have logic like:
MIRROR_URL/simple/* --> equivalent to https://pypi.org/simple/*
MIRROR_URL/packages/* --> equivalent to https://files.pythonhosted.org/*
In other words, the rewrite for a file like https://files.pythonhosted.org/packages/9b/ed/e277509bb9f9376efe391f2f5a27da9840366d12a62bef30f44e5a24e0d9/python-ly-0.9.7.tar.gz should be OUR-INTERNAL-MIRROR/packges/packages/9b/ed/e277509bb9f9376efe391f2f5a27da9840366d12a62bef30f44e5a24e0d9/python-ly-0.9.7.tar.gzNote the duplicated /packages!
So, this comes to the problem with HOMEBREW_PIP_INDEX_URL. As best I can tell, Homebrew never uses this variable for its intended purpose. Instead it uses this variable to then assume that there is a relationship between the PIP_INDEX_URL and where packages are hosted... and uses that assumption to incorrectly rewrite URLs.
I'm now left wondering how to fix this. As a workaround, I can change my HOMEBREW_PIP_INDEX_URL to be MIRROR_URL/packages/. This is, of course, not an acceptable PIP_INDEX_URL but it does accidentally work. It feels like there are a few options:
do nothing, update the ENV description to be specific that this should be the mirror prefix for files.pythonhosted.org
deprecate HOMEBREW_PIP_INDEX_URL, add a new environment variable like HOMEBREW_FILES_PYTHONHOSTED_ORG_MIRROR. If it's set, ignore HOMEBREW_PIP_INDEX_URL. If it's not set, keep the current logic of parsing HOMEBREW_PIP_INDEX_URL
fix so HOMEBREW_PIP_INDEX_URL is used in the update-python-resourcesand add a HOMEBREW_FILES_PYTHONHOSTED_ORG_MIRROR.
I want to contribute – but just want to know what is the preferred approach from the brew team
brew cleanup --prune-all # to get a blank cache
brew install ly --build-from-source # could be any Python formula – just needs to include a dependent resource
The text was updated successfully, but these errors were encountered:
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
I'm trying to install Python formulas where they download using my organization's mirror (set via
HOMEBREW_PIP_INDEX_URL
)What happened (include all command output)?
What did you expect to happen?
I expected the mirroring to work correctly and not return a 404 and fallback.
I started digging into this and realized that Homebrew's mirror-handling code assumes that https://pypi.org/ and https://files.pythonhosted.org/ are both mirrored by a single URL and are interchangeable. However, the mirror we use (Artifactory) seems to have logic like:
MIRROR_URL/simple/*
--> equivalent tohttps://pypi.org/simple/*
MIRROR_URL/packages/*
--> equivalent tohttps://files.pythonhosted.org/*
In other words, the rewrite for a file like
https://files.pythonhosted.org/packages/9b/ed/e277509bb9f9376efe391f2f5a27da9840366d12a62bef30f44e5a24e0d9/python-ly-0.9.7.tar.gz
should beOUR-INTERNAL-MIRROR/packges/packages/9b/ed/e277509bb9f9376efe391f2f5a27da9840366d12a62bef30f44e5a24e0d9/python-ly-0.9.7.tar.gz
Note the duplicated/packages
!So, this comes to the problem with
HOMEBREW_PIP_INDEX_URL
. As best I can tell, Homebrew never uses this variable for its intended purpose. Instead it uses this variable to then assume that there is a relationship between thePIP_INDEX_URL
and where packages are hosted... and uses that assumption to incorrectly rewrite URLs.I'm now left wondering how to fix this. As a workaround, I can change my
HOMEBREW_PIP_INDEX_URL
to beMIRROR_URL/packages/
. This is, of course, not an acceptable PIP_INDEX_URL but it does accidentally work. It feels like there are a few options:HOMEBREW_PIP_INDEX_URL
, add a new environment variable likeHOMEBREW_FILES_PYTHONHOSTED_ORG_MIRROR
. If it's set, ignore HOMEBREW_PIP_INDEX_URL. If it's not set, keep the current logic of parsingHOMEBREW_PIP_INDEX_URL
update-python-resources
and add aHOMEBREW_FILES_PYTHONHOSTED_ORG_MIRROR
.I want to contribute – but just want to know what is the preferred approach from the brew team
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: