Skip to content

When a HEAD build fails, output an instruction to raise PRs not issues#7234

Merged
MikeMcQuaid merged 1 commit intoHomebrew:masterfrom
issyl0:head-builds-arent-officially-supported
Apr 1, 2020
Merged

When a HEAD build fails, output an instruction to raise PRs not issues#7234
MikeMcQuaid merged 1 commit intoHomebrew:masterfrom
issyl0:head-builds-arent-officially-supported

Conversation

@issyl0
Copy link
Copy Markdown
Member

@issyl0 issyl0 commented Mar 28, 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?

- I didn't originally intend to go into too much detail here about raising PRs rather than issues, as it doesn't feel like something people will read, but I couldn't think of a better place to put that extra detail, so here we are.

- If there are better places for this then I'll gladly hear them!

  • This has to be in multiple places, hence a new method. A patch failing
    to apply, which is a common occurrence with HEAD builds because the
    patch is already upstream, raises a different exception to another,
    "normal" build failure.

Tested with:

╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD mtr
==> Cloning https://github.com/traviscross/mtr.git
Updating /home/issyl0/.cache/Homebrew/mtr--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 155f76a Merge pull request #340 from Sea-n/master
==> Downloading traviscross/mtr#315
Already downloaded: /home/issyl0/.cache/Homebrew/downloads/82d9d939303d8fceb7a3ae071ecd49a5f075e0fb451b308653b555ffbae74336--315.patch
==> Patching
==> Applying 315.patch
patching file packet/probe.c
Hunk #1 FAILED at 323.
Hunk #2 FAILED at 364.
2 out of 2 hunks FAILED -- saving rejects to file packet/probe.c.rej
Error: Failure while executing; `patch -g 0 -f -p1 -i /tmp/mtr--patch-20200330-10734-avjmyy/315.patch` exited with 1.
HEAD builds are unsupported by maintainers - please file pull requests instead of issues.

and

╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD zookeeper
==> Cloning https://gitbox.apache.org/repos/asf/zookeeper.git
Updating /home/issyl0/.cache/Homebrew/zookeeper--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 1ff1b779 ZOOKEEPER-3755: Use maven to create fatjar
==> ant compile_jute
Last 15 lines from /home/issyl0/.cache/Homebrew/Logs/zookeeper/01.ant:
2020-03-30 21:45:10 +0100

ant
compile_jute

Picked up _JAVA_OPTIONS: -Duser.home=/home/issyl0/.cache/Homebrew/java_cache
Buildfile: build.xml does not exist!
Build failed

READ THIS: https://docs.brew.sh/Troubleshooting

HEAD builds are unsupported by maintainers - please file pull requests instead of issues.
  • This came about because I feel like I've done a lot of telling people that HEAD builds are unsupported when they raise issues about patches that don't apply, or broken builds.

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • but I couldn't think of a better place to put that extra detail, so here we are.

How about somewhere like:

$stderr.puts "#{Tty.bold}Please report this issue:#{Tty.reset}"
$stderr.puts " #{Formatter.url(OS::ISSUES_URL)}"
or the BuildError handled above? Should be able to special-case the output based on --HEAD.

@issyl0 issyl0 force-pushed the head-builds-arent-officially-supported branch from 772c50b to 02ae57b Compare March 30, 2020 20:50
@issyl0 issyl0 changed the title cmd/install: In --help note that HEAD isn't officially supported When a HEAD build fails, output an instruction to raise PRs not issues Mar 30, 2020
@issyl0
Copy link
Copy Markdown
Member Author

issyl0 commented Mar 30, 2020

Thanks, @MikeMcQuaid! I've done that, accounting for the different exceptions I encountered along the way between patches failing to apply and normal build failures. There's a bit of duplication still... 🤔

Comment thread Library/Homebrew/brew.rb Outdated
Comment thread Library/Homebrew/brew.rb Outdated
Comment thread Library/Homebrew/brew.rb Outdated
- This has to be in multiple places, hence a new method. A patch failing
  to apply, which is a common occurrence with HEAD builds because the
  patch is already upstream, raises a different exception to another,
  "normal" build failure.

Tested with:

```
╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD mtr
==> Cloning https://github.com/traviscross/mtr.git
Updating /home/issyl0/.cache/Homebrew/mtr--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 155f76a Merge pull request #340 from Sea-n/master
==> Downloading traviscross/mtr#315
Already downloaded: /home/issyl0/.cache/Homebrew/downloads/82d9d939303d8fceb7a3ae071ecd49a5f075e0fb451b308653b555ffbae74336--315.patch
==> Patching
==> Applying 315.patch
patching file packet/probe.c
Hunk #1 FAILED at 323.
Hunk #2 FAILED at 364.
2 out of 2 hunks FAILED -- saving rejects to file packet/probe.c.rej
Error: Failure while executing; `patch -g 0 -f -p1 -i /tmp/mtr--patch-20200330-10734-avjmyy/315.patch` exited with 1.
HEAD builds are unsupported by maintainers - please file pull requests instead of issues.
```

and

```
╭─issyl0@rigel /home/linuxbrew/.linuxbrew/Homebrew ‹head-builds-arent-officially-supported*›
╰─ $ brew install --HEAD zookeeper
==> Cloning https://gitbox.apache.org/repos/asf/zookeeper.git
Updating /home/issyl0/.cache/Homebrew/zookeeper--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 1ff1b779 ZOOKEEPER-3755: Use maven to create fatjar
==> ant compile_jute
Last 15 lines from /home/issyl0/.cache/Homebrew/Logs/zookeeper/01.ant:
2020-03-30 21:45:10 +0100

ant
compile_jute

Picked up _JAVA_OPTIONS: -Duser.home=/home/issyl0/.cache/Homebrew/java_cache
Buildfile: build.xml does not exist!
Build failed

READ THIS: https://docs.brew.sh/Troubleshooting

HEAD builds are unsupported by maintainers - please file pull requests instead of issues.
```
@issyl0 issyl0 force-pushed the head-builds-arent-officially-supported branch from b5f15e1 to 7605924 Compare March 31, 2020 13:49
@MikeMcQuaid MikeMcQuaid merged commit 8d3aa49 into Homebrew:master Apr 1, 2020
@MikeMcQuaid
Copy link
Copy Markdown
Member

Thanks again @issyl0!

@issyl0 issyl0 deleted the head-builds-arent-officially-supported branch April 4, 2020 21:03
@lock lock bot added the outdated PR was locked due to age label May 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 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.

3 participants