From 228f81586563378ad778ae377257e99bee428ccf Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 22:30:02 -0700 Subject: [PATCH 1/8] print to stderr to get some debugging output --- circleci.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/circleci.py b/circleci.py index 88111563..39e4cfb3 100644 --- a/circleci.py +++ b/circleci.py @@ -7,6 +7,8 @@ import time import json +import sys + def get_artifact( token: str, @@ -69,7 +71,7 @@ def start_job( headers, ) res = conn.getresponse() - print("pipeline data:", res.read().decode("utf-8")) + print("pipeline data:", res.read().decode("utf-8"), file=sys.stderr) pipeline_data = json.loads(res.read().decode("utf-8")) time.sleep(1.0) @@ -104,7 +106,7 @@ def start_job( ) res = conn.getresponse() - print("job data:\n", res.read().decode("utf-8")) + print("job data:\n", res.read().decode("utf-8"), file=sys.stderr) job_data = json.loads(res.read().decode("utf-8")) print(job_data) From e855eb346526721ecb2ecd2c571272ce6efbd828 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 22:30:33 -0700 Subject: [PATCH 2/8] disable Windows arm64 for now and increase verbosity of build output --- .github/workflows/cling-wheels.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index d741ad60..4f8fb200 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -30,7 +30,7 @@ jobs: CLING_CMAKE_BUILD_TARGET: "${{ matrix.cibw.arch || '' }}" CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} - CIBW_BUILD_VERBOSITY: 1 + VERBOSE: 1 strategy: fail-fast: false @@ -71,13 +71,14 @@ jobs: python: 310 platform_id: win_amd64 - # cross-compilation platform - - os: windows-latest - name: win32-arm64 - python: 310 - platform_id: win_arm64 - cibw: - arch: ARM64 + # cross-compilation platform (requires cross-compilation setup + # for cmake configuration) + #- os: windows-latest + # name: win32-arm64 + # python: 310 + # platform_id: win_arm64 + # cibw: + # arch: ARM64 steps: - uses: actions/checkout@v3 From c345ac8afca56e603d79d10e74cabceb66224d41 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 22:31:07 -0700 Subject: [PATCH 3/8] update patch version to latest ROOT/Cling release --- cling/python/cppyy_backend/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/python/cppyy_backend/_version.py b/cling/python/cppyy_backend/_version.py index 12486b38..e5ab9ec3 100644 --- a/cling/python/cppyy_backend/_version.py +++ b/cling/python/cppyy_backend/_version.py @@ -1 +1 @@ -__version__ = '6.28.0' +__version__ = '6.28.6' From 05119ee23938674df380ecdd12b8a630664f06eb Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 22:31:59 -0700 Subject: [PATCH 4/8] add fallback to `xcrun --show-sdk-path` for sysroot --- cling/patches/apple.diff | 2 +- cling/patches/build.diff | 2 +- cling/patches/cling_update.diff | 6 +++++- cling/patches/pch.diff | 36 ++++++++++++++++++++++++++++----- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/cling/patches/apple.diff b/cling/patches/apple.diff index 342571f6..415fd77e 100644 --- a/cling/patches/apple.diff +++ b/cling/patches/apple.diff @@ -2,7 +2,7 @@ diff --git a/src/interpreter/cling/lib/Interpreter/CIFactory.cpp b/src/interpret index aec153242b..abcfd33597 100644 --- a/src/interpreter/cling/lib/Interpreter/CIFactory.cpp +++ b/src/interpreter/cling/lib/Interpreter/CIFactory.cpp -@@ -336,6 +336,13 @@ namespace { +@@ -305,6 +305,13 @@ namespace { } #endif // _LIBCPP_VERSION diff --git a/cling/patches/build.diff b/cling/patches/build.diff index 574a9ee9..f21e5b7a 100644 --- a/cling/patches/build.diff +++ b/cling/patches/build.diff @@ -32,7 +32,7 @@ diff --git a/src/interpreter/cling/lib/Interpreter/CIFactory.cpp b/src/interpret index 1ab35553fa..b7c99ba281 100644 --- a/src/interpreter/cling/lib/Interpreter/CIFactory.cpp +++ b/src/interpreter/cling/lib/Interpreter/CIFactory.cpp -@@ -422,7 +422,10 @@ namespace { +@@ -458,7 +458,10 @@ namespace { Opts.CXXExceptions = 1; } diff --git a/cling/patches/cling_update.diff b/cling/patches/cling_update.diff index a55e19fa..b469e67b 100644 --- a/cling/patches/cling_update.diff +++ b/cling/patches/cling_update.diff @@ -912,7 +912,11 @@ index 5342945ed1..04bebf0558 100644 switch (CI.getCodeGenOpts().OptimizationLevel) { case 0: OptLevel = CodeGenOpt::None; break; case 1: OptLevel = CodeGenOpt::Less; break; -@@ -334,19 +448,35 @@ Error RTDynamicLibrarySearchGenerator::tryToGenerate( +@@ -330,23 +448,39 @@ Error RTDynamicLibrarySearchGenerator::tryToGenerate( + case 3: OptLevel = CodeGenOpt::Aggressive; break; + default: OptLevel = CodeGenOpt::Default; + } + + + const Triple &TT = CI.getTarget().getTriple(); + diff --git a/cling/patches/pch.diff b/cling/patches/pch.diff index a0a110c4..7defcd1e 100644 --- a/cling/patches/pch.diff +++ b/cling/patches/pch.diff @@ -11,7 +11,7 @@ index 80d1b1c52a..58edb8c26d 100644 using namespace clang; using namespace cling; -@@ -345,7 +347,37 @@ namespace { +@@ -345,7 +347,63 @@ namespace { } #ifdef CLING_OSX_SYSROOT @@ -40,11 +40,37 @@ index 80d1b1c52a..58edb8c26d 100644 + sysroot = sysroot.substr(0, pos+11) + getenv("MACOSX_DEPLOYMENT_TARGET") + ".sdk"; + else + sysroot = sysroot.substr(0, pos+11)+".sdk"; // generic location -+ if (stat(sysroot.c_str(), &buf) == 0) -+ sArguments.addArgument("-isysroot", sysroot.c_str()); -+ else -+ cling::errs() << "Warning: sysroot \"" << sysroot << "\" not found (ignoring for now)."; + } ++ if (stat(sysroot.c_str(), &buf) != 0) { ++ // final attempt, query xcrun ++ std::string SdkPathQuery("xcrun --show-sdk-path"); ++ if (Verbose) ++ cling::log() << "Looking for sysroot:\n " << SdkPathQuery << "\n"; ++ ++ if (FILE *PF = ::popen(SdkPathQuery.c_str(), "r")) { ++ llvm::SmallVector Buf; ++ Buf.resize(Buf.capacity_in_bytes()); ++ while (fgets(&Buf[0], Buf.capacity_in_bytes(), PF) && Buf[0]) { ++ llvm::StringRef Path(&Buf[0]); ++ Path = Path.trim(); ++ if (!Path.empty()) { ++ if (!llvm::sys::fs::is_directory(Path)) { ++ if (Verbose) ++ cling::utils::LogNonExistantDirectory(Path); ++ } ++ else { ++ sysroot = Path.str(); ++ break; ++ } ++ } ++ ::pclose(PF); ++ } ++ } ++ } ++ if (stat(sysroot.c_str(), &buf) == 0) ++ sArguments.addArgument("-isysroot", sysroot.c_str()); ++ else ++ cling::errs() << "Warning: sysroot \"" << sysroot << "\" not found (ignoring for now)."; + } + } #endif From 728e930f59e2f75d8cf8864a7b76c4e4274b8f79 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 22:52:05 -0700 Subject: [PATCH 5/8] explicitly set CMAKE_OSX_ARCHITECTURES for cross compilation --- cling/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/setup.py b/cling/setup.py index 30c5f170..c2f283cf 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -163,7 +163,7 @@ def run(self): elif 'darwin' in sys.platform: import platform if 'arm64' in platform.machine() or 'arm64' in os.getenv("CLING_CMAKE_BUILD_TARGET"): - CMAKE_COMMAND += ['-DLLVM_TARGETS_TO_BUILD=ARM;AArch64;NVPTX'] + CMAKE_COMMAND += ['-DCMAKE_OSX_ARCHITECTURES=arm64', '-DLLVM_TARGETS_TO_BUILD=ARM;AArch64;NVPTX'] CMAKE_COMMAND.append('-DCMAKE_INSTALL_PREFIX='+prefix) log.info('Running cmake for cppyy-cling: %s', ' '.join(CMAKE_COMMAND)) From 9dc12f62231b08c20ce09e36ef5c25a5041ce821 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Wed, 11 Oct 2023 23:00:57 -0700 Subject: [PATCH 6/8] set default branch to use for circleci builds to "master" --- circleci.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/circleci.py b/circleci.py index 39e4cfb3..47733aa8 100644 --- a/circleci.py +++ b/circleci.py @@ -47,7 +47,7 @@ def start_job( org: str = "wlav", project: str = "cppyy-backend", build_aarch64_wheel: bool = True, - branch: str = "build-wheels-with-cibuildwheel", + branch: str = "master", **kwargs, ) -> int: import http.client @@ -71,7 +71,6 @@ def start_job( headers, ) res = conn.getresponse() - print("pipeline data:", res.read().decode("utf-8"), file=sys.stderr) pipeline_data = json.loads(res.read().decode("utf-8")) time.sleep(1.0) @@ -106,12 +105,8 @@ def start_job( ) res = conn.getresponse() - print("job data:\n", res.read().decode("utf-8"), file=sys.stderr) job_data = json.loads(res.read().decode("utf-8")) - print(job_data) - - print(job_data["items"][0]["job_number"]) return 0 From a8e3a52e7f64c85f143f525aa11d0887f8d528b2 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Thu, 12 Oct 2023 15:58:16 -0700 Subject: [PATCH 7/8] drop cross-compiled platforms from github CI (can't work) --- .github/workflows/cling-wheels.yml | 19 ++++++++++--------- cling/setup.py | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 4f8fb200..b069c0ce 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -30,7 +30,6 @@ jobs: CLING_CMAKE_BUILD_TARGET: "${{ matrix.cibw.arch || '' }}" CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} - VERBOSE: 1 strategy: fail-fast: false @@ -41,13 +40,14 @@ jobs: python: 310 platform_id: macosx_x86_64 - # cross-compilation platform - - os: macos-latest - name: mac-cpython-arm - python: 310 - platform_id: macosx_arm64 - cibw: - arch: arm64 + # cross-compilation platform, disabled because tools build + # during the build process won't run + #- os: macos-latest + # name: mac-cpython-arm + # python: 310 + # platform_id: macosx_arm64 + # cibw: + # arch: arm64 - os: ubuntu-latest name: manylinux2014-x86_64 @@ -72,7 +72,8 @@ jobs: platform_id: win_amd64 # cross-compilation platform (requires cross-compilation setup - # for cmake configuration) + # for cmake configuration), disabled because tools build during + # the build process won't run #- os: windows-latest # name: win32-arm64 # python: 310 diff --git a/cling/setup.py b/cling/setup.py index c2f283cf..e91e7790 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -162,8 +162,8 @@ def run(self): CMAKE_COMMAND += ['-Thost=x86', '-DCMAKE_GENERATOR_PLATFORM=win32'] elif 'darwin' in sys.platform: import platform - if 'arm64' in platform.machine() or 'arm64' in os.getenv("CLING_CMAKE_BUILD_TARGET"): - CMAKE_COMMAND += ['-DCMAKE_OSX_ARCHITECTURES=arm64', '-DLLVM_TARGETS_TO_BUILD=ARM;AArch64;NVPTX'] + if 'arm64' in platform.machine(): + CMAKE_COMMAND += ['-DLLVM_TARGETS_TO_BUILD=ARM;AArch64;NVPTX'] CMAKE_COMMAND.append('-DCMAKE_INSTALL_PREFIX='+prefix) log.info('Running cmake for cppyy-cling: %s', ' '.join(CMAKE_COMMAND)) From ae8f8f6c428a50c8bede91bc6d815ab75c2b6784 Mon Sep 17 00:00:00 2001 From: Wim Lavrijsen Date: Thu, 12 Oct 2023 16:04:18 -0700 Subject: [PATCH 8/8] test explicitly enabling -D_GLIBCXX_USE_CXX11_ABI=1 on manylinux --- .github/workflows/cling-wheels.yml | 1 - cling/setup.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index b069c0ce..cee13562 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -27,7 +27,6 @@ jobs: env: CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}" - CLING_CMAKE_BUILD_TARGET: "${{ matrix.cibw.arch || '' }}" CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} diff --git a/cling/setup.py b/cling/setup.py index e91e7790..c89777f1 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -150,6 +150,9 @@ def run(self): CMAKE_COMMAND = ['cmake', srcdir, '-Wno-dev', stdcxx, '-DLLVM_ENABLE_TERMINFO=0', '-DLLVM_ENABLE_ASSERTIONS=0', '-Dminimal=ON', '-Dbuiltin_cling=ON', '-Druntime_cxxmodules=OFF', '-Dbuiltin_zlib=ON'] + if 'CIBW_MANYLINUX_X86_64_IMAGE' in os.environ or 'CIBW_MANYLINUX_I686_IMAGE' in os.environ: + print("enabling _GLIBCXX_USE_CXX11_ABI") + CMAKE_COMMAND.append('-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1') if 'darwin' in sys.platform: CMAKE_COMMAND.append('-Dlibcxx=ON') CMAKE_COMMAND.append('-DCMAKE_BUILD_TYPE='+get_build_type())