Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
98ea85e
Add ystdlib-cpp submodule
Bill-hbrhbr Feb 25, 2025
2086223
Migrate
Bill-hbrhbr Feb 25, 2025
f1b3f25
Fix cmake build flag
Bill-hbrhbr Feb 25, 2025
70b14a4
Update CMake option on ystdlib-cpp unit test building
Bill-hbrhbr Feb 26, 2025
4770e5e
Update ystdlib-cpp path
Bill-hbrhbr Mar 4, 2025
f1dade5
Update dependency taskfiles
Bill-hbrhbr Mar 4, 2025
7bdb0a4
Turn of unit test building
Bill-hbrhbr Mar 4, 2025
82ac7da
Remove unrelated changes
Bill-hbrhbr Mar 4, 2025
1ebaf19
Merge branch 'main' into migrate-error-handling
Bill-hbrhbr Mar 4, 2025
11fa690
fix task name
Bill-hbrhbr Mar 4, 2025
635ce2c
fix task name
Bill-hbrhbr Mar 4, 2025
2fc4567
Remove focal workflows
Bill-hbrhbr Mar 4, 2025
06b90fb
Upgrade macos to use appleclang16
Bill-hbrhbr Mar 4, 2025
e7b55eb
Update for macos-13
Bill-hbrhbr Mar 4, 2025
f04c65f
Move envs to deps:core
Bill-hbrhbr Mar 4, 2025
1c94f17
Allow env vars to pass in python scripts
Bill-hbrhbr Mar 4, 2025
53ca62a
Add env var to cli
Bill-hbrhbr Mar 4, 2025
0d0d25f
Update .github/workflows/clp-core-build-macos.yaml
Bill-hbrhbr Mar 4, 2025
af20a46
Remove workflow changes
Bill-hbrhbr Mar 12, 2025
df9b27b
Merge branch 'main' into migrate-error-handling
Bill-hbrhbr Mar 12, 2025
86670f4
Bump ystdlib-cpp version
Bill-hbrhbr Mar 12, 2025
5dee1f2
Update docs
Bill-hbrhbr Mar 12, 2025
0336667
Merge branch 'main' into migrate-error-handling
Bill-hbrhbr Mar 14, 2025
fbb896e
Upgrade dev utils
Bill-hbrhbr Mar 14, 2025
989afcb
Change option to set to prevent overriding
Bill-hbrhbr Mar 14, 2025
d2c6803
Undo source changes
Bill-hbrhbr Mar 14, 2025
9927121
Undo cmakelist change
Bill-hbrhbr Mar 14, 2025
631144b
Upgrade version
Bill-hbrhbr Mar 14, 2025
1e833d0
Merge branch 'main' into migrate-error-handling
Bill-hbrhbr Mar 16, 2025
e0e4ef6
Remove extra changes
Bill-hbrhbr Mar 16, 2025
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
19 changes: 19 additions & 0 deletions .github/workflows/clp-core-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,32 @@ jobs:
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*

- name: "Install coreutils (for md5sum) and Apple Clang 16 (for C++20)"
run: |-
brew install coreutils
brew install llvm@16

- name: "Install dependencies"
run: "./components/core/tools/scripts/lib_install/macos/install-all.sh"

- run: "./tools/scripts/deps-download/init.sh"
shell: "bash"

- run: "task deps:core"
env: >-
${{
'macos-14' == matrix.os
&& fromJson('{
"CC": "/opt/homebrew/opt/llvm@16/bin/clang",
"CXX": "/opt/homebrew/opt/llvm@16/bin/clang++"
}')
|| 'macos-13' == matrix.os
&& fromJson('{
"CC": "/usr/local/opt/llvm@16/bin/clang",
"CXX": "/user/local/opt/llvm@16/bin/clang++"
}')
|| fromJson('{}')
}}
shell: "bash"

