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

Warnings/errors from "brew edit" commands being routed to standard output. #9874

Closed
6 of 14 tasks
btb opened this issue May 17, 2024 · 2 comments
Closed
6 of 14 tasks

Comments

@btb
Copy link

btb commented May 17, 2024

Description

This unusual routing prevents the normal output from being captured in a variable and used.

I see the problem doesn't occur on the macos-11 runner, but it does occur on every other macos runner I tried.
I see that the version of homebrew is older on the macos-11 runner (4.2.5) whereas the other runners use homebrew 4.3.0. But I don't think this is the whole problem, since I cannot reproduce this problem on my own machine running macos 14 and homebrew 4.3.0.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

20240514.3

Is it regression?

yes

Expected behavior

When using a command brew edit --print-path [formula] the result should be printed on stdout, allowing you to capture the output for use in other commands. Any warnings should be printed on stderr.

    sdl_image_formula=$(brew edit --print-path sdl_image)
    echo sdl_image_formula: $sdl_image_formula

should result in something like:

Warning: edit is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Warning: `brew install` ignores locally edited casks and formulae if
HOMEBREW_NO_INSTALL_FROM_API is not set.
sdl_image_formula: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/s/sdl_image.rb

where you see the errors/warnings as the command is run, then you see the captured formula path afterward.

Here's a run showing that it used to work in macos-14-arm64:
https://github.com/btb/d2x/actions/runs/8953473131/job/24592024810

Here's a run showing it still works normally using the macos-11 runner: https://github.com/btb/d2x/actions/runs/9121219819/job/25080022032

Actual behavior

The warnings/errors are somehow being routed to the standard output, so they are improperly captured in the variable.

    sdl_image_formula=$(brew edit --print-path sdl_image)
    echo sdl_image_formula: $sdl_image_formula

results in:

Warning: edit is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Warning: `brew install` ignores locally edited casks and formulae if
HOMEBREW_NO_INSTALL_FROM_API is not set.
sdl_image_formula: ::warning::`brew install` ignores locally edited casks and formulae if%0AHOMEBREW_NO_INSTALL_FROM_API is not set.%0A /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/s/sdl_image.rb

Here's the run where it stopped working in macos-14-amd64: https://github.com/btb/d2x/actions/runs/9120125848/job/25077018332

Repro steps

Run the 'brew edit' command in a "run" shell, and capture its output to a variable
.

@erik-bershel
Copy link
Contributor

Hey @btb!

Good first issue. I cannot reproduce faulty behaviour on my macOS-14 too. Seems to be the real case. We'll check what might be done to resolve it.

btb added a commit to btb/d2x that referenced this issue May 17, 2024
"brew edit --print-path" is currently broken on other runners

actions/runner-images#9874
@sergei-pyshnoi
Copy link
Contributor

Hello @btb . After investigation we found that problem could be in new runner version. Behavior also reproducible using self-hosted runner on local MacOS machine , so unfortunately we cannot do nothing from our side with it. You can create issue in runner repo for fixing it in a future. As workaround you can enable brew developer mode and set HOMEBREW_NO_INSTALL_FROM_API variable in runtime for avoiding warnings. I am closing issue but you if you have additional questions feel free to reach me out.

@sergei-pyshnoi sergei-pyshnoi closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants