# HG changeset patch # User Raphaël Gomès # Date 1732114399 -3600 # Node ID 51a350a22d0c8f8c85801d1782fd08f953676e1a # Parent 65d516db7309848a472bc236409460eae8922cdb# Parent 854e2b9bca57ff6aedb98e38d6992c8bc3118338 branching: merge stable into default diff -r 65d516db7309 -r 51a350a22d0c .hgsigs --- a/.hgsigs Thu Nov 14 16:45:23 2024 +0100 +++ b/.hgsigs Wed Nov 20 15:53:19 2024 +0100 @@ -268,3 +268,4 @@ eae3ec345e5e62e653de32a87a70f6fa7241afde 0 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 diff -r 65d516db7309 -r 51a350a22d0c .hgtags --- a/.hgtags Thu Nov 14 16:45:23 2024 +0100 +++ b/.hgtags Wed Nov 20 15:53:19 2024 +0100 @@ -284,3 +284,4 @@ eae3ec345e5e62e653de32a87a70f6fa7241afde 6.8.2 dc97e8670decc9925c2f570bdca636778184b199 6.9rc0 31d45a1cbc479ac73fc8b355abe99e090eb6c747 6.9rc1 +b267c5764cc6b804c619a42067405f27e8705beb 6.9 diff -r 65d516db7309 -r 51a350a22d0c Makefile --- a/Makefile Thu Nov 14 16:45:23 2024 +0100 +++ b/Makefile Wed Nov 20 15:53:19 2024 +0100 @@ -226,12 +226,14 @@ fedora \ linux-wheels \ linux-wheels-x86_64 \ + linux-wheels-x86_64-musl \ linux-wheels-i686 \ + linux-wheels-i686-musl \ ppa # Forward packaging targets for convenience. $(packaging_targets): - $(MAKE) -C contrib/packaging $@ + $(MAKE) -C contrib/packaging $(MAKEFLAGS) $@ osx: rm -rf build/mercurial diff -r 65d516db7309 -r 51a350a22d0c contrib/heptapod-ci.yml --- a/contrib/heptapod-ci.yml Thu Nov 14 16:45:23 2024 +0100 +++ b/contrib/heptapod-ci.yml Wed Nov 20 15:53:19 2024 +0100 @@ -20,6 +20,7 @@ when: always stages: + - nightly-trigger - build - checks - tests @@ -31,6 +32,14 @@ image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG variables: + # to debug use: + # + # RE_BRANCH: '/^topic/.+/.+$/' + # RE_TOPIC: '/^xxx/' + # + # Instead of the two following lines: + RE_BRANCH: '/^branch/.+$/' + RE_TOPIC: '/^topic/.+/.+$/' PYTHON: python HG_CI_IMAGE_TAG: "v2.1" # a directory dedicated to creating files and temporary clone @@ -48,6 +57,17 @@ # starting. needs: [] +# dummy job that serve dependencies purpose +.dummy: + # smallest I know of + image: busybox + variables: + GIT_STRATEGY: none + CI_CLEVER_CLOUD_FLAVOR: "XS" + script: + - echo 'nothing to see here' + + # a dummy job that only serve to trigger others # # This is useful for two reasons: @@ -55,15 +75,21 @@ # - manual starting job cannot make the pipeline "fails" and block a merge, # while "on_success" job depending on manual trigger works fine in that regard. .trigger: - extends: .all - # smallest I know of - image: busybox + extends: + - .all + - .dummy when: manual - variables: - GIT_STRATEGY: none - CI_CLEVER_CLOUD_FLAVOR: "XS" - script: - - echo 'nothing to see here' + + +trigger-nightly-build: + extends: .trigger + stage: nightly-trigger + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: manual + allow_failure: true + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: never .build-wheel: extends: .all @@ -86,6 +112,8 @@ - wheels/ expire_in: 1 week + +# build linux wheel for amd64 build-c-wheel: extends: .build-wheel variables: @@ -100,6 +128,115 @@ - cp312-cp312 - cp313-cp313 +trigger-wheel-musl: + extends: .trigger + stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true + +build-c-wheel-musl: + extends: build-c-wheel + image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0" + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-musl" + +trigger-wheel-i686: + extends: .trigger + stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true + +build-c-wheel-i686: + extends: build-c-wheel + image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0" + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-i686" + +trigger-wheel-i686-musl: + extends: .trigger + stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true + +build-c-wheel-i686-musl: + extends: build-c-wheel + image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0" + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-i686-musl" + +trigger-wheel-arm64: + extends: .trigger + stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true + +build-c-wheel-arm64: + extends: build-c-wheel + image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-c:v3.0" + tags: + - arm64 + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-arm64" + +trigger-wheel-arm64-musl: + extends: .trigger + stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true + +build-c-wheel-arm64-musl: + extends: build-c-wheel + image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-musl-c:v3.0" + tags: + - arm64 + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-arm64-musl" + .runtests: extends: .all stage: tests @@ -225,12 +362,18 @@ trigger-pycompat: extends: .trigger stage: py-version-compat + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: on_success + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true .test-c-pycompat: extends: .test-c stage: py-version-compat - needs: - - trigger-pycompat variables: WHEEL_TYPE: "c" @@ -242,6 +385,7 @@ variables: PYTHON: python3.8 needs: + - job: trigger-pycompat - job: build-c-wheel parallel: matrix: @@ -252,6 +396,7 @@ variables: PYTHON: python3.12 needs: + - job: trigger-pycompat - job: build-c-wheel parallel: matrix: @@ -270,6 +415,7 @@ variables: PYTHON: python3.13 needs: + - job: trigger-pycompat - job: build-c-wheel parallel: matrix: @@ -319,6 +465,12 @@ trigger-wheel-windows: extends: .trigger stage: build + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + when: never + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual + allow_failure: true build-c-wheel-windows: extends: .windows @@ -326,7 +478,13 @@ # wait for someone to click on "trigger-wheel-windows" when: on_success needs: - - "trigger-wheel-windows" + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + needs: + - "trigger-wheel-windows" variables: MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" script: @@ -444,7 +602,13 @@ # The weird directory structure match the one we use for Linux to deal with the # multiple jobs. (all this might be unnecessary) build-c-wheel-macos: - when: manual # avoid overloading the CI by default + rules: + - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH + needs: + - trigger-nightly-build + - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC + when: manual # avoid overloading the CI by default + allow_failure: true stage: build tags: - macos @@ -464,6 +628,74 @@ - wheels expire_in: 1 week + +.nightly_build_step: + extends: .all + stage: upload + rules: + - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH' + # note that at the time of writing this, this job depends on multiple + # manual one. So it will not run by default, but will automatically run + # if the manual jobs are triggered. + # + # Also beware that "on_success" will ignore failure of manual test we + # directly depends on. This currently relevant for the "test-3.x-c" + # tests. + when: on_success + - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC' + when: never + +# a dummy job that gather greatly parallel object into one. +# +# It exists because gitlab-ci has a "50 jobs" limit on "needs" entries. +# (yes, this is sad) +# +.sink: + extends: + - .nightly_build_step + - .dummy + +test-result-linux: + extends: .sink + needs: + - test-c + - test-3.8-c + - test-3.12-c + - test-3.13-c + +test-result-macos: + extends: .sink + needs: + - macos + +test-result-windows: + extends: .sink + needs: + - windows + +wheel-result-linux: + extends: .sink + needs: + - build-c-wheel + - build-c-wheel-musl + - build-c-wheel-i686 + - build-c-wheel-i686-musl + - build-c-wheel-arm64 + - build-c-wheel-arm64-musl + artifacts: + paths: + - wheels + expire_in: 1 week + +wheel-result-windows: + extends: .sink + needs: + - build-c-wheel-windows + artifacts: + paths: + - wheels + expire_in: 1 week + # Upload nightly build wheel on the heptapod registry on test success # # At the time this task is added, since the mac wheels are built on shell @@ -474,38 +706,17 @@ # have to prevent the CI token to upload to the registry and have dedicated # credential accessible only from protected branches. upload-wheel-nightly: - extends: .all + extends: .nightly_build_step image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0" - stage: upload # because we don't want to upload only half of a wheel interruptible: false - rules: - - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ - # note that at the time of writing this, this job depends on multiple - # manual one. So it will not run by default, but will automatically run - # if the manual jobs are triggered. - # - # Also beware that "on_success" will ignore failure of manual test we - # directly depends on. This currently relevant for the "test-3.x-c" - # tests. - when: on_success - - if: $CI_COMMIT_BRANCH =~ /^topic\/.*/ - when: never - # if you need to test this, make it - # when: manual - # allow_failure: true needs: - - build-c-wheel + - wheel-result-linux + - wheel-result-windows - build-c-wheel-macos - - build-c-wheel-windows - - test-c - - macos - # if we also requires windows to be happy, reach the "50 needed jobs" limit. - # So we need some intermediate job to reduce the number. - # - windows - - test-3.8-c - - test-3.12-c - - test-3.13-c + - test-result-linux + - test-result-macos + - test-result-windows # It would be nice to be able to restrict that a bit to protected branch only variables: TWINE_USERNAME: gitlab-ci-token diff -r 65d516db7309 -r 51a350a22d0c contrib/install-windows-dependencies.ps1 --- a/contrib/install-windows-dependencies.ps1 Thu Nov 14 16:45:23 2024 +0100 +++ b/contrib/install-windows-dependencies.ps1 Wed Nov 20 15:53:19 2024 +0100 @@ -183,7 +183,7 @@ Install-Python3 "Python 3.13 64-bit" ${prefix}\assets\python313-x64.exe ${prefix}\python313-x64 ${pip} Write-Output "installing Visual Studio 2017 Build Tools and SDKs" - Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140" + Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64" Write-Output "installing PyOxidizer" Invoke-Process msiexec.exe "/i ${prefix}\assets\PyOxidizer.msi /l* ${prefix}\assets\PyOxidizer.log /quiet" diff -r 65d516db7309 -r 51a350a22d0c contrib/packaging/Makefile --- a/contrib/packaging/Makefile Thu Nov 14 16:45:23 2024 +0100 +++ b/contrib/packaging/Makefile Wed Nov 20 15:53:19 2024 +0100 @@ -45,8 +45,10 @@ @echo 'linux-wheels' @echo ' Build Linux manylinux wheels using Docker.' @echo '' - @echo 'linux-wheels-{x86_64, i686}' + @echo 'linux-wheels-{x86_64, i686}{,-musl}' @echo ' Build Linux manylinux wheels for a specific architecture using Docker' + @echo ' The -musl variants is suitable for system using "musl" instead of "glibc", + @echo ' for example: Alpine linux.' @echo '' @echo 'deb' @echo ' Build a Debian package locally targeting the current system' @@ -125,12 +127,24 @@ $(foreach release,$(RHEL_RELEASES),$(eval $(call rhel_targets,$(release)))) .PHONY: linux-wheels -linux-wheels: linux-wheels-x86_64 linux-wheels-i686 +linux-wheels: linux-wheels-x86_64 linux-wheels-x86_64-musl linux-wheels-i686 linux-wheels-i686-musl + +img_reg="registry.heptapod.net/mercurial/ci-images" +img_tag="v3.0" +whl_sh="/src/contrib/packaging/build-linux-wheels.sh" .PHONY: linux-wheels-x86_64 linux-wheels-x86_64: - docker run --rm -ti -v `pwd`/../..:/src registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0 /src/contrib/packaging/build-linux-wheels.sh + docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-x86_64-c:$(img_tag) $(whl_sh) + +.PHONY: linux-wheels-x86_64-musl +linux-wheels-x86_64-musl: + docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-x86_64-musl-c:$(img_tag) $(whl_sh) .PHONY: linux-wheels-i686 linux-wheels-i686: - docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`/../..:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/packaging/build-linux-wheels.sh + docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-i686-c:$(img_tag) $(whl_sh) + +.PHONY: linux-wheels-i686-musl +linux-wheels-i686-musl: + docker run --rm -ti -v `pwd`/../..:/src $(img_reg)/core-wheel-i686-musl-c:$(img_tag) $(whl_sh) diff -r 65d516db7309 -r 51a350a22d0c contrib/packaging/build-linux-wheels.sh --- a/contrib/packaging/build-linux-wheels.sh Thu Nov 14 16:45:23 2024 +0100 +++ b/contrib/packaging/build-linux-wheels.sh Wed Nov 20 15:53:19 2024 +0100 @@ -20,14 +20,17 @@ # therefor not compatible. cp -r /src/ /tmp/src/ cd /tmp/src/ -hg purge --all --no-confirm +# clear potentially cached artifact from the host +# (we could narrow this purge probably) +hg purge \ + --ignored \ + --no-confirm -export HGRCPATH=/tmp/build-config.rc -cat << EOF > $HGRCPATH -[trusted] -users=* -groups=* -EOF + +if [ ! -e /src/dist/ ]; then + mkdir -p /src/dist + chown `stat /src/ -c %u:%g` /src/dist/ +fi for py in $PYTHON_TARGETS; do echo 'build wheel for' $py @@ -39,6 +42,6 @@ contrib/build-one-linux-wheel.sh $py $tmp_wd # fix the owner back to the repository owner chown `stat /src/ -c %u:%g` $tmp_wd/*.whl - mv $tmp_wd/*.whl /src/dist + mv $tmp_wd/*.whl /src/dist/ done diff -r 65d516db7309 -r 51a350a22d0c contrib/packaging/build-macos-wheels.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/packaging/build-macos-wheels.sh Wed Nov 20 15:53:19 2024 +0100 @@ -0,0 +1,35 @@ +#!/bin/sh + +# This is a convenience script to build all of the wheels outside of the CI +# system. It requires the cibuildwheel package to be installed, and the +# executable on PATH, as well as `msgfmt` from gettext, which can be installed +# with `brew` as follows: +# +# $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +# $ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile +# +# $ brew install gettext +# +# A system-wide installation of the version of python corresponding to each +# wheel is required. They can be installed by this script by setting `CI=true` +# in the environment before running it, and providing the `sudo` password when +# prompted. + +set -e + +# Build translations; requires msgfmt on PATH. +export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1 + +if ! which msgfmt 2>/dev/null 1>/dev/null; then + echo "msgfmt executable not found" >&2 + exit 1 +fi + +# Prevent building pypy wheels, which is broken. +export CIBW_SKIP=pp* + +export CIBW_ARCHS=universal2 + +# TODO: purge the repo? + +cibuildwheel --output-dir dist/wheels diff -r 65d516db7309 -r 51a350a22d0c contrib/packaging/build-windows-wheels.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/packaging/build-windows-wheels.bat Wed Nov 20 15:53:19 2024 +0100 @@ -0,0 +1,37 @@ +@echo off + +REM - This is a convenience script to build all of the wheels outside of the CI +REM - system. It requires the cibuildwheel package to be installed, and the +REM - executable on PATH, as well as `msgfmt.exe` from gettext and the x86, +REM - amd64, and arm64 compilers from VS BuildTools. These can be obtained by +REM - running `contrib/install-windows-dependencies.ps1`. + +REM - None of the variable set here live past this script exiting. +setlocal + +REM - Build translations; requires msgfmt.exe on PATH. +set MERCURIAL_SETUP_FORCE_TRANSLATIONS=1 + +REM - Prevent building pypy wheels, which is broken. +set CIBW_SKIP=pp* + +REM - Disable warning about not being able to test without an arm64 runner. +set CIBW_TEST_SKIP=*-win_arm64 + + +REM - arm64 support starts with py39, but the first arm64 installer wasn't +REM - available until py311, so skip arm64 on the older, EOL versions. +set CIBW_ARCHS=x86 AMD64 +set CIBW_BUILD=cp38-* cp39-* cp310-* + +cibuildwheel --output-dir dist/wheels + +if %errorlevel% neq 0 exit /b %errorlevel% + + +set CIBW_ARCHS=x86 AMD64 ARM64 +set CIBW_BUILD=cp311-* cp312-* cp313-* + +cibuildwheel --output-dir dist/wheels + +if %errorlevel% neq 0 exit /b %errorlevel% diff -r 65d516db7309 -r 51a350a22d0c contrib/packaging/linux-wheel-centos5-blacklist --- a/contrib/packaging/linux-wheel-centos5-blacklist Thu Nov 14 16:45:23 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -test-convert-git.t -test-subrepo-git.t -test-patchbomb-tls.t diff -r 65d516db7309 -r 51a350a22d0c mercurial/helptext/rust.txt --- a/mercurial/helptext/rust.txt Thu Nov 14 16:45:23 2024 +0100 +++ b/mercurial/helptext/rust.txt Wed Nov 20 15:53:19 2024 +0100 @@ -1,6 +1,23 @@ Mercurial can be augmented with Rust extensions for speeding up certain operations. +Word of Caution +=============== + +Using the Rust extension might result in the use of various repository formats +that are not supported by non-Rust mercurial. When using a Mercurial +without Rust support on the same repositories, you might need to downgrade your +repository formats and/or activate cripplingly slow paths for compatibility. +For details, see: + + - :hg:`help config.format.use-persistent-nodemap` + - :hg:`help config.format.use-dirstate-v2` + +In addition, while the tests are run with the Rust code, there might be +subtle undetected divergences from the historical non-Rust code. So keep +your eyes open and report any oddity. Rust is not considered a first class +citizen to the project yet. + Compatibility ============= @@ -9,6 +26,9 @@ mileage may vary, but by all means do give us feedback or signal your interest for better support. +For compatibility with non-Rust version of Mercurial check the previous "Word of +Caution" section. + No Rust extensions are available for Windows at this time. Features @@ -49,13 +69,19 @@ Users of `pip` can install the Rust extensions with the following command:: - $ pip install mercurial --global-option --rust --no-use-pep517 + $ pip install mercurial \ + --global-option \ + --rust \ + --no-use-pep517 \ + --no-binary mercurial `--no-use-pep517` is here to tell `pip` to preserve backwards compatibility with the legacy `setup.py` system. Mercurial has not yet migrated its complex setup to the new system, so we still need this to add compiled extensions. -This might take a couple of minutes because you're compiling everything. +`--no-binary` is there to tell pip to not use the pre-compiled wheels that are +missing rust support. This might take a couple of minutes because you're +compiling everything. See the "Checking for Rust" section to see if the install succeeded. diff -r 65d516db7309 -r 51a350a22d0c relnotes/6.9 --- a/relnotes/6.9 Thu Nov 14 16:45:23 2024 +0100 +++ b/relnotes/6.9 Wed Nov 20 15:53:19 2024 +0100 @@ -1,89 +1,21 @@ -= Mercurial 6.9rc1 = - -/!\ These are release notes for a release candidate version. Any and all points can be reverted before the final release. += Mercurial 6.9 = - * streamclone: disable the volatile file open handle optimization on Windows - * rust-update: make `update_from_null` respect `worker.numcpu` config option - * rust-update: handle SIGINT from long-running update threads - * rust-cpython: add a TODO about repo reuse - * pytype: add relative timestamp to the output if `ts` is available - * hgweb: skip logging ConnectionAbortedError - -Below are many, many changes that have to do with building/testing wheels, -adding some sharding to the CI and MacOS + Windows compatibility work: +== Backwards Compatibility Changes == - * run-tests: don't use shell call for subprocess - * run-tests: add a --hg-wheel options to test a pre-built wheel - * ci: unify the way `check-pytype` inherit the common setting - * ci: split the jobs on more stage - * ci: build a wheel and use it to run c tests - * tests: stabilize `test-extdiff.t` on macOS - * tests: disable `test-git-interop.t` with a requirements directive - * tests: disable a section of `test-hgrc.t` that may hit a zeroconf bug - * ci: add a runner for Windows 10 - * tests: treat `select` as a built-in module on Windows - * tests: disable a section of `test-paths.t` that may hit a zeroconf bug - * tests: conditionalize missing output in test-racy-mutations.t on Windows - * tests: add a "missing" tests for manifest content in test-racy-mutations.t - * tests: bump the wait timeouts in test-racy-mutations.t - * test-install: use the global hg for the install step - * test-install: glob instance of "python" in warning - * ci: pre-adjust some identation - * setup: add a way to force the setup to translate (or fail) - * ci: use smaller VM to build wheel - * ci: use a pre-setup many-linux image to build wheel - * ci: build (and use) wheel for all supported version - * ci: automatically compute the python tag we use to identify tag - * run-tests: install wheel using --prefix instead of --user - * pycompat: drop some now useless workaround for makedirs - * wheel: build mac os wheel through the CI - * ci: use the macos wheel to run tests - * ci: use extends instead of <<: *x - * ci: move some variables closer to their usage - * ci: rationalize variable usage - * ci: abstract the of absolute /tmp/ path - * ci: move the "tempory work dir" to "concurrency-safe" location - * ci: adjust the starting port range to runner concurrency - * ci: have the mac test run if you trigger building the mac wheel - * run-tests: implement crude sharding support - * ci: shard the test run on mac os X - * dev-version: change the scheme of non tagged version - * wheel: enforce that translation being build for macos wheel - * run-tests: focus on listing the selected test for the shard tests - * run-tests: cleanup the "output" directory after the related tests - * tests: drop PYTHONPATH manipulation in test-pushvars.t - * windows: work around argument size limitation in test-bookmarks-pushpull.t - * windows: adjust PYTHONPATH update in test-status-color.t - * ci: use a concurrency safe TMP dir on Windows - * ci: again common element into a `.windows` template - * ci: split the windows runtest invocation into more granular variables - * windows: skip test-clonebundles-autogen.t in the CI - * ci: adjust port range on windows too - * windows: simply rely on the PATH adjustment to find python.exe in tests - * wheel: assign CIBW_SKIP globally - * wheel: make --hg-wheel works on Windows - * wheel: build Windows wheels too - * wheel: explicitly list built architecture - * wheel: test the built wheel in the windows tests - * ci: shard the tests on windows too - * wheel: enforce that translation being build for windows wheel - * setup: remote a debug statement that slipped through - * setup: factor version computation in a function - * setup: use the same code to compute tag from archive - * wheel: add a platform level to the wheel directories - * wheel: add a job uploading nightly build - * wheels: factor the core of Linux wheel building into a script - * wheels: update the Linux wheels make target - * clone: properly exclude rev-branch-cache from post clone cache warming - * setup: make sure Rust build its extension for the right python - * setup: preserve version part after the "+" on Windows - * wheel: build windows wheel for ARM64 too - * ci: adds a trigger for all pycompat jobs - * ci: let the Windows runner decide how many job they want to run + * This release drops support for Python 3.6 and 3.7. + * Starting with this release and hopefully for the forseeable future, + we are now building wheels for most architectures. + /!\ Note that for Rust users installing via `pip` or `pipx`, you will need + to specify `--no-binary` to continue using Rust since we do not yet package + the Rust compilation in our wheels. We plan on fixing this for 7.0. + * Python 3.13 changed how it handles docstrings (namely removing uniform + leading whitespace for every line), which forced us to align the + representation of our help text with this new behavior across all versions. + Due to this and a lack of time and expertise from contributors, a lot of + existing translations could be missing. The effort of i18n in general has + died down many years ago, but if this matters to you, feel free to send + your contributions. -= Mercurial 6.9rc0 = - -/!\ These are release notes for a release candidate version. Any and all points can be reverted before the final release. == New Features == @@ -153,11 +85,9 @@ * doc: generate separate commands/topics/extension pages * extdiff: don't run gui programs when in a cli-only environment * clonebundles: stop shell quoting `HGCB_BUNDLE_BASENAME` environment variable - * rev-branch-cache: disable mmapping by default on Windows - -== Backwards Compatibility Changes == - - * This release drops support for Python 3.6 and 3.7. + * streamclone: disable the volatile file open handle optimization on Windows + * pytype: add relative timestamp to the output if `ts` is available + * hgweb: skip logging ConnectionAbortedError == Internal API Changes == @@ -175,3 +105,94 @@ * A whole bunch of typing improvements, which in turn found many bugs * Test suite improvements * Various packaging improvements + +Below are many, many changes that have to do with building/testing wheels, +adding some sharding to the CI and MacOS + Windows compatibility work: + + * ci: abstract the branch matching regexp + * ci: add "sink" for parallel tests + * ci: for branches, use a single trigger + * packaging: explain why we purge while building wheels + * wheels: rely on the image config to be able to access the repository + * packaging: remove the i686 wheel from the linux-wheels target + * packaging: propagate the make option to packaging target + * packaging: factor the linux-wheels-x86_64 a bit + * wheel: add a target for amdx86_64-musl wheels + * wheel: also build the musl wheel in the ci + * wheel: reintroduce the building of i686 wheel + * wheels: also build the i686 wheel in the CI + * contrib: install the arm64 compiler tools in the Windows dependency script + * contrib: add a bat file to build all of the wheels on Windows + * wheels: remove deprecated blacklist + * wheels: make sure we create the `dist/` directory in the make target + * contrib: add a script to build all of the wheels on macOS + * wheel: also build wheel for linux arm64 in the CI + * ci: add sink for wheels too + * run-tests: don't use shell call for subprocess + * run-tests: add a --hg-wheel options to test a pre-built wheel + * ci: unify the way `check-pytype` inherit the common setting + * ci: split the jobs on more stage + * ci: build a wheel and use it to run c tests + * tests: stabilize `test-extdiff.t` on macOS + * tests: disable `test-git-interop.t` with a requirements directive + * tests: disable a section of `test-hgrc.t` that may hit a zeroconf bug + * ci: add a runner for Windows 10 + * tests: treat `select` as a built-in module on Windows + * tests: disable a section of `test-paths.t` that may hit a zeroconf bug + * tests: conditionalize missing output in test-racy-mutations.t on Windows + * tests: add a "missing" tests for manifest content in test-racy-mutations.t + * tests: bump the wait timeouts in test-racy-mutations.t + * test-install: use the global hg for the install step + * test-install: glob instance of "python" in warning + * ci: pre-adjust some identation + * setup: add a way to force the setup to translate (or fail) + * ci: use smaller VM to build wheel + * ci: use a pre-setup many-linux image to build wheel + * ci: build (and use) wheel for all supported version + * ci: automatically compute the python tag we use to identify tag + * run-tests: install wheel using --prefix instead of --user + * pycompat: drop some now useless workaround for makedirs + * wheel: build mac os wheel through the CI + * ci: use the macos wheel to run tests + * ci: use extends instead of <<: *x + * ci: move some variables closer to their usage + * ci: rationalize variable usage + * ci: abstract the of absolute /tmp/ path + * ci: move the "tempory work dir" to "concurrency-safe" location + * ci: adjust the starting port range to runner concurrency + * ci: have the mac test run if you trigger building the mac wheel + * run-tests: implement crude sharding support + * ci: shard the test run on mac os X + * dev-version: change the scheme of non tagged version + * wheel: enforce that translation being build for macos wheel + * run-tests: focus on listing the selected test for the shard tests + * run-tests: cleanup the "output" directory after the related tests + * tests: drop PYTHONPATH manipulation in test-pushvars.t + * windows: work around argument size limitation in test-bookmarks-pushpull.t + * windows: adjust PYTHONPATH update in test-status-color.t + * ci: use a concurrency safe TMP dir on Windows + * ci: again common element into a `.windows` template + * ci: split the windows runtest invocation into more granular variables + * windows: skip test-clonebundles-autogen.t in the CI + * ci: adjust port range on windows too + * windows: simply rely on the PATH adjustment to find python.exe in tests + * wheel: assign CIBW_SKIP globally + * wheel: make --hg-wheel works on Windows + * wheel: build Windows wheels too + * wheel: explicitly list built architecture + * wheel: test the built wheel in the windows tests + * ci: shard the tests on windows too + * wheel: enforce that translation being build for windows wheel + * setup: remote a debug statement that slipped through + * setup: factor version computation in a function + * setup: use the same code to compute tag from archive + * wheel: add a platform level to the wheel directories + * wheel: add a job uploading nightly build + * wheels: factor the core of Linux wheel building into a script + * wheels: update the Linux wheels make target + * clone: properly exclude rev-branch-cache from post clone cache warming + * setup: make sure Rust build its extension for the right python + * setup: preserve version part after the "+" on Windows + * wheel: build windows wheel for ARM64 too + * ci: adds a trigger for all pycompat jobs + * ci: let the Windows runner decide how many job they want to run diff -r 65d516db7309 -r 51a350a22d0c rust/rhg/src/commands/status.rs --- a/rust/rhg/src/commands/status.rs Thu Nov 14 16:45:23 2024 +0100 +++ b/rust/rhg/src/commands/status.rs Wed Nov 20 15:53:19 2024 +0100 @@ -385,10 +385,10 @@ })?; let working_directory_vfs = repo.working_directory_vfs(); let store_vfs = repo.store_vfs(); - let revlog_open_options = default_revlog_options( + let filelog_open_options = default_revlog_options( repo.config(), repo.requirements(), - RevlogType::Manifestlog, + RevlogType::Filelog, )?; let res: Vec<_> = take(&mut ds_status.unsure) .into_par_iter() @@ -403,7 +403,7 @@ check_exec, &manifest, &to_check.path, - revlog_open_options, + filelog_open_options, ) { Err(HgError::IoError { .. }) => { // IO errors most likely stem from the file being diff -r 65d516db7309 -r 51a350a22d0c tests/test-check-code.t --- a/tests/test-check-code.t Thu Nov 14 16:45:23 2024 +0100 +++ b/tests/test-check-code.t Wed Nov 20 15:53:19 2024 +0100 @@ -93,5 +93,6 @@ Keep Windows line endings in check $ testrepohg files 'set:eol(dos)' + contrib/packaging/build-windows-wheels.bat contrib/win32/hg.bat contrib/win32/mercurial.ini