Skip to content

Commit ac26c57

Browse files
authored
Merge pull request #616 from lukaszstolarczuk/update-versioning
[CMake] Update versioning
2 parents cb6b8bb + f1cb2bc commit ac26c57

29 files changed

+295
-99
lines changed

.github/workflows/bandit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
with:
28+
fetch-depth: 0
2729

2830
- name: Install Bandit
2931
run: python3 -m pip install bandit

.github/workflows/basic.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
steps:
7575
- name: Checkout
7676
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
77+
with:
78+
fetch-depth: 0
7779

7880
- name: Install apt packages
7981
run: |
@@ -180,6 +182,8 @@ jobs:
180182
steps:
181183
- name: Checkout
182184
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
185+
with:
186+
fetch-depth: 0
183187

184188
- name: Initialize vcpkg
185189
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
@@ -250,6 +254,8 @@ jobs:
250254
steps:
251255
- name: Checkout
252256
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
257+
with:
258+
fetch-depth: 0
253259

254260
- name: Configure build
255261
run: >
@@ -290,6 +296,8 @@ jobs:
290296
steps:
291297
- name: Checkout
292298
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
299+
with:
300+
fetch-depth: 0
293301

294302
- name: Configure build
295303
run: >
@@ -325,6 +333,8 @@ jobs:
325333
steps:
326334
- name: Checkout
327335
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
336+
with:
337+
fetch-depth: 0
328338

329339
- name: Install Python requirements
330340
run: python3 -m pip install -r third_party/requirements.txt

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30+
with:
31+
fetch-depth: 0
3032

3133
- name: Install apt packages
3234
if: matrix.os == 'ubuntu-latest'

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
steps:
4444
- name: Checkout repository
4545
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
with:
47+
fetch-depth: 0
4648

4749
- name: Initialize CodeQL
4850
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2

.github/workflows/coverity.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2525
with:
2626
ref: ${{ github.ref }}
27+
fetch-depth: 0
2728

2829
- name: Install apt packages
2930
run: |

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24+
with:
25+
fetch-depth: 0
2426

2527
- name: Install doxygen
2628
run: |

.github/workflows/fast.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
steps:
6060
- name: Checkout repository
6161
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
62+
with:
63+
fetch-depth: 0
6264

6365
- name: Initialize vcpkg
6466
if: matrix.os == 'windows-latest'
@@ -139,3 +141,11 @@ jobs:
139141
if: matrix.os == 'windows-latest'
140142
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/Release/umf_proxy.dll
141143
shell: pwsh
144+
145+
# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
146+
# ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details
147+
- name: Print metadata of our dll's
148+
if: matrix.os == 'windows-latest'
149+
run: |
150+
get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
151+
get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list

.github/workflows/gpu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
39+
with:
40+
fetch-depth: 0
3941

4042
- name: Get information about platform
4143
if: matrix.os == 'Ubuntu'

.github/workflows/multi_numa.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
with:
24+
fetch-depth: 0
2325

2426
- name: Get information about platform
2527
run: .github/scripts/get_system_info.sh

.github/workflows/nightly.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
with:
28+
fetch-depth: 0
2729

2830
- name: Install apt packages
2931
run: |
@@ -59,6 +61,8 @@ jobs:
5961
steps:
6062
- name: Checkout repository
6163
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
64+
with:
65+
fetch-depth: 0
6266

6367
- name: Install apt packages
6468
run: |

.github/workflows/pr_push.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
with:
26+
fetch-depth: 0
2527

2628
- name: Install apt packages
2729
run: |
@@ -55,6 +57,8 @@ jobs:
5557
steps:
5658
- name: Checkout repository
5759
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
60+
with:
61+
fetch-depth: 0
5862

5963
- name: Install doxygen
6064
run: |

.github/workflows/proxy_lib.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
with:
29+
fetch-depth: 0
2830

2931
- name: Install apt packages
3032
run: |

