2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 18:08:16 +00:00

[#3867] Hammer: Pin Meson version to 1.8.1

This commit is contained in:
Andrei Pavel 2025-06-02 16:01:09 +03:00
parent 2e66702e1b
commit 7538e92655
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
3 changed files with 26 additions and 37 deletions

View File

@ -107,21 +107,6 @@ operating system, without the build:
This way, a system can be prepared for our own use. This way, a system can be prepared for our own use.
.. note::
Currently, when this command is run, the latest version of Meson is installed.
This is because, at the time of writing, three different bugs that affect
building Kea with Meson in different processes were fixed in the latest
version, but not in any released version as of yet:
- https://github.com/mesonbuild/meson/issues/11322
- https://github.com/mesonbuild/meson/issues/14412
- https://github.com/mesonbuild/meson/issues/14470
Maintenance Meson release 1.7.2 contains two of the fixes, but arguably, not
the most impactful of them. When Meson 1.8.0 is released, Hammer will bind to
that version.
To prepare such a system using SSH, invoke: To prepare such a system using SSH, invoke:
.. code-block:: console .. code-block:: console

View File

@ -476,6 +476,8 @@ def install_meson(python_v: str = 'python3', mode: str = 'pyinstaller'):
:type mode: str :type mode: str
""" """
meson_version = '1.8.1'
exit_code = execute('meson --version', quiet=True, raise_error=False) exit_code = execute('meson --version', quiet=True, raise_error=False)
if exit_code == 0: if exit_code == 0:
return return
@ -485,10 +487,7 @@ def install_meson(python_v: str = 'python3', mode: str = 'pyinstaller'):
execute('sudo /usr/local/share/.venv/bin/pip install ninja') execute('sudo /usr/local/share/.venv/bin/pip install ninja')
if mode == 'pyinstaller': if mode == 'pyinstaller':
execute('git clone https://github.com/mesonbuild/meson .meson-src') execute('git clone https://github.com/mesonbuild/meson .meson-src')
# TODO: always checkout when 1.8.0 gets released. execute(f'git checkout {meson_version}', cwd='.meson-src')
_, output = execute('git tag -l', cwd='.meson-src', capture=True, quiet=True)
if '1.8.0' in output.splitlines():
execute('git checkout 1.8.0', cwd='.meson-src')
execute('sudo /usr/local/share/.venv/bin/pip install pyinstaller') execute('sudo /usr/local/share/.venv/bin/pip install pyinstaller')
execute('sudo /usr/local/share/.venv/bin/pyinstaller --additional-hooks-dir=packaging --clean ' execute('sudo /usr/local/share/.venv/bin/pyinstaller --additional-hooks-dir=packaging --clean '
'--dist ../.meson --onefile ./meson.py', '--dist ../.meson --onefile ./meson.py',
@ -497,9 +496,7 @@ def install_meson(python_v: str = 'python3', mode: str = 'pyinstaller'):
execute('sudo cp /usr/local/share/.venv/bin/ninja /usr/local/bin') execute('sudo cp /usr/local/share/.venv/bin/ninja /usr/local/bin')
elif mode == 'venv': elif mode == 'venv':
# TODO: change to this when 1.8.0 gets released. execute(f'sudo /usr/local/share/.venv/bin/pip install meson=={meson_version}')
# execute('/usr/local/share/.venv/bin/pip install meson==1.8.0')
execute('sudo /usr/local/share/.venv/bin/pip install git+https://github.com/mesonbuild/meson.git')
execute('sudo ln -s /usr/local/share/.venv/bin/meson /usr/local/bin/meson') execute('sudo ln -s /usr/local/share/.venv/bin/meson /usr/local/bin/meson')
execute('sudo ln -s /usr/local/share/.venv/bin/ninja /usr/local/bin/ninja') execute('sudo ln -s /usr/local/share/.venv/bin/ninja /usr/local/bin/ninja')
else: else:

View File

@ -8,6 +8,8 @@
set -eu set -eu
meson_version=1.8.1
# Check if ${1} <= ${2}. # Check if ${1} <= ${2}.
le() { le() {
# Sort numerically and check the first item. # Sort numerically and check the first item.
@ -27,17 +29,19 @@ print_usage() {
'Usage: %s {{options}} 'Usage: %s {{options}}
Options: Options:
[-i|--install] install meson and ninja to gobal scope. attempts to acquire root privileges [-i|--install] install meson and ninja to gobal scope. attempts to acquire root privileges
[-p|--venv] use venv instead of pyinstaller [-l|--latest] use latest meson instead of %s
[-v|--venv] use venv instead of pyinstaller
[-h|--help] print usage (this text) [-h|--help] print usage (this text)
' \ ' \
"$(basename "${0}")" "$(basename "${0}")" "${meson_version}"
} }
# Parse parameters. # Parse parameters.
while test ${#} -gt 0; do while test ${#} -gt 0; do
case "${1}" in case "${1}" in
'-i'|'--install') install=true ;; '-i'|'--install') install=true ;;
'-p'|'--venv') use_venv=true ;; '-l'|'--latest') latest=true ;;
'-v'|'--venv') use_venv=true ;;
'-h'|'--help') print_usage; exit 0 ;; '-h'|'--help') print_usage; exit 0 ;;
*) break ;; *) break ;;
esac; shift esac; shift
@ -45,6 +49,7 @@ done
# Default parameters # Default parameters
test -z "${install+x}" && install=false test -z "${install+x}" && install=false
test -z "${latest+x}" && latest=false
test -z "${use_venv+x}" && use_venv=false test -z "${use_venv+x}" && use_venv=false
if "${install}" && "${use_venv}"; then if "${install}" && "${use_venv}"; then
@ -59,8 +64,8 @@ fi
top_level=$(cd "$(dirname "${0}")" && pwd) top_level=$(cd "$(dirname "${0}")" && pwd)
cd "${top_level}" || exit 1 cd "${top_level}" || exit 1
if command -v meson > /dev/null 2>&1 && le 1.8.0 "$(meson --version)"; then if command -v meson > /dev/null 2>&1 && ! "${latest}" && le "${meson_version}" "$(meson --version)"; then
# Good to be used. Does not suffer from endless transitional dependency iteration. # Good to be used. Does not suffer from endless transitional dependency iteration fixed in 1.8.0.
meson='meson' meson='meson'
else else
meson='.meson/meson' meson='.meson/meson'
@ -90,21 +95,22 @@ else
${sudo} cp "${venv}/bin/ninja" .meson/ninja ${sudo} cp "${venv}/bin/ninja" .meson/ninja
if "${use_venv}"; then if "${use_venv}"; then
# TODO: change to this when 1.8.0 gets released. if "${latest}"; then
# ${sudo} "${venv}/bin/pip" install meson==1.8.0
${sudo} "${venv}/bin/pip" install git+https://github.com/mesonbuild/meson.git ${sudo} "${venv}/bin/pip" install git+https://github.com/mesonbuild/meson.git
else
${sudo} "${venv}/bin/pip" install "meson==${meson_version}"
fi
${sudo} cp "${venv}/bin/meson" .meson/meson ${sudo} cp "${venv}/bin/meson" .meson/meson
else else
if test ! -d .meson-src; then if test ! -d .meson-src; then
git clone https://github.com/mesonbuild/meson .meson-src git clone https://github.com/mesonbuild/meson .meson-src
fi fi
if ! "${latest}"; then
( (
cd .meson-src || exit 1 cd .meson-src || exit 1
# TODO: always checkout when 1.8.0 gets released. git checkout "${meson_version}"
if git tag -l | grep -E '^1.8.0$' > /dev/null 2>&1; then
git checkout 1.8.0
fi
) )
fi
${sudo} "${venv}/bin/pip" install pyinstaller ${sudo} "${venv}/bin/pip" install pyinstaller
( (
cd .meson-src || exit 1 cd .meson-src || exit 1
@ -118,6 +124,7 @@ fi
if "${install}"; then if "${install}"; then
sudo cp .meson/meson /usr/local/bin/meson sudo cp .meson/meson /usr/local/bin/meson
sudo cp .meson/ninja /usr/local/bin/ninja sudo cp .meson/ninja /usr/local/bin/ninja
rm -fr .meson
exit 0 exit 0
fi fi