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

Upgrade of rsyslog with build-from-source fails if there is an existing config file #177546

Closed
4 tasks done
logopk opened this issue Jul 16, 2024 · 4 comments · Fixed by #178928
Closed
4 tasks done

Upgrade of rsyslog with build-from-source fails if there is an existing config file #177546

logopk opened this issue Jul 16, 2024 · 4 comments · Fixed by #178928
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@logopk
Copy link
Contributor

logopk commented Jul 16, 2024

brew gist-logs <formula> link OR brew config AND brew doctor output

▶ brew config           
HOMEBREW_VERSION: 4.3.9-267-gdf27448
ORIGIN: https://github.com/Homebrew/brew
HEAD: df27448ea7f92a9f46a5b59b368c3f4b147df6fa
Last commit: 16 hours ago
Core tap HEAD: f148630ef831f3cbece5b01eb584f5431889c3ce
Core tap last commit: 15 hours ago
Core tap JSON: 16 Jul 06:01 UTC
Core cask tap JSON: 16 Jul 06:01 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false

▶ brew doctor
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: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  [email protected]

Warning: You have the following deprecated, official taps tapped:
  Homebrew/homebrew-cask-versions
Untap them with `brew untap`.

Warning: Putting non-prefixed coreutils in your path can cause GMP builds to fail.

Warning: You have uncommitted modifications to Homebrew/homebrew-core.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /opt/homebrew/Library/Taps/homebrew/homebrew-core && git stash -u && git clean -d -f

Uncommitted files:
   M Formula/c/curl.rb
   M Formula/k/kubernetes-cli.rb

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo logo/local-compose) checkout

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

brew reinstall --build-from-source rsyslog

What happened (include all command output)?

==> Installing rsyslog
==> ./configure --enable-imfile --enable-usertools --enable-diagtools --disable-

==> make
==> make install
Error: An exception occurred within a child process:
RuntimeError: Will not overwrite /opt/homebrew/etc/rsyslog.conf

What did you expect to happen?

skip

    (etc/"rsyslog.conf").write <<~EOS
      # minimal config file for receiving logs over UDP port 10514
      $ModLoad imudp
      $UDPServerRun 10514
      *.* /usr/local/var/log/rsyslog-remote.log
    EOS

as there is already a more sophisticated conf file.

I know build-from-source is unsupported but is there a way to update the formula to skip this message?

Step-by-step reproduction instructions (by running brew commands)

brew update

brew upgrade --build-from-source rsyslog

I could fix this with 

brew upgrade --verbose --debug rsyslog
and option 2) ignore

but that ist tiresome
@logopk logopk added the bug Reproducible Homebrew/homebrew-core bug label Jul 16, 2024
@cho-m
Copy link
Member

cho-m commented Jul 18, 2024

Might be an issue due to using .write rather than special etc.install logic (which would create/modify rsyslog.conf.default if rsyslog.conf already exists).

Using a temporary file may help like in percona-server:

(buildpath/"my.cnf").write <<~EOS
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
EOS
etc.install "my.cnf"

@logopk
Copy link
Contributor Author

logopk commented Jul 29, 2024

Hi, is there anyone in charge of this formula who would be able to fix this? Would it be sufficient for me to post a PR?

I've never mad a PR besides a bump...

@branchvincent
Copy link
Member

#178928 will fix this

@logopk
Copy link
Contributor Author

logopk commented Aug 1, 2024

@branchvincent Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@logopk @branchvincent @cho-m and others