Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Dec 14, 2023

Homebrew attempts to check for outdated dependents or those with broken linkage. Such behavior might lead to failures when Homebrew updates them on old macOS images. For example, https://github.com/bitcoin/bitcoin/actions/runs/7199058794/job/19609891263 using the macOS image version 20231025.2.

This PR prevents such behavior.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 14, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK maflcko, ismaelsadeeq

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Dec 14, 2023
@ismaelsadeeq
Copy link
Member

utACK f3800ba

@hebasto hebasto marked this pull request as draft December 14, 2023 12:03
Homebrew attempts to check for outdated dependents or those with broken
linkage. Such behavior might lead to failures when Homebrew updates them
on old macOS images.

This change prevents such behavior.
@hebasto hebasto force-pushed the 231214-gha-homebrew branch from f3800ba to 43c3246 Compare December 14, 2023 12:19
@hebasto hebasto changed the title ci: Set HOMEBREW_NO_AUTO_UPDATE to avoid unrelated failures ci: Set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK to avoid unrelated failures Dec 14, 2023
@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

Sorry, HOMEBREW_NO_AUTO_UPDATE has been replaced with HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK, which does fix the issue. See https://github.com/bitcoin/bitcoin/actions/runs/7208749840/job/19638344437.

@hebasto hebasto marked this pull request as ready for review December 14, 2023 12:23
@maflcko
Copy link
Member

maflcko commented Dec 14, 2023

lgtm ACK 43c3246

@ismaelsadeeq
Copy link
Member

re ACK 43c3246

@DrahtBot DrahtBot removed the request for review from ismaelsadeeq December 14, 2023 12:29
@hebasto hebasto merged commit e6dbf48 into bitcoin:master Dec 14, 2023
@fanquake
Copy link
Member

when Homebrew updates them on old macOS images.

Do we use old images?

What other side-effects could this cause due to not updating dependencies, and broken linage/other issues?

@maflcko
Copy link
Member

maflcko commented Dec 14, 2023

when Homebrew updates them on old macOS images.

Do we use old images?

The images are from GHA/Microsoft.

What other side-effects could this cause due to not updating dependencies, and broken linage/other issues?

This also speeds up the build by 5 Minutes.

@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

Do we use old images?

The GHA chooses an image from a set of available images when setting up a new job.

It is not rare case when more than one images are available simultaneously. One of them is older than others.

@fanquake
Copy link
Member

fanquake commented Dec 14, 2023

It is not rare case when more than one images are available simultaneously. One of them is older than others.

What does "older" mean here? Aren't we pinned to a specific version to avoid exactly this issue?

@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

It is not rare case when more than one images are available simultaneously. One of them is older than others.

What does "older" mean here? Aren't we pinned to a specific version to avoid exactly this issue?

For example,

##[group]Operating System
macOS
13.6
22G120
##[endgroup]
##[group]Runner Image
Image: macos-13
Version: 20231025.2
Included Software: https://github.com/actions/runner-images/blob/macos-13/20231025.2/images/macos/macos-13-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231025.2
##[endgroup]

vs

##[group]Operating System
macOS
13.6.1
22G313
##[endgroup]
##[group]Runner Image
Image: macos-13
Version: 20231204.4
Included Software: https://github.com/actions/runner-images/blob/macos-13/20231204.4/images/macos/macos-13-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231204.4
##[endgroup]

We pin only macos-13.

@hebasto hebasto deleted the 231214-gha-homebrew branch December 14, 2023 14:14
@fanquake
Copy link
Member

For example,.
Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231025.2
vs
Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231204.4

I still don't really understand this fix, and assume it could lead to obscure breakage in the future, i.e a missing dep, or a dep trying to use an outdated sub dep. (it also just makes our CI further differ from nomal macOS / dev setups).

I don't really understand how a new image being released, causes failures with the previous image, especially when, the image you're linking to above (20231204), was never even released? See: actions/runner-images#8960

The release was cancelled, the badge was updated incorrectly - we are working to update the status and eliminate the causes of this "event" itself.

It also doesn't appear in https://github.com/actions/runner-images/tree/main/images/macos, so I don't understand how anything could be using this image, or how it's causing failures.

