First time contributing to Homebrew? Read our Code of Conduct.
Ensure your commits follow the commit style guide.
Thanks for contributing!
brew update
(twice)brew doctor
foo
formulafoo
.brew bump-formula-pr --strict foo
with one of the following:
--url=...
and --sha256=...
--tag=...
and --revision=...
--version=...
foo
version 2.3.4
from $URL
brew create $URL
and make editsbrew install --build-from-source foo
brew audit --new-formula foo
git commit
with message formatted foo 2.3.4 (new formula)
Once you've addressed any potential feedback and a member of the Homebrew org has approved your pull request, the BrewTestBot will automatically merge it a couple of minutes later.
foo
formulaIf you are already well versed in the use of git
, then you can find the local
copy of the homebrew-core
repository in this directory:
$(brew --repository homebrew/core)
. Modify the formula there using brew edit foo
leaving the section bottle do ... end
unchanged, and prepare a pull request
as you usually do. Before submitting your pull request, be sure to test it
with these commands:
brew uninstall --force foo
brew install --build-from-source foo
brew test foo
brew audit --strict foo
brew style foo
After testing, if you think it is needed to force the corresponding bottles to be
rebuilt and redistributed, add a line of the form revision 1
to the formula,
or add 1 to the revision number already present.
If you are not already well versed in the use of git
, then you may learn
about it from the introduction at
https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request and then proceed as
follows:
brew edit foo
and make editsbottle do ... end
unchangedgit commit
with message formatted foo <insert new version number>
or foo: <insert details>
Once you've addressed any potential feedback and a member of the Homebrew org has approved your pull request, the BrewTestBot will automatically merge it a couple of minutes later.
Pull requests with failing CI should not be merged, so the failures will need to be fixed. Start by looking for errors in the CI log. Some errors will show up as annotations in the "Files changed" tab of your pull request. If there are no annotations, or the annotations do not contain the relevant errors, then the complete build log can be found in the "Checks" tab of your pull request.
Once you've identified the error(s), check whether you can reproduce them locally. You should be able to do this with one or more of brew install --build-from-source
, brew audit --strict --online
, and brew test
. Don't forget to checkout your PR branch before trying this! If you can reproduce the failure(s), then it is likely that the formula needs to be fixed. Read the error messages carefully. Many errors provide hints on how to fix them. Failing that: looking up the error message is often a fruitful source of hints for what to do next.
If you can't reproduce an error, then you need to identify what makes your local environment different from the build environment in CI. It is likely that one of those differences is driving the CI failure. It may help to try to make your local environment as similar to CI as possible to try to reproduce the failure. If the CI failure occurs on Linux, you can use the Homebrew Docker container to emulate the CI environment. See the next section for a guide on how to do this.
If you're still stuck: don't fret. Leave a comment on your PR describing what you've done to try to diagnose and fix the CI failure and we'll do our best to help you resolve them.
Linux CI runs on a Docker container running Ubuntu 16.04. If you have Docker installed, you can use our container with:
docker run --interactive --tty --rm --pull always homebrew/ubuntu16.04:latest /bin/bash
If you don't have Docker installed:
brew install --formula docker lima
limactl start template://docker
docker context create lima --docker "host=unix://${HOME}/.lima/docker/sock/docker.sock"
docker context use lima
You should now be able to run the docker
command shown above.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。