.github/workflows/qemu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
with:
21+
fetch-depth: 0
22+
2023
- name: Enable KVM
2124
run: |
2225
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules

.github/workflows/sanitizers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Install apt packages
2830
run: |
@@ -88,6 +90,8 @@ jobs:
8890
steps:
8991
- name: Checkout
9092
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
93+
with:
94+
fetch-depth: 0
9195

9296
# Use the latest MSVC toolset available, when compiling UMF with ASan.
9397
# Running binaries compiled with older toolsets results in a

.github/workflows/scorecard.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30+
with:
31+
fetch-depth: 0
3032

3133
- name: Run analysis
3234
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1

.github/workflows/spellcheck.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
17+
with:
18+
fetch-depth: 0
1719

1820
- name: Run a spell check
1921
uses: crate-ci/typos@b63f421581dce830bda2f597a678cb7776b41877 # v1.18.2

.github/workflows/trivy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
steps:
3232
- name: Clone the git repo
3333
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
34+
with:
35+
fetch-depth: 0
3436

3537
- name: Run Trivy
3638
uses: aquasecurity/trivy-action@84384bd6e777ef152729993b8145ea352e9dd3ef # v0.17.0

.github/workflows/valgrind.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
with:
21+
fetch-depth: 0
2022

2123
- name: Install apt packages
2224
run: |

CMakeLists.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,35 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

55
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
6-
project(
7-
umf
8-
VERSION 0.1.0
9-
LANGUAGES C)
10-
116
# needed when UMF is used as an external project
127
set(UMF_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
138

149
list(APPEND CMAKE_MODULE_PATH "${UMF_CMAKE_SOURCE_DIR}/cmake")
15-
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
10+
include(helpers)
11+
12+
# We use semver aligned version, set via git tags. We parse git output to
13+
# establih the version of UMF to be used in CMake, Win dll's, and within the
14+
# code (e.g. in logger). We have 3-component releases (e.g. 1.5.1) plus release
15+
# candidates and git info. Function below sets all variables related to version.
16+
set_version_variables()
17+
message(STATUS "UMF version: ${UMF_VERSION}")
18+
19+
# version we set in CMake is abbreviated just to major.minor.patch
20+
project(
21+
umf
22+
VERSION ${UMF_CMAKE_VERSION}
23+
LANGUAGES C)
24+
25+
if(CMAKE_PROJECT_VERSION_PATCH GREATER 0)
26+
# set extra variable for Windows dll metadata
27+
set(UMF_VERSION_BUGFIX 1)
28+
endif()
1629

1730
include(CTest)
1831
include(CMakePackageConfigHelpers)
1932
include(GNUInstallDirs)
2033
find_package(PkgConfig)
2134

22-
# CMAKE_PROJECT_VERSION[_MAJOR|_MINOR|_PATCH] variables are set via 'project'
23-
# command. They cannot contain any "pre-release" part, though. We use custom
24-
# "UMF_SRC_VERSION" to store more accurate (source) version - this var should be
25-
# used, e.g., for creating packages.
26-
set_source_version()
27-
message(
28-
STATUS
29-
"UMF version: ${CMAKE_PROJECT_VERSION} (source version: ${UMF_SRC_VERSION})"
30-
)
31-
3235
# Build Options
3336
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF)
3437
option(UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON)

RELEASE_STEPS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Do changes for a release:
4040
- Add an entry to ChangeLog, remember to change the day of the week in the release date
4141
- For major releases mention API and ABI compatibility with the previous release
4242
- Update project's version in a few places:
43-
- Set the new $VERSION in `project` function in the top-level `CMakeLists.txt`
43+
- For major and minor releases: `UMF_VERSION_CURRENT` in `include/umf/base.h` (the API version)
4444
- `release` variable in `scripts/docs_config/conf.py` (for docs)
4545
- `UMF_VERSION` variable in `.github/workflows/basic.yml` (for installation test)
4646
- For major releases update ABI version in `.map` and `.def` files

0 commit comments

Comments
 (0)