Skip to content

Commit c717d71

Browse files
committed
[GR-75879] Generate _sysconfigdata
PullRequest: graalpython/4582
2 parents 4f27b9f + 0a03dce commit c717d71

15 files changed

Lines changed: 342 additions & 166 deletions

File tree

graalpython/com.oracle.graal.python.frozen/freeze_modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def add_graalpython_core():
112112
l = []
113113
l.append("polyglot.arrow : polyglot.arrow = " + os.path.join(lib_graalpython, "modules/_polyglot_arrow.py"))
114114
for name in [
115-
"modules/_sysconfigdata",
116115
"modules/_polyglot",
117116
"modules/_polyglot_time",
118117
]:

graalpython/com.oracle.graal.python.resources/src/com/oracle/graal/python/resources/PythonResource.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.io.File;
4444
import java.io.IOException;
4545
import java.io.InputStream;
46+
import java.nio.charset.StandardCharsets;
4647
import java.nio.file.InvalidPathException;
4748
import java.nio.file.Path;
4849
import java.util.ArrayList;
@@ -66,6 +67,7 @@ public final class PythonResource implements InternalResource {
6667
private static final int PYTHON_MINOR;
6768
private static final int GRAALVM_MAJOR;
6869
private static final int GRAALVM_MINOR;
70+
private static final String PYTHON_ABIFLAGS;
6971

7072
/**
7173
* The version generated at build time is stored in an ASCII-compatible way. Add build time, we
@@ -82,6 +84,13 @@ public final class PythonResource implements InternalResource {
8284
is.read(); // skip python micro version
8385
GRAALVM_MAJOR = is.read() - VERSION_BASE;
8486
GRAALVM_MINOR = is.read() - VERSION_BASE;
87+
is.read(); // skip GraalVM micro version
88+
is.read(); // skip release level
89+
int ch;
90+
while ((ch = is.read()) != '\n' && ch != -1) {
91+
// skip ABI version
92+
}
93+
PYTHON_ABIFLAGS = ch == -1 ? "" : new String(is.readAllBytes(), StandardCharsets.US_ASCII).strip();
8594
} catch (IOException e) {
8695
throw new RuntimeException(e);
8796
}
@@ -117,7 +126,7 @@ public void unpackFiles(Env env, Path targetDirectory) throws IOException {
117126
env.unpackResourceFiles(BASE_PATH.resolve(LIBPYTHON_FILES), targetDirectory.resolve("lib").resolve(pythonMajMin), BASE_PATH.resolve(LIBPYTHON), filter);
118127
env.unpackResourceFiles(BASE_PATH.resolve(LIBGRAALPY_FILES), targetDirectory.resolve("lib").resolve("graalpy" + GRAALVM_MAJOR + "." + GRAALVM_MINOR), BASE_PATH.resolve(LIBGRAALPY),
119128
filter);
120-
env.unpackResourceFiles(BASE_PATH.resolve(INCLUDE_FILES), targetDirectory.resolve("include").resolve(pythonMajMin), BASE_PATH.resolve(INCLUDE), filter);
129+
env.unpackResourceFiles(BASE_PATH.resolve(INCLUDE_FILES), targetDirectory.resolve("include").resolve(pythonMajMin + PYTHON_ABIFLAGS), BASE_PATH.resolve(INCLUDE), filter);
121130
}
122131
// ni files are in the same place on all platforms
123132
env.unpackResourceFiles(BASE_PATH.resolve(NI_FILES), targetDirectory, BASE_PATH, filter);

graalpython/com.oracle.graal.python.test/src/tests/test_sysconfig.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -47,7 +47,12 @@ def test_sysconfig():
4747
# must not fail
4848

4949

50-
@unittest.skipIf(sys.implementation.name != 'graalpy', "GraalPy-only test")
51-
def test_sysconfigdata():
52-
# Maturin loads this directly, make sure the import works
53-
import _sysconfigdata
50+
def test_platform_sysconfigdata():
51+
import importlib
52+
import sysconfig
53+
mod = importlib.import_module(sysconfig._get_sysconfigdata_name())
54+
# These flags are parsed directly from the file by maturin
55+
for key in ("ABIFLAGS", "EXT_SUFFIX", "SOABI", "VERSION"):
56+
assert key in mod.build_time_vars
57+
assert mod.build_time_vars["ABIFLAGS"] == sys.abiflags
58+
assert sys.abiflags in sysconfig.get_config_var("INCLUDEPY")

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
203203

204204
/** See {@code mx_graalpython.py:abi_version} */
205205
public static final String GRAALPY_ABI_VERSION;
206+
public static final String GRAALPY_ABIFLAGS;
206207

207208
/* Magic number used to mark pyc files */
208209
public static final int MAGIC_NUMBER = 21000 + Compiler.BYTECODE_VERSION * 10;
@@ -252,7 +253,9 @@ public final class PythonLanguage extends TruffleLanguage<PythonContext> {
252253
default:
253254
RELEASE_LEVEL_STRING = tsLiteral("final");
254255
}
255-
GRAALPY_ABI_VERSION = new String(is.readAllBytes(), StandardCharsets.US_ASCII).strip();
256+
String[] abiParts = new String(is.readAllBytes(), StandardCharsets.US_ASCII).split("\\R", 2);
257+
GRAALPY_ABI_VERSION = abiParts[0].strip();
258+
GRAALPY_ABIFLAGS = abiParts.length > 1 ? abiParts[1].strip() : "";
256259
} catch (IOException e) {
257260
throw new RuntimeException(e);
258261
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ public final class SysModuleBuiltins extends PythonBuiltins {
288288

289289
public static final TruffleString T_CACHE_TAG = tsLiteral("cache_tag");
290290
public static final TruffleString T__MULTIARCH = tsLiteral("_multiarch");
291+
public static final TruffleString T_ABIFLAGS = tsLiteral("abiflags");
291292

292293
static {
293294
String compile_time;
@@ -497,7 +498,7 @@ public void initialize(Python3Core core) {
497498
StructSequence.initType(core, THREAD_INFO_DESC);
498499
StructSequence.initType(core, UNRAISABLEHOOK_ARGS_DESC);
499500

500-
addBuiltinConstant("abiflags", T_EMPTY_STRING);
501+
addBuiltinConstant(T_ABIFLAGS, toTruffleStringUncached(PythonLanguage.GRAALPY_ABIFLAGS));
501502
addBuiltinConstant("byteorder", ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? T_LITTLE : T_BIG);
502503
addBuiltinConstant("copyright", T_LICENSE);
503504
addBuiltinConstant(T_MODULES, PFactory.createDict(language));

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/module/FrozenModules.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ private static final class Map {
9696
private static final PythonFrozenModule __PHELLO___SPAM = new PythonFrozenModule("__PHELLO___SPAM", "__phello__.spam", false);
9797
private static final PythonFrozenModule FROZEN_ONLY = new PythonFrozenModule("FROZEN_ONLY", null, false);
9898
private static final PythonFrozenModule POLYGLOT_ARROW = new PythonFrozenModule("POLYGLOT_ARROW", null, false);
99-
private static final PythonFrozenModule _SYSCONFIGDATA = new PythonFrozenModule("_SYSCONFIGDATA", null, false);
10099
private static final PythonFrozenModule _POLYGLOT = new PythonFrozenModule("_POLYGLOT", null, false);
101100
private static final PythonFrozenModule _POLYGLOT_TIME = new PythonFrozenModule("_POLYGLOT_TIME", null, false);
102101
private static final PythonFrozenModule GRAALPY___GRAALPYTHON__ = new PythonFrozenModule("GRAALPY___GRAALPYTHON__", null, false);
@@ -223,8 +222,6 @@ public static final PythonFrozenModule lookup(String name) {
223222
return Map.FROZEN_ONLY;
224223
case "polyglot.arrow":
225224
return Map.POLYGLOT_ARROW;
226-
case "_sysconfigdata":
227-
return Map._SYSCONFIGDATA;
228225
case "_polyglot":
229226
return Map._POLYGLOT;
230227
case "_polyglot_time":

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static com.oracle.graal.python.annotations.PythonOS.PLATFORM_DARWIN;
3131
import static com.oracle.graal.python.annotations.PythonOS.PLATFORM_WIN32;
3232
import static com.oracle.graal.python.builtins.PythonBuiltinClassType.SystemError;
33+
import static com.oracle.graal.python.builtins.modules.SysModuleBuiltins.T_ABIFLAGS;
3334
import static com.oracle.graal.python.builtins.modules.SysModuleBuiltins.T_CACHE_TAG;
3435
import static com.oracle.graal.python.builtins.modules.SysModuleBuiltins.T__MULTIARCH;
3536
import static com.oracle.graal.python.builtins.modules.io.IONodes.T_CLOSED;
@@ -2923,6 +2924,7 @@ public TruffleString getSoAbi() {
29232924
Object implementationObj = ReadAttributeFromModuleNode.getUncached().execute(sysModule, T_IMPLEMENTATION);
29242925
// sys.implementation.cache_tag
29252926
TruffleString cacheTag = (TruffleString) PyObjectGetAttr.executeUncached(implementationObj, T_CACHE_TAG);
2927+
TruffleString abiFlags = (TruffleString) ReadAttributeFromModuleNode.getUncached().execute(sysModule, T_ABIFLAGS);
29262928
// sys.implementation._multiarch
29272929
TruffleString multiArch = (TruffleString) PyObjectGetAttr.executeUncached(implementationObj, T__MULTIARCH);
29282930

@@ -2938,7 +2940,7 @@ public TruffleString getSoAbi() {
29382940
soExt = T_EXT_SO;
29392941
}
29402942

2941-
soABI = cat(T_DOT, cacheTag, T_DASH, T_NATIVE, T_DASH, multiArch, soExt);
2943+
soABI = cat(T_DOT, cacheTag, abiFlags, T_DASH, T_NATIVE, T_DASH, multiArch, soExt);
29422944
}
29432945
return soABI;
29442946
}

graalpython/graalpy-pyconfig/CMakeLists.txt

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ include(CheckSymbolExists)
3333
include(CheckIncludeFile)
3434
include (TestBigEndian)
3535

36+
if(NOT DEFINED GRAALPY_SYSCONFIGDATA_NAME)
37+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
38+
set(GRAALPY_SYSCONFIG_PLATFORM "darwin")
39+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
40+
set(GRAALPY_SYSCONFIG_PLATFORM "win32")
41+
else()
42+
set(GRAALPY_SYSCONFIG_PLATFORM "linux")
43+
endif()
44+
45+
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" GRAALPY_SYSCONFIG_ARCH)
46+
if(GRAALPY_SYSCONFIG_ARCH STREQUAL "amd64")
47+
set(GRAALPY_SYSCONFIG_ARCH "x86_64")
48+
endif()
49+
set(GRAALPY_SYSCONFIG_MULTIARCH "${GRAALPY_SYSCONFIG_ARCH}-${GRAALPY_SYSCONFIG_PLATFORM}")
50+
set(GRAALPY_SYSCONFIGDATA_NAME "_sysconfigdata__${GRAALPY_SYSCONFIG_PLATFORM}_${GRAALPY_SYSCONFIG_MULTIARCH}")
51+
endif()
52+
3653
test_big_endian(IS_BIG_ENDIAN)
3754

3855
set(CMAKE_REQUIRED_LINK_OPTIONS "-lm")
@@ -70,4 +87,99 @@ else()
7087
set(DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1)
7188
endif()
7289

90+
function(graalpy_sysconfig_value name default_value)
91+
if(DEFINED ENV{GRAALPY_SYSCONFIG_${name}})
92+
set(GRAALPY_SYSCONFIG_${name} "$ENV{GRAALPY_SYSCONFIG_${name}}" PARENT_SCOPE)
93+
else()
94+
set(GRAALPY_SYSCONFIG_${name} "${default_value}" PARENT_SCOPE)
95+
endif()
96+
endfunction()
97+
98+
function(graalpy_sysconfig_empty name)
99+
graalpy_sysconfig_value("${name}" "")
100+
endfunction()
101+
102+
function(graalpy_sysconfig_env_value name)
103+
if(DEFINED ENV{GRAALPY_SYSCONFIG_${name}})
104+
set(GRAALPY_SYSCONFIG_${name} "$ENV{GRAALPY_SYSCONFIG_${name}}" PARENT_SCOPE)
105+
else()
106+
set(GRAALPY_SYSCONFIG_${name} "" PARENT_SCOPE)
107+
endif()
108+
endfunction()
109+
110+
function(graalpy_sysconfig_python_string name)
111+
set(value "${${name}}")
112+
string(REPLACE "\\" "\\\\" value "${value}")
113+
string(REPLACE "\"" "\\\"" value "${value}")
114+
string(REPLACE "\n" "\\n" value "${value}")
115+
string(REPLACE "\r" "\\r" value "${value}")
116+
set(${name}_PYTHON_STRING "${value}" PARENT_SCOPE)
117+
endfunction()
118+
119+
graalpy_sysconfig_value("OPT" "-DNDEBUG")
120+
graalpy_sysconfig_value("ARFLAGS" "rc")
121+
graalpy_sysconfig_value("USE_GNU_SOURCE" "-D_GNU_SOURCE=1")
122+
set(GRAALPY_SYSCONFIG_CFLAGS_DEFAULT_VALUE "${GRAALPY_SYSCONFIG_OPT}")
123+
if(WIN32)
124+
set(GRAALPY_SYSCONFIG_CFLAGS_DEFAULT_VALUE "${GRAALPY_SYSCONFIG_CFLAGS_DEFAULT_VALUE} -DMS_WINDOWS -DPy_ENABLE_SHARED -DHAVE_DECLSPEC_DLL")
125+
endif()
126+
graalpy_sysconfig_value("CFLAGS_DEFAULT" "${GRAALPY_SYSCONFIG_CFLAGS_DEFAULT_VALUE}")
127+
graalpy_sysconfig_value("CFLAGS" "${GRAALPY_SYSCONFIG_CFLAGS_DEFAULT} ${GRAALPY_SYSCONFIG_USE_GNU_SOURCE}")
128+
graalpy_sysconfig_env_value("AR")
129+
graalpy_sysconfig_env_value("CC")
130+
graalpy_sysconfig_env_value("CXX")
131+
graalpy_sysconfig_env_value("LD")
132+
graalpy_sysconfig_env_value("NM")
133+
graalpy_sysconfig_env_value("RANLIB")
134+
if(APPLE)
135+
graalpy_sysconfig_value("LDFLAGS" "-bundle -undefined dynamic_lookup")
136+
graalpy_sysconfig_value("MACOSX_DEPLOYMENT_TARGET" "11")
137+
else()
138+
graalpy_sysconfig_empty("LDFLAGS")
139+
graalpy_sysconfig_empty("MACOSX_DEPLOYMENT_TARGET")
140+
endif()
141+
if(WIN32)
142+
graalpy_sysconfig_empty("CCSHARED")
143+
graalpy_sysconfig_value("SHLIB_SUFFIX" ".pyd")
144+
graalpy_sysconfig_value("EXE" ".exe")
145+
else()
146+
graalpy_sysconfig_value("CCSHARED" "-fPIC")
147+
graalpy_sysconfig_value("SHLIB_SUFFIX" ".so")
148+
graalpy_sysconfig_empty("EXE")
149+
endif()
150+
graalpy_sysconfig_env_value("LDCXXSHARED")
151+
graalpy_sysconfig_env_value("LDSHARED")
152+
graalpy_sysconfig_value("LDLIBRARY" "libpython.${GRAALPY_SYSCONFIG_SOABI}${GRAALPY_SYSCONFIG_SHLIB_SUFFIX}")
153+
154+
set(GRAALPY_SYSCONFIG_STRING_NAMES
155+
ABIFLAGS
156+
AR
157+
ARFLAGS
158+
CC
159+
CCSHARED
160+
CFLAGS
161+
CFLAGS_DEFAULT
162+
CXX
163+
EXE
164+
EXT_SUFFIX
165+
LD
166+
LDCXXSHARED
167+
LDLIBRARY
168+
LDFLAGS
169+
LDSHARED
170+
MACOSX_DEPLOYMENT_TARGET
171+
MULTIARCH
172+
NM
173+
OPT
174+
RANLIB
175+
SHLIB_SUFFIX
176+
SOABI
177+
USE_GNU_SOURCE
178+
VERSION
179+
)
180+
foreach(name IN LISTS GRAALPY_SYSCONFIG_STRING_NAMES)
181+
graalpy_sysconfig_python_string("GRAALPY_SYSCONFIG_${name}")
182+
endforeach()
183+
73184
configure_file("pyconfig_template.h" "pyconfig.h" @ONLY)
185+
configure_file("_sysconfigdata_template.py" "${GRAALPY_SYSCONFIGDATA_NAME}.py" @ONLY)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
2+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3+
#
4+
# The Universal Permissive License (UPL), Version 1.0
5+
#
6+
# Subject to the condition set forth below, permission is hereby granted to any
7+
# person obtaining a copy of this software, associated documentation and/or
8+
# data (collectively the "Software"), free of charge and under any and all
9+
# copyright rights in the Software, and any and all patent rights owned or
10+
# freely licensable by each licensor hereunder covering either (i) the
11+
# unmodified Software as contributed to or provided by such licensor, or (ii)
12+
# the Larger Works (as defined below), to deal in both
13+
#
14+
# (a) the Software, and
15+
#
16+
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
17+
# one is included with the Software each a "Larger Work" to which the Software
18+
# is contributed by such licensors),
19+
#
20+
# without restriction, including without limitation the rights to copy, create
21+
# derivative works of, display, perform, and distribute the Software and make,
22+
# use, sell, offer for sale, import, export, have made, and have sold the
23+
# Software and the Larger Work(s), and to sublicense the foregoing rights on
24+
# either these or other terms.
25+
#
26+
# This license is subject to the following condition:
27+
#
28+
# The above copyright notice and either this complete permission notice or at a
29+
# minimum a reference to the UPL must be included in all copies or substantial
30+
# portions of the Software.
31+
#
32+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38+
# SOFTWARE.
39+
40+
# system configuration generated and used by the sysconfig module
41+
42+
build_time_vars = {
43+
"ABIFLAGS": "@GRAALPY_SYSCONFIG_ABIFLAGS_PYTHON_STRING@",
44+
"ARFLAGS": "@GRAALPY_SYSCONFIG_ARFLAGS_PYTHON_STRING@",
45+
"CCSHARED": "@GRAALPY_SYSCONFIG_CCSHARED_PYTHON_STRING@",
46+
"CFLAGS": "@GRAALPY_SYSCONFIG_CFLAGS_PYTHON_STRING@",
47+
"CFLAGS_DEFAULT": "@GRAALPY_SYSCONFIG_CFLAGS_DEFAULT_PYTHON_STRING@",
48+
"EXE": "@GRAALPY_SYSCONFIG_EXE_PYTHON_STRING@",
49+
"EXT_SUFFIX": "@GRAALPY_SYSCONFIG_EXT_SUFFIX_PYTHON_STRING@",
50+
"LDLIBRARY": "@GRAALPY_SYSCONFIG_LDLIBRARY_PYTHON_STRING@",
51+
"LDFLAGS": "@GRAALPY_SYSCONFIG_LDFLAGS_PYTHON_STRING@",
52+
"LIBPYTHON": "",
53+
"LIBS": "",
54+
"MACOSX_DEPLOYMENT_TARGET": "@GRAALPY_SYSCONFIG_MACOSX_DEPLOYMENT_TARGET_PYTHON_STRING@",
55+
"MULTIARCH": "@GRAALPY_SYSCONFIG_MULTIARCH_PYTHON_STRING@",
56+
"OPT": "@GRAALPY_SYSCONFIG_OPT_PYTHON_STRING@",
57+
"Py_GIL_DISABLED": @GRAALPY_SYSCONFIG_GIL_DISABLED@,
58+
"Py_DEBUG": 0,
59+
"Py_ENABLE_SHARED": 0,
60+
"Py_HASH_ALGORITHM": 0,
61+
"SHLIB_SUFFIX": "@GRAALPY_SYSCONFIG_SHLIB_SUFFIX_PYTHON_STRING@",
62+
"SO": "@GRAALPY_SYSCONFIG_EXT_SUFFIX_PYTHON_STRING@",
63+
"SOABI": "@GRAALPY_SYSCONFIG_SOABI_PYTHON_STRING@",
64+
"SYSLIBS": "",
65+
"USE_GNU_SOURCE": "@GRAALPY_SYSCONFIG_USE_GNU_SOURCE_PYTHON_STRING@",
66+
"VERSION": "@GRAALPY_SYSCONFIG_VERSION_PYTHON_STRING@",
67+
}
68+
69+
for _key, _value in {
70+
"AR": "@GRAALPY_SYSCONFIG_AR_PYTHON_STRING@",
71+
"CC": "@GRAALPY_SYSCONFIG_CC_PYTHON_STRING@",
72+
"CXX": "@GRAALPY_SYSCONFIG_CXX_PYTHON_STRING@",
73+
"LD": "@GRAALPY_SYSCONFIG_LD_PYTHON_STRING@",
74+
"LDCXXSHARED": "@GRAALPY_SYSCONFIG_LDCXXSHARED_PYTHON_STRING@",
75+
"LDSHARED": "@GRAALPY_SYSCONFIG_LDSHARED_PYTHON_STRING@",
76+
"NM": "@GRAALPY_SYSCONFIG_NM_PYTHON_STRING@",
77+
"RANLIB": "@GRAALPY_SYSCONFIG_RANLIB_PYTHON_STRING@",
78+
}.items():
79+
if _value:
80+
build_time_vars[_key] = _value

graalpython/graalpy-versions/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ project(graalpy-versions LANGUAGES NONE)
3232
if (NOT DEFINED GRAALPY_VER)
3333
message(FATAL_ERROR "GRAALPY_VER needs to be set")
3434
endif()
35+
if (NOT DEFINED GRAALPY_ABIFLAGS)
36+
set(GRAALPY_ABIFLAGS "")
37+
endif()
3538

3639
# Generates file 'graalpy_versions' with the given content.
3740
# The file will be created if it does not exist and will only be updated if the
3841
# content changes.
39-
file(GENERATE OUTPUT "graalpy_versions" CONTENT "${GRAALPY_VER}")
42+
file(GENERATE OUTPUT "graalpy_versions" CONTENT "${GRAALPY_VER}\n${GRAALPY_ABIFLAGS}")

0 commit comments

Comments
 (0)