Skip to content

Commit 262c2eb

Browse files
authored
CI: build debug wheels (#412)
- Added support for building Debug wheels - storm_build_type() returns build type
1 parent 2b5efce commit 262c2eb

8 files changed

Lines changed: 50 additions & 15 deletions

File tree

.github/workflows/before-all-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ git clone https://github.com/stormchecker/storm.git -b ${STORM_VERSION}
2424
cd storm
2525
mkdir build
2626
cd build
27-
cmake .. -DSTORM_BUILD_TESTS=OFF -DSTORM_BUILD_EXECUTABLES=OFF -DSTORM_PORTABLE=ON
27+
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} -DSTORM_BUILD_TESTS=OFF -DSTORM_BUILD_EXECUTABLES=OFF -DSTORM_PORTABLE=ON
2828
make -j ${NR_JOBS}
2929
make install
3030
cd ..

.github/workflows/before-all-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ git clone https://github.com/stormchecker/storm.git -b ${STORM_VERSION}
1111
cd storm
1212
mkdir build
1313
cd build
14-
cmake .. -DSTORM_BUILD_TESTS=OFF -DSTORM_BUILD_EXECUTABLES=OFF -DSTORM_PORTABLE=ON
14+
cmake .. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} -DSTORM_BUILD_TESTS=OFF -DSTORM_BUILD_EXECUTABLES=OFF -DSTORM_PORTABLE=ON
1515
make -j ${NR_JOBS}
1616
sudo chown runner:admin /usr/local/ # Permission differ in macOS 14, see https://github.com/actions/runner-images/issues/9272
1717
make install

