Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ffd0afe
mv some things
AshFungor May 1, 2025
cfb4135
some templates
AshFungor May 2, 2025
5ca6d3f
moving and renaming things
AshFungor May 3, 2025
c96ebba
some more mods
AshFungor May 3, 2025
3713ec4
pog is being refactored
AshFungor May 3, 2025
3327f76
more renames
AshFungor May 4, 2025
d8ab0e0
too lazy to add ignore revisions here
AshFungor May 5, 2025
82cf8ed
src finished
AshFungor May 8, 2025
78092d9
adjusted testing & docker image
AshFungor May 9, 2025
63312ca
bazelrc
AshFungor May 9, 2025
42eda09
add wget
AshFungor May 9, 2025
1bf9792
add missing args
AshFungor May 9, 2025
f9b5a6e
midnight fixes
AshFungor May 9, 2025
03cc487
try this
AshFungor May 9, 2025
69f4b4c
it broke my build
AshFungor May 9, 2025
37bf00b
hop this works
AshFungor May 9, 2025
8cacf91
i am template god
AshFungor May 9, 2025
940dbb5
gtest
AshFungor May 9, 2025
7ea4d0b
i love fixtures
AshFungor May 9, 2025
b2f30b3
gtest
AshFungor May 9, 2025
cb274a7
remove this for now
AshFungor May 9, 2025
2816b0b
'Fix' integration tests - libfmt linkage fix required
HyperWinX May 9, 2025
ad32389
added versioning
AshFungor May 10, 2025
64fbb2a
renew incrementor script
AshFungor May 10, 2025
8263ee7
fix linking
AshFungor May 10, 2025
b459cb9
refactor stuff a little
AshFungor May 10, 2025
80f9f10
added modular tests
AshFungor May 10, 2025
ee0ec1f
run formatter & patched ci
AshFungor May 10, 2025
0b13bb2
opt should not be strict
AshFungor May 10, 2025
a64a3d7
Fix all tests
HyperWinX May 11, 2025
536e187
Fix all warnings
HyperWinX May 11, 2025
c3095f5
Fix dockerfiles (remove custom user creation) and add temporary workf…
HyperWinX May 11, 2025
cd08ccf
fix ci
AshFungor May 11, 2025
6e41a2a
Add awk to fedora dockerfile
HyperWinX May 11, 2025
5965748
patch docker
AshFungor May 11, 2025
10576fb
Fix dockerfiles - add bazelisk tag
HyperWinX May 12, 2025
0b43bb7
List cmake as conan dependency
HyperWinX May 12, 2025
72c29fb
Fix alpine build
HyperWinX May 12, 2025
79d0f7c
Temporarily disable Alpine for distro-ci workflow
HyperWinX May 12, 2025
b4434e4
Temporarily disable Gentoo Musl for distro-ci workflow
HyperWinX May 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 49 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Make Bazel print out all options from rc files
common --announce_rc

# Verbose test output
common --test_summary=detailed
# Stream test results to stdout
common --test_output=streamed

# We use 23 standard
build:linux --cxxopt=-std=c++23
# Include: source directory
build:linux --cxxopt=-iquote --cxxopt=src
# Essential warnings
build:linux --cxxopt=-Wall
# Extra warnings
build:linux --cxxopt=-Wextra
# TODO: document the rest
build:linux --cxxopt=-Wno-pointer-arith
build:linux --cxxopt=-Wno-unused-const-variable
build:linux --cxxopt=-Wno-missing-field-initializers
build:linux --cxxopt=-Wno-stringop-overflow

# LTO, see: https://gcc.gnu.org/wiki/LinkTimeOptimization
# TODO: make conan build all dependencies with LTO - right now triggers "final link failed: bad value" errors
# build:linux --cxxopt=-flto
# build:linux --linkopt=-flto

# Optimize for native (host) architecture
# Be warned - might break distribution builds
build:linux-fragile --config=linux
build:linux-fragile --cxxopt=-march=native

# Treat warnings as errors should be enabled optionally
build:linux-strict --config=linux
build:linux-strict --cxxopt=-Werror