@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

... so I don't understand how anything could be using this image, or how it's causing failures.

This PR does nothing about new 20231204 release, because the failure was caused by the older 20231025 one.

I think that the GHA image release process issues are irrelevant to this PR change.

I still don't really understand this fix, and assume it could lead to obscure breakage in the future, i.e a missing dep, or a dep trying to use an outdated sub dep. (it also just makes our CI further differ from nomal macOS / dev setups).

Our dependencies are installed explicitly. We do not use any of other tools preinstalled via Homebrew. Why should we care about their dependencies?

@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

I still don't really understand this fix

This fix makes Homebrew skip upgrading the aws-sam-cli package that we do not use.

@fanquake
Copy link
Member

We do not use any of other tools preinstalled via Homebrew.

Don't we use at least git, curl and Python? If any those are probably less-prone to breakage.

@hebasto
Copy link
Member Author

hebasto commented Dec 14, 2023

Don't we use at least git, curl and Python?

Right. Here is the brew list -1 command output for the image version 20231025.2:

ant
aom
apr
apr-util
argon2
aria2
aspell
autoconf
aws-sam-cli
azure-cli
bazelisk
berkeley-db
bicep
brotli
c-ares
ca-certificates
cairo
carthage
cffi
cmake
composer
curl
fontconfig
freetds
freetype
gcc
gcc@11
gcc@12
gd
gdbm
geckodriver
gettext
gh
giflib
git
git-lfs
glib
gmp
gnu-tar
gnupg
gnutls
gradle
graphite2
harfbuzz
highway
httpd
icu4c
imath
isl
jpeg-turbo
jpeg-xl
jq
kotlin
krb5
libassuan
libavif
libevent
libgcrypt
libgpg-error
libidn2
libksba
libmpc
libnghttp2
libpng
libpq
libsodium
libssh2
libtasn1
libtiff
libtool
libunistring
libusb
libuv
libvmaf
libx11
libxau
libxcb
libxdmcp
libxext
libxrender
libyaml
libzip
little-cms2
llvm@15
lz4
lzo
m4
maven
mpdecimal
mpfr
nettle
node@18
npth
oniguruma
openblas
openexr
openjdk
openldap
openssl@1.1
openssl@3
p11-kit
p7zip
packer
pcre2
perl
php
pinentry
pipx
pixman
pkg-config
pycparser
pygments
python-argcomplete
python-certifi
python-cryptography
python-packaging
python-pytz
python-setuptools
python-typing-extensions
python@3.10
python@3.11
python@3.12
pyyaml
r
readline
rtmpdump
ruby@3.0
rustup-init
selenium-server
six
sqlite
swiftformat
swiftlint
tcl-tk
tidy-html5
unbound
unixodbc
unxip
webp
wget
xorgproto
xz
yq
zstd
firefox
google-chrome
julia
microsoft-edge
session-manager-plugin

As CI does not suffer from unrelated failures now, there is time to investigate underlying issue more thoroughly and suggest a more robust alternative solution.

@fanquake
Copy link
Member

This, or some other solution will also need to be backported to 26.x. I think a simpler solution would have just been to uninstall aws-sam-cli as the first step. Which should solve the problem, have no other side-effects, and retain the speedup, given it's related to upgrading it's deps.

@maflcko
Copy link
Member

maflcko commented Dec 15, 2023

Won't the other dependencies also be upgraded and thus slow down the CI?

@fanquake
Copy link
Member

I don't know. However If the issue was sub dependencies (Fetching dependencies for aws-sam-cli: python-setuptools, python-attrs, python-dateutil, python-networkx, python-pbr, python-mpmath, python-sympy, python-urllib3, ca-certificates, cfn-lint, pygments, python-click, python-markupsafe, python-jinja, python-certifi, python-charset-normalizer, python-idna, python-requests, cookiecutter and python-cryptography) of something being upgraded (aws-sam-cli), also being upgraded, if (aws-sam-cli) is no-longer installed / being upgraded, I wouldn't think it's dependencies should be either?

@fanquake
Copy link
Member

fanquake commented Dec 15, 2023

