Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wlav/cppyy-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Nov 1, 2023
2 parents 49d6c74 + ae8f8f6 commit b56d6a7
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 31 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/cling-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ 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 }}
CIBW_BUILD_VERBOSITY: 1

strategy:
fail-fast: false
Expand All @@ -41,13 +39,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
Expand All @@ -71,13 +70,15 @@ 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), disabled because tools build during
# the build process won't run
#- os: windows-latest
# name: win32-arm64
# python: 310
# platform_id: win_arm64
# cibw:
# arch: ARM64

steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 3 additions & 6 deletions circleci.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import time
import json

import sys


def get_artifact(
token: str,
Expand Down Expand Up @@ -45,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
Expand All @@ -69,7 +71,6 @@ def start_job(
headers,
)
res = conn.getresponse()
print("pipeline data:", res.read().decode("utf-8"))
pipeline_data = json.loads(res.read().decode("utf-8"))
time.sleep(1.0)

Expand Down Expand Up @@ -104,12 +105,8 @@ def start_job(
)

res = conn.getresponse()
print("job data:\n", res.read().decode("utf-8"))
job_data = json.loads(res.read().decode("utf-8"))

print(job_data)

print(job_data["items"][0]["job_number"])
return 0


Expand Down
2 changes: 1 addition & 1 deletion cling/patches/apple.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion cling/patches/cling_update.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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();
+
Expand Down
36 changes: 31 additions & 5 deletions cling/patches/pch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<char, PATH_MAX> 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
Expand Down
2 changes: 1 addition & 1 deletion cling/python/cppyy_backend/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '6.28.0'
__version__ = '6.28.6'
5 changes: 4 additions & 1 deletion cling/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -162,7 +165,7 @@ 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"):
if 'arm64' in platform.machine():
CMAKE_COMMAND += ['-DLLVM_TARGETS_TO_BUILD=ARM;AArch64;NVPTX']
CMAKE_COMMAND.append('-DCMAKE_INSTALL_PREFIX='+prefix)

Expand Down

0 comments on commit b56d6a7

Please sign in to comment.