# --- Build configurations ---
# Linux, Debug
build:linux-dbg --compilation_mode dbg
build:linux-dbg --config=linux-fragile
build:linux-dbg --cxxopt=-ggdb3
# Linux, Release
build:linux-opt --compilation_mode opt
build:linux-opt --config=linux
build:linux-opt --cxxopt=-O3
# ----------------------------

# Distro-specific configurations
# ...
4 changes: 4 additions & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
8.2.1
# The first line of this file is used by Bazelisk and Bazel to be sure
# the right version of Bazel is used to build and test this repo.
# This also defines which version is used on CI.
33 changes: 33 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,-modernize-use-trailing-return-type'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: google
CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: '1'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
26 changes: 12 additions & 14 deletions .github/workflows/distro-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
container: hyperwin/hcpu-ci:${{ matrix.config.tag }}
container:
image: hyperwin/hcpu-ci:${{ matrix.config.tag }}
# see https://github.com/bazelbuild/bazel/issues/13823
options: --init
name: "Build on ${{matrix.config.name}}"
strategy:
matrix:
Expand All @@ -26,13 +29,13 @@ jobs:
name: Arch Linux
- tag: gentoo-glibc
name: Gentoo GLibc
- tag: gentoo-musl
name: Gentoo Musl
- tag: alpine
name: Alpine
# - tag: gentoo-musl
# name: Gentoo Musl
# - tag: alpine
# name: Alpine
- tag: ubuntu
name: Ubuntu

steps:
- run: |
set -e
Expand All @@ -43,11 +46,6 @@ jobs:
git clone https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git && cd HyperCPU
git checkout ${{ github.event.pull_request.head.sha }}
git submodule update --init --recursive

python3 scripts/build.py -icb \
--config Release \
--config Debug \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=g++ \
-D CMAKE_CXX_COMPILER:STRING=gcc \
--profiles-detection