This fix makes Homebrew skip upgrading the aws-sam-cli package that we do not use.

Ok the issue here also isn't specifically related to aws-sam-cli, because upgrading any Python will fail, due to symlinks not being able to be written.

@fanquake
Copy link
Member

Looks like ultimately, we can't avoid the failure by removing packages we don't use.

The root cause, is that qt@5 has a dependency on python@3.11, and after we install qt@5, brew will try and upgrade python@3.11, which will then fails:

==> Upgrading python@3.11
  3.11.6 -> 3.11.6_1 

==> Pouring python@3.11--3.11.6_1.ventura.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'
To force the link and overwrite all conflicting files:
  brew link --overwrite python@3.11
To list all files that would be deleted:
  brew link --overwrite --dry-run python@3.11
Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/2to3
/usr/local/bin/2to3-3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/2to3-3.11
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/idle3
/usr/local/bin/idle3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/idle3.11
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/pydoc3
/usr/local/bin/pydoc3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3.11
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.12/bin/python3-config
/usr/local/bin/python3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
/usr/local/bin/python3.11-config -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11-config

fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Dec 15, 2023
Homebrew attempts to check for outdated dependents or those with broken
linkage. Such behavior might lead to failures when Homebrew updates them
on old macOS images.

This change prevents such behavior.

Github-Pull: bitcoin#29080
Rebased-From: 43c3246
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Dec 18, 2023
Homebrew attempts to check for outdated dependents or those with broken
linkage. Such behavior might lead to failures when Homebrew updates them
on old macOS images.

This change prevents such behavior.

Github-Pull: bitcoin#29080
Rebased-From: 43c3246
@fanquake fanquake mentioned this pull request Jan 4, 2024
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Jan 4, 2024
Homebrew attempts to check for outdated dependents or those with broken
linkage. Such behavior might lead to failures when Homebrew updates them
on old macOS images.

This change prevents such behavior.

Github-Pull: bitcoin#29080
Rebased-From: 43c3246
glozow added a commit that referenced this pull request Jan 9, 2024
7b79e54 doc: update release notes for 26.x (fanquake)
ccf00b1 wallet: Fix use-after-free in WalletBatch::EraseRecords (MarcoFalke)
40252e1 ci: Set `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` to avoid failures (Hennadii Stepanov)
b06b14e rpc: getwalletinfo, return wallet 'birthtime' (furszy)
1283401 test: coverage for wallet birth time interaction with -reindex (furszy)
0fa47e2 wallet: fix legacy spkm default birth time (furszy)
84f4a6c wallet: birth time update during tx scanning (furszy)
074296d refactor: rename FirstKeyTimeChanged to MaybeUpdateBirthTime (furszy)
35039ac fuzz: disable BnB when SFFO is enabled (furszy)
903b462 test: add coverage for BnB-SFFO restriction (furszy)
05d0576 wallet: create tx, log resulting coin selection info (furszy)
5493ebb wallet: skip BnB when SFFO is active (Murch)
b15e2e2 test: add regression test for the getrawtransaction segfault (Martin Zumsande)
5097bb3 rpc: fix getrawtransaction segfault (Martin Zumsande)
81e744a ci: Use Ubuntu 24.04 Noble for asan (MarcoFalke)
69e53d1 ci: Use Ubuntu 24.04 Noble for tsan,tidy,fuzz (MarcoFalke)
d2c80b6 doc: Missing additions to 26.0 release notes (fanquake)
8dc2c75 doc: add historical release notes for 26.0 (fanquake)

Pull request description:

  Backports for `26.x`. Currently:
  * #28920
  * #28992
  * #28994
  * #29003
  * #29023
  * #29080
  * #29176

ACKs for top commit:
  TheCharlatan:
    ACK 7b79e54
  glozow:
    ACK 7b79e54, matches mine

Tree-SHA512: 898aec76ed3ad35e0edd0980af5bcc21bd60003bbf69e0b4f473ed2aa38c4e3b360b930bc3747cf798195906a8f9fe66417524f5e5ef40fa68f1c1aaceebdeb0
@bitcoin bitcoin locked and limited conversation to collaborators Dec 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants