From 452c7438adb67321f99f2bca7395087ef59dd58f Mon Sep 17 00:00:00 2001 From: Alex Hornby Date: Fri, 11 Oct 2024 03:39:48 -0700 Subject: [PATCH] sapling getdeps cli build and test support for python 3.12 Summary: Ubuntu 24.04 and Fedora 40 are both python 3.12 based. Update sapling's OSS getdeps build to allow build/run/test on python 3.12 while keeping 3.10 support. * distutils is deprecated in python 3.12 stdlib, but fortunately setuptools is pretty similar and includes a vendored distutils, so: * added a manifest so we get python3-setuptools installed. * setup.py: removed deprecated usage like `find_executable` in favor of `shutil.which()`, also removed some super old xcode 4/5.1 detection I found * util.py makedate(): datetime.utcfromtimestamp is deprecated in 3.12, so updated to use non-deprecated methods. Tested with test-command-template.t which shows tz offset. * Makefile: disabled test-eager-exchange.t on 3.12 where updating the expectation to run on 3.12 and 3.10 is tricky (debug output differs) * tests modified to run on 3.12 and 3.10: * test-import-eol.t: updated for invalid escape sequence warnings * test-install.t: updated to filter out message that appears in different order on 3.12 vs earlier versions * test-merge-driver2.t: match different debug output in 3.12, remove check for mercurial package * test-sign-commit.t: updated to add --yes for newer gpg that python 3.12 using distros have * found some tests needed bunzip2, so update manifest for sapling and bz2 to install it X-link: https://github.com/facebook/sapling/pull/964 X-link: https://github.com/facebookincubator/zstrong/pull/1005 Reviewed By: quark-zju, singhsrb Differential Revision: D63958742 Pulled By: ahornby fbshipit-source-id: 460c42eb1315f2e1631c74d356e4976469104c1b --- build/fbcode_builder/manifests/bz2 | 2 ++ build/fbcode_builder/manifests/python-setuptools | 9 +++++++++ build/fbcode_builder/manifests/sapling | 1 + 3 files changed, 12 insertions(+) diff --git a/build/fbcode_builder/manifests/bz2 b/build/fbcode_builder/manifests/bz2 index af2f357d5db..cfbea9c8fd1 100644 --- a/build/fbcode_builder/manifests/bz2 +++ b/build/fbcode_builder/manifests/bz2 @@ -3,12 +3,14 @@ name = bz2 [debs] libbz2-dev +bzip2 [homebrew] bzip2 [rpms] bzip2-devel +bzip2 [download] url = https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz diff --git a/build/fbcode_builder/manifests/python-setuptools b/build/fbcode_builder/manifests/python-setuptools index 7ca2e1e498c..6e71b3b008f 100644 --- a/build/fbcode_builder/manifests/python-setuptools +++ b/build/fbcode_builder/manifests/python-setuptools @@ -7,3 +7,12 @@ sha256 = 02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56 [build] builder = python-wheel + +[rpms] +python3-setuptools + +[homebrew] +python-setuptools + +[debs] +python3-setuptools diff --git a/build/fbcode_builder/manifests/sapling b/build/fbcode_builder/manifests/sapling index bbbfe1e40f8..c067360ef82 100644 --- a/build/fbcode_builder/manifests/sapling +++ b/build/fbcode_builder/manifests/sapling @@ -65,6 +65,7 @@ hexdump [dependencies.not(os=windows)] python +python-setuptools # We use the system openssl on linux [dependencies.not(os=linux)]