conan profile detect && conan install . --build=cmake --build=missing
bazelisk build //src/... //tests/... --config=linux-opt
39 changes: 15 additions & 24 deletions .github/workflows/run-tests-feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,28 @@ on:
jobs:
testing:
runs-on: ubuntu-latest
container: hyperwin/hcpu-ci:debian-unstable
container:
image: hyperwin/hcpu-ci:debian-unstable
# see https://github.com/bazelbuild/bazel/issues/13823
options: --init
if: (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev') || !contains(github.event.head_commit.message, '[ci skip]')

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build and test with GCC on Release profile
submodules: "true"

- name: Install conan dependecies
run: |
python3 scripts/build.py -icb \
--config Release \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=g++ \
-D CMAKE_C_COMPILER:STRING=gcc \
--profiles-detection
cd build/Release && ctest -V && cd ../..
python3 scripts/build.py -r --config Release --build-dir build

- name: Build and test with LLVM on Release profile
conan profile detect && conan install . --build=missing

- name: Build and test with GCC on Release profile
run: |
python3 scripts/build.py -icb \
--config Release \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=clang++-19 \
-D CMAKE_C_COMPILER:STRING=clang-19 \
--profiles-detection
cd build/Release && ctest -V && cd ../..
python3 scripts/build.py -r --config Release --build-dir build
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=gcc
bazelisk clean --expunge

- name: Cleanup (Conan cache + leftovers in build)
- name: Build and test with LLVM on Release profile
run: |
rm -r build/
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=clang
bazelisk clean --expunge
57 changes: 18 additions & 39 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,38 @@ on:
jobs:
testing:
runs-on: ubuntu-latest
container: hyperwin/hcpu-ci:debian-unstable
container:
image: hyperwin/hcpu-ci:debian-unstable
# see https://github.com/bazelbuild/bazel/issues/13823
options: --init
name: Run full test suite

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'

submodules: "true"

- name: Install conan dependecies
run: |
conan profile detect && conan install . --build=missing

- name: Build and test with GCC on Debug profile
run: |
python3 scripts/build.py -icb \
--config Debug \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=g++ \
-D CMAKE_C_COMPILER:STRING=gcc \
--profiles-detection
cd build/Debug && ctest -V && cd ../..
python3 scripts/build.py -r --config Debug --build-dir build
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=gcc
bazelisk clean --expunge

- name: Build and test with GCC on Release profile
run: |
python3 scripts/build.py -icb \
--config Release \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=g++ \
-D CMAKE_C_COMPILER:STRING=gcc \
--profiles-detection
cd build/Release && ctest -V && cd ../..
python3 scripts/build.py -r --config Release --build-dir build
bazelisk test //src/... //tests/... --config=linux-opt --compiler=gcc
bazelisk clean --expunge

- name: Build and test with LLVM on Debug profile
run: |
python3 scripts/build.py -icb \
--config Debug \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=clang++-19 \
-D CMAKE_C_COMPILER:STRING=clang-19 \
--profiles-detection
cd build/Debug && ctest -V && cd ../..
python3 scripts/build.py -r --config Debug --build-dir build
bazelisk test //src/... //tests/... --config=linux-dbg --compiler=clang
bazelisk clean --expunge

- name: Build and test with LLVM on Release profile
run: |
python3 scripts/build.py -icb \
--config Release \
--build-dir build \
-D CMAKE_CXX_COMPILER:STRING=clang++-19 \
-D CMAKE_C_COMPILER:STRING=clang-19 \
--profiles-detection
cd build/Release && ctest -V && cd ../..
python3 scripts/build.py -r --config Release --build-dir build

- name: Cleanup (Conan cache + leftovers in build)
run: |
rm -r build/
bazelisk test //src/... //tests/... --config=linux-opt --compiler=clang
bazelisk clean --expunge
25 changes: 13 additions & 12 deletions .github/workflows/version-increment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ on:
jobs:
versioning-patch-increment:
runs-on: ubuntu-latest
container: hyperwin/hcpu-ci:debian-unstable
container:
image: hyperwin/hcpu-ci:debian-unstable
options: --user root
if: "contains(github.event.head_commit.message, '[ci patch inc]')"
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
fetch-depth: "0"

- name: Setup git user
uses: fregante/setup-git-user@v1

- name: Increment version
- name: Increment version (patch)
run: |
scripts/increment_patch.sh
tools/increment_version.py --increment patch

- name: Push changes to master branch
run: |
git config --global --add safe.directory '*'
Expand All @@ -39,24 +41,23 @@ jobs:
if: "contains(github.event.head_commit.message, '[ci minor inc]')"
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
fetch-depth: "0"

- name: Setup git user
uses: fregante/setup-git-user@v1

- name: Increment version
- name: Increment version (minor)
run: |
scripts/increment_minor.sh
tools/increment_version.py --increment minor

- name: Push changes to master branch
run: |
git config --global --add safe.directory '*'
git add .
git commit -m "[auto]: Increment minor version"
git push origin master

11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,15 @@ CMakeUserPresets*

# Distribution packages
dist/*
!dist/BUILD.bazel
!dist/CMakeLists.txt

# Bazel stuff
*.lock

# Conan toolchain generated for Bazel
conan/

# Bazel builds with four directories, see for info:
# https://bazel.build/remote/output-directories
bazel-*
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dist/HPool"]
path = dist/HPool
url = https://github.com/randommfs/HPool
[submodule "dist/libunwind"]
path = dist/libunwind
url = https://github.com/libunwind/libunwind
41 changes: 41 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"Top level build configuration, use for tooling only"

load("@aspect_rules_lint//format:defs.bzl", "format_multirun")
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")

package(
default_visibility = [
"//visibility:private",
],
)

config_setting(
name = "linux",
constraint_values = ["@platforms//os:linux"],
)

refresh_compile_commands(
name = "refresh_compile_commands",
targets = {
"//src/...": "--config=linux-dbg",
"//tests/...": "--config=linux-dbg",
},
# I hope they will support this at some point
# targets = select(
# {
# ':linux': {
# '//src/...': '--config=linux-dbg',
# '//tests/...': '--config=linux-dbg'
# }
# },
# no_match_error = 'Could not determine host OS toolchain flags, running this target is pointless'
# )
)

format_multirun(
name = "format",
cc = "@llvm_toolchain//:bin/clang-format",
print_command = True,
python = "@aspect_rules_lint//format:ruff",
starlark = "@buildifier_prebuilt//:buildifier",
)
Loading
Loading