.github/workflows/create_wheel.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ on:
1414
required: true
1515
type: string
1616
default: 'x.y.z'
17-
dev_version:
18-
description: 'Whether to build a development version for only selected Python versions'
17+
full_build:
18+
description: 'Build for all Python versions (if false, 3.13 and 3.14 only)'
1919
required: true
2020
type: boolean
2121
default: false
22+
build_type:
23+
description: 'Build configuration (Release/Debug)'
24+
required: false
25+
type: string
26+
default: 'Release'
2227
repo:
2328
description: 'Repository to build from (owner/name)'
2429
required: false
@@ -43,11 +48,16 @@ on:
4348
required: true
4449
type: string
4550
default: 'x.y.z'
46-
dev_version:
47-
description: 'Whether to build a development version for only selected Python versions'
51+
full_build:
52+
description: 'Build for all Python versions (if false, 3.13 and 3.14 only)'
4853
required: true
4954
type: boolean
5055
default: false
56+
build_type:
57+
description: 'Build configuration (Release/Debug)'
58+
required: false
59+
type: string
60+
default: 'Release'
5161
repo:
5262
description: 'Repository to build from (owner/name)'
5363
required: false
@@ -104,26 +114,34 @@ jobs:
104114
- name: Prepare version
105115
run: perl -i -pe 's/__version__ = "[^"]+"/__version__ = "'"${{ inputs.version }}"'"/' lib/stormpy/_version.py
106116
- name: Build wheels (development)
107-
if: ${{ inputs.dev_version }}
117+
if: ${{ !inputs.full_build }}
108118
uses: pypa/cibuildwheel@v3.4.1
109119
env:
110120
CIBW_PLATFORM: ${{ matrix.platform }}
111121
CIBW_ARCHS: ${{ matrix.archs }}
112122
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deploy_target }}
113123
# Build development version only on latest Python versions
114124
CIBW_BUILD: "cp313-* cp314-*"
115-
CIBW_ENVIRONMENT: STORM_VERSION=${{ inputs.storm_version }} NR_JOBS=4
125+
CIBW_CONFIG_SETTINGS: cmake.build-type=${{ inputs.build_type }}
126+
CIBW_ENVIRONMENT: >-
127+
STORM_VERSION=${{ inputs.storm_version }}
128+
NR_JOBS=4
129+
CMAKE_BUILD_TYPE=${{ inputs.build_type }}
116130
- name: Build wheels (stable)
117-
if: ${{ !inputs.dev_version }}
131+
if: ${{ inputs.full_build }}
118132
uses: pypa/cibuildwheel@v3.4.1
119133
env:
120134
CIBW_PLATFORM: ${{ matrix.platform }}
121135
CIBW_ARCHS: ${{ matrix.archs }}
122136
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deploy_target }}
123-
CIBW_ENVIRONMENT: STORM_VERSION=${{ inputs.storm_version }} NR_JOBS=4
137+
CIBW_CONFIG_SETTINGS: cmake.build-type=${{ inputs.build_type }}
138+
CIBW_ENVIRONMENT: >-
139+
STORM_VERSION=${{ inputs.storm_version }}
140+
NR_JOBS=4
141+
CMAKE_BUILD_TYPE=${{ inputs.build_type }}
124142
- uses: actions/upload-artifact@v7
125143
with:
126-
name: stormpy-wheels-${{ matrix.os }}
144+
name: stormpy-wheels-${{ matrix.os }}-${{ inputs.build_type }}
127145
path: ./wheelhouse/*.whl
128146

129147

@@ -177,7 +195,7 @@ jobs:
177195
steps:
178196
- uses: actions/download-artifact@v8
179197
with:
180-
pattern: stormpy-wheels-${{ matrix.arch.name }}
198+
pattern: stormpy-wheels-${{ matrix.arch.name }}-${{ inputs.build_type }}
181199
path: dist
182200
merge-multiple: true
183201
- name: Checkout test files (default current repo)
@@ -266,7 +284,7 @@ jobs:
266284
xcode-version: ${{ matrix.distro.xcode }}
267285
- uses: actions/download-artifact@v8
268286
with:
269-
pattern: stormpy-wheels-${{ matrix.distro.os }}
287+
pattern: stormpy-wheels-${{ matrix.distro.os }}-${{ inputs.build_type }}
270288
path: dist
271289
merge-multiple: true
272290
- name: Install from wheel

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373
with:
7474
storm_version: ${{ needs.env_storm_version.outputs.storm_version }}
7575
version: ${{ github.event.release.tag_name }}
76-
dev_version: false
76+
full_build: true
77+
build_type: Release
7778
secrets: inherit
7879

7980
upload_pypi:

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,9 @@ endif()
225225
# Set number types from Carl
226226
set_variable_string(STORM_USE_CLN_EA_BOOL ${STORM_USE_CLN_EA})
227227
set_variable_string(STORM_USE_CLN_RF_BOOL ${STORM_USE_CLN_RF})
228-
set_variable_string(STORMPY_PRETEND_FETCH ${STORMPY_INFO_PRETEND_FETCH})
229228
set_variable_string(STORM_DEVELOPER_VERSION ${STORM_VERSION_DEV})
229+
set(STORM_BUILD_TYPE "\"${CMAKE_BUILD_TYPE}\"")
230+
set_variable_string(STORMPY_PRETEND_FETCH ${STORMPY_INFO_PRETEND_FETCH})
230231
if (STORM_FETCHED_FROM_REPO)
231232
set(STORM_ORIGIN_REPO "\"${STORM_FETCHED_FROM_REPO}\"")
232233
else()

cmake/info_config.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
STORM_VERSION = "@STORM_VERSION@"
44
STORM_DEVELOPER_VERSION = @STORM_DEVELOPER_VERSION@
5+
STORM_BUILD_TYPE = @STORM_BUILD_TYPE@
56
STORM_DIRECTORY = @STORM_DIR@
67
STORM_ORIGIN_REPO = @STORM_ORIGIN_REPO@
78
STORM_ORIGIN_TAG = @STORM_ORIGIN_TAG@

lib/stormpy/info/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ def storm_development_version() -> bool:
3232
return _config.STORM_DEVELOPER_VERSION
3333

3434

35+
def storm_build_type() -> str:
36+
"""
37+
Get the build type of stormpy (e.g. Release, Debug).
38+
39+
:return: Build type string
40+
:rtype: str
41+
"""
42+
return _config.STORM_BUILD_TYPE
43+
44+
3545
def storm_origin_info() -> [str | None, str | None]:
3646
"""
3747
Information about the source of Storm: the repo path, the repo tag and commit hash.

tests/info/test_info.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def test_version_equal(self):
1111
assert stormpy.info.storm_version() in stormpy.info.Version.short
1212
assert (stormpy.info.Version.development and stormpy.info.Version.short.endswith(" (dev)")) or not stormpy.info.Version.development
1313

14+
def test_build_type(self):
15+
bt = stormpy.info.storm_build_type()
16+
assert bt in ("Debug", "Release")
17+
1418
def test_origin_info(self):
1519
repo, tag, h = stormpy.info.storm_origin_info()
1620
assert repo is None or isinstance(repo, str)

0 commit comments

Comments
 (0)