Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: '30 15 * * *'
- cron: '30 15 * * 6'

concurrency:
group: ${{format('{0}:{1}', github.repository, github.ref)}}
cancel-in-progress: true

jobs:
beman-submodule-check:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.7.3

preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.3
with:
matrix_config: >
[
Expand All @@ -29,12 +33,12 @@ jobs:
]

build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.7.3
with:
matrix_config: >
{
"gcc": [
{ "versions": ["15"],
{ "versions": ["16"],
"tests": [
{ "cxxversions": ["c++26"],
"tests": [
Expand All @@ -52,7 +56,7 @@ jobs:
}
]
},
{ "versions": ["14"],
{ "versions": ["15"],
"tests": [
{ "cxxversions": ["c++26", "c++23"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
Expand Down Expand Up @@ -110,4 +114,4 @@ jobs:
create-issue-when-fault:
needs: [preset-test, build-and-test]
if: failure() && github.event_name == 'schedule'
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.7.3
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
auto-update-pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.3.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@1.7.3
secrets:
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cmake-build-*
.cache
.vscode
.idea
.init
compile_commands.json
stagedir

Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"_release-base"
],
"cacheVariables": {
"BEMAN_USE_STD_MODULE": false,
"BEMAN_USE_STD_MODULE": true,
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/infra/cmake/llvm-libc++-toolchain.cmake"
},
"environment": {
Expand Down
46 changes: 46 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# GNUmakefile
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

MAKEFLAGS+= --no-builtin-rules # Disable the built-in implicit rules.
MAKEFLAGS+= --warn-undefined-variables # Warn when an undefined variable is referenced.
.SUFFIXES: # Disable all suffix rules.
##################################################

PRESET ?= release
IMAGE ?= linux-clang:23

.PHONY: all check distclean dockerbuild

# default target rule
all: .init compile_commands.json
cmake --workflow --preset $(PRESET)

.init: CMakeUserPresets.json CMakePresets.json CMakeLists.txt #NO! $(MAKEFILE)
cmake --preset $(PRESET) --fresh --log-level=VERBOSE
touch $@

check: .init compile_commands.json
compile_commands.json: build/$(PRESET)/compile_commands.json
ln -fs $< $@

CMakeUserPresets.json:: cmake/CMakeUserPresets.json
ln -fs $< $@

distclean:
rm -rf build .cache
rm -f CMakeUserPresets.json \
compile_commands.json \
.init
find . -name '*~' -delete

dockerbuild:
docker run -it -v $(CURDIR):/home/builder/workdir $(IMAGE)

# NOTE: double-colon targets which has no prerequisites must always remade by gmake?
# Prerequisite 'GNUmakefile' is newer than target '.init'.
# -> Must remake target '.init'.
# NOTE: impizit handled by gmake! GNUmakefile :: ;

# Anything we don't know how to build will use this rule.
% ::
ninja -C build/$(PRESET) $(@)
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ifeq (${hostSystemName},Darwin)
# export LDFLAGS=-L$(LLVM_DIR)/lib/c++ -lc++abi -lc++ # -lc++experimental
# export GCOV="llvm-cov gcov"

### TODO: to test g++-15:
### TODO: to test g++-16:
# export GCC_PREFIX:=$(shell brew --prefix gcc)
# export GCC_DIR:=$(shell realpath ${GCC_PREFIX})

Expand All @@ -63,16 +63,16 @@ ifeq (${hostSystemName},Darwin)
export CXX=clang++
CXXLIB=libc++
else
export CXX=g++-15
export CXX=g++-16
CXXLIB=libstdc++
endif
export CXX_FLAGS=-stdlib=$(CXXLIB)
endif
export GCOV="gcov"
else ifeq (${hostSystemName},Linux)
export LLVM_DIR=/usr/lib/llvm-20
export LLVM_DIR=/usr/lib/llvm-23
export PATH:=${LLVM_DIR}/bin:${PATH}
# export CXX=clang++-20
# NO! export CXX=clang++-23
else
export CXX=$(COMPILER)
endif
Expand Down
21 changes: 10 additions & 11 deletions cmake/prelude.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
# ---------------------------------------------------------------------------
# The CMAKE_EXPERIMENTAL_CXX_IMPORT_STD is not longer needed except for OSX
# ---------------------------------------------------------------------------
if(NOT BEMAN_USE_STD_MODULE OR CMAKE_VERSION VERSION_GREATER_EQUAL 4.4)
if(NOT BEMAN_USE_STD_MODULE OR CMAKE_VERSION VERSION_GREATER_EQUAL 4.5)
if(NOT APPLE)
return()
endif()
Expand All @@ -46,7 +46,7 @@ include(
)

if(NOT APPLE)
return()
# return()
endif()

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -83,8 +83,6 @@ if(
add_link_options(-L${LLVM_DIR}/lib/c++)
include_directories(SYSTEM ${LLVM_DIR}/include)

# /usr/local/Cellar/llvm/21.1.8_1/lib/c++/libc++.modules.json
# "/usr/local/Cellar/llvm/21.1.8_1/share/libc++/v1/std.cppm",
set(CMAKE_CXX_STDLIB_MODULES_JSON
${LLVM_DIR}/lib/c++/libc++.modules.json
)
Expand All @@ -105,18 +103,19 @@ if(
endif()

if(EXISTS ${CMAKE_CXX_STDLIB_MODULES_JSON})
message(
STATUS
"CMAKE_CXX_STDLIB_MODULES_JSON=${CMAKE_CXX_STDLIB_MODULES_JSON}"
)
file(REAL_PATH "${CMAKE_CXX_STDLIB_MODULES_JSON}" LLVM_MODULES)
message(STATUS "CMAKE_CXX_STDLIB_MODULES_JSON=${LLVM_MODULES}")
# gersemi: off
set(CACHE{CMAKE_CXX_STDLIB_MODULES_JSON}
TYPE FILEPATH
HELP "Result of: clang++ -print-file-name=c++/libc++.modules.json"
VALUE ${CMAKE_CXX_STDLIB_MODULES_JSON}
HELP "Result of: clang++ -print-file-name=libc++.modules.json"
VALUE ${LLVM_MODULES}
)
# gersemi: on
else()
message(STATUS "File does NOT EXISTS! ${CMAKE_CXX_STDLIB_MODULES_JSON}")
message(
WARNING
"File does NOT EXISTS! ${CMAKE_CXX_STDLIB_MODULES_JSON}"
)
endif()
endif()
2 changes: 1 addition & 1 deletion infra/.beman_submodule
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=7b66b858d7f48428fca936184aef2bd246ccc81a
commit_hash=7fc85e2e26cb491926ca2744c359c2aa7ea8fd27
6 changes: 5 additions & 1 deletion infra/cmake/enable-experimental-import-std.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.3.0")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.4.0")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"f35a9ac6-8463-4d38-8eec-5d6008153e7d"
)
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "4.3.0")
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD
"451f2fe2-a8a2-47c3-bc32-94786d8fc91b"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/beman/execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ foreach(test ${execution_tests})
endforeach()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
return()
# TODO(CK): return()
endif()

#======================================================================
Expand Down
Loading