- name: "Build CLP-core and run unit tests"
Expand Down
136 changes: 0 additions & 136 deletions .github/workflows/clp-core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
runs-on: "ubuntu-latest"
outputs:
centos_stream_9_image_changed: "${{steps.filter.outputs.centos_stream_9_image}}"
ubuntu_focal_image_changed: "${{steps.filter.outputs.ubuntu_focal_image}}"
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
clp_changed: "${{steps.filter.outputs.clp}}"
steps:
Expand Down Expand Up @@ -72,12 +71,6 @@ jobs:
- "components/core/tools/scripts/lib_install/*.sh"
- "components/core/tools/docker-images/clp-env-base-centos-stream-9/**"
- "components/core/tools/scripts/lib_install/centos-stream-9/**"
ubuntu_focal_image:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
- "components/core/tools/scripts/lib_install/*.sh"
- "components/core/tools/docker-images/clp-env-base-ubuntu-focal/**"
- "components/core/tools/scripts/lib_install/ubuntu-focal/**"
ubuntu_jammy_image:
- ".github/actions/**"
- ".github/workflows/clp-core-build.yaml"
Expand Down Expand Up @@ -122,31 +115,6 @@ jobs:
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
token: "${{secrets.GITHUB_TOKEN}}"

ubuntu-focal-deps-image:
if: "needs.filter-relevant-changes.outputs.ubuntu_focal_image_changed == 'true'"
needs: "filter-relevant-changes"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"

- uses: "./.github/actions/clp-core-build-containers"
env:
OS_NAME: "ubuntu-focal"
with:
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
docker_context: "components/core"
docker_file: "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}\
/Dockerfile"
push_deps_image: >-
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
token: "${{secrets.GITHUB_TOKEN}}"

ubuntu-jammy-deps-image:
if: "needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'true'"
needs: "filter-relevant-changes"
Expand Down Expand Up @@ -206,45 +174,6 @@ jobs:
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
upload_binaries: "false"

ubuntu-focal-binaries:
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
if: >-
success()
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
needs:
- "filter-relevant-changes"
- "ubuntu-focal-deps-image"
strategy:
matrix:
include:
- use_shared_libs: true
upload_binaries: false
- use_shared_libs: false
upload_binaries: true
name: "ubuntu-focal-${{matrix.use_shared_libs && 'dynamic' || 'static'}}-linked-bins"
continue-on-error: true
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"

- uses: "./.github/actions/clp-core-build"
env:
OS_NAME: "ubuntu-focal"
with:
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
use_shared_libs: "${{matrix.use_shared_libs}}"
use_published_image: >-
${{needs.filter-relevant-changes.outputs.ubuntu_focal_image_changed == 'false'
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
upload_binaries: "${{matrix.upload_binaries}}"
binaries_artifact_name: "${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"

ubuntu-jammy-binaries:
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
if: >-
Expand Down Expand Up @@ -278,68 +207,3 @@ jobs:
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
upload_binaries: "false"

ubuntu-focal-binaries-image:
# Run if the ancestor jobs were successful/skipped, building clp was successful, and this is a
# push to `main`.
if: >-
!cancelled()
&& !failure()
&& needs.ubuntu-focal-binaries.result == 'success'
&& github.event_name == 'push'
&& github.ref == 'refs/heads/main'
needs: "ubuntu-focal-binaries"
runs-on: "ubuntu-latest"
env:
OS_NAME: "ubuntu-focal"
TMP_OUTPUT_DIR: "/tmp"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Work around actions/runner-images/issues/6775"
run: "chown $(id -u):$(id -g) -R ."
shell: "bash"

- uses: "actions/download-artifact@v4"
with:
name: "${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
path: "${{env.TMP_OUTPUT_DIR}}/${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"

- name: "Untar binaries"
working-directory: >-
${{env.TMP_OUTPUT_DIR}}/${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}
run: |-
tar xf clp.tar
rm clp.tar

- uses: "docker/login-action@v3"
with:
registry: "ghcr.io"
username: "${{github.actor}}"
password: "${{secrets.GITHUB_TOKEN}}"

- name: "Sanitize the repo's name"
id: "sanitize_repo_name"
run: |-
# Docker doesn't support repository names with uppercase characters, so we convert to
# lowercase here.
lowercase_repo=$(echo '${{github.repository}}' | tr '[:upper:]' '[:lower:]')
echo "repository=${lowercase_repo}" >> "$GITHUB_OUTPUT"
shell: "bash"

- id: "core_image_meta"
uses: "docker/metadata-action@v5"
with:
images: >-
ghcr.io/${{steps.sanitize_repo_name.outputs.repository}}/clp-core-x86-${{env.OS_NAME}}
tags: "type=raw,value=${{github.ref_name}}"

- uses: "docker/build-push-action@v5"
with:
context: "${{env.TMP_OUTPUT_DIR}}/${{env.BINARIES_ARTIFACT_NAME_PREFIX}}${{env.OS_NAME}}"
file: "components/core/tools/docker-images/clp-core-${{env.OS_NAME}}/Dockerfile"
push: true
tags: "${{steps.core_image_meta.outputs.tags}}"
labels: "${{steps.core_image_meta.outputs.labels}}"
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
[submodule "components/core/submodules/utfcpp"]
path = components/core/submodules/utfcpp
url = https://github.com/nemtrif/utfcpp.git
[submodule "components/core/submodules/ystdlib-cpp"]
path = components/core/submodules/ystdlib-cpp
url = https://github.com/y-scope/ystdlib-cpp.git
3 changes: 2 additions & 1 deletion components/core/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ IncludeCategories:
# Library headers. Update when adding new libraries.
# NOTE: clang-format retains leading white-space on a line in violation of the YAML spec.
- Regex: "<(absl|antlr4|archive|boost|bsoncxx|catch2|curl|date|fmt|json|log_surgeon|lzma|mongocxx\
|msgpack|mysql|openssl|outcome|regex_utils|simdjson|spdlog|sqlite3|string_utils|yaml-cpp|zstd)"
|msgpack|mysql|openssl|outcome|regex_utils|simdjson|spdlog|sqlite3|string_utils|yaml-cpp|ystdlib\
|zstd)"
Priority: 3
# C system headers
- Regex: "^<.+\\.h>"
Expand Down
7 changes: 5 additions & 2 deletions components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ find_package(Threads REQUIRED)
# Add yaml-cpp
add_subdirectory(submodules/yaml-cpp EXCLUDE_FROM_ALL)

# Add ystdlib-cpp
option(YSTDLIB_CPP_BUILD_TESTING "" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change necessary, just a question for my own understanding.
Using option here someone could override this and build the tests for ystdlib-cpp right? (As opposed to using set which would enforce no tests built without editing the cmake scripts.)

Copy link
Contributor Author

@Bill-hbrhbr Bill-hbrhbr Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set(YSTDLIB_CPP_BUILD_TESTING OFF)
set(YSTDLIB_CPP_BUILD_TESTING ON CACHE BOOL "")
option(YSTDLIB_CPP_BUILD_TESTING "" ON)

Tried this code snippet. Neither cache setting can override the first line. So I guess

set(YSTDLIB_CPP_BUILD_TESTING OFF)

is good

add_subdirectory(submodules/ystdlib-cpp EXCLUDE_FROM_ALL)

# Find and setup ZStd Library
if(CLP_USE_STATIC_LIBS)
set(ZStd_USE_STATIC_LIBS ON)
Expand Down Expand Up @@ -436,7 +440,6 @@ set(SOURCE_FILES_unitTest
src/clp/DictionaryEntry.hpp
src/clp/DictionaryReader.hpp
src/clp/DictionaryWriter.hpp
src/clp/error_handling/ErrorCode.hpp
src/clp/EncodedVariableInterpreter.cpp
src/clp/EncodedVariableInterpreter.hpp
src/clp/ErrorCode.hpp
Expand Down Expand Up @@ -632,7 +635,6 @@ set(SOURCE_FILES_unitTest
tests/test-clp_s-search.cpp
tests/test-EncodedVariableInterpreter.cpp
tests/test-encoding_methods.cpp
tests/test-error_handling.cpp
tests/test-ffi_IrUnitHandlerInterface.cpp
tests/test-ffi_KeyValuePairLogEvent.cpp
tests/test-ffi_SchemaTree.cpp
Expand Down Expand Up @@ -689,6 +691,7 @@ target_link_libraries(unitTest
clp::regex_utils
clp::string_utils
yaml-cpp::yaml-cpp
ystdlib::error_handling
${LIBLZMA_LIBRARIES}
ZStd::ZStd
)
Expand Down
Loading
Loading