Skip to content

Commit

Permalink
Add conan.lock file to lock dependencies when using conan
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoltes committed Jun 16, 2024
1 parent de8b49a commit ada1c88
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ jobs:
docker build --tag apache/celix-conan-build:latest --target conan-build --file .devcontainer/Containerfile .
- name: Build Celix dependencies
run: |
mkdir -p ~/.conan2 && \
docker run --rm -v ~/.conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
"cd /workspace && \
mkdir -p .conan2 && \
docker run --rm -v .conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
"conan profile detect && \
cd /workspace && \
conan install . --build missing --options build_all=True --options enable_address_sanitizer=True \
--options enable_testing=True --options enable_ccache=True --output-folder build \
--conf tools.cmake.cmaketoolchain:generator=Ninja"
- name: Build Celix
run: |
docker run --rm -v ~/.conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
docker run --rm -v .conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
"cd /workspace && \
conan build . --build missing --options build_all=True --options enable_address_sanitizer=True \
--options enable_testing=True --options enable_ccache=True --output-folder build \
--conf tools.cmake.cmaketoolchain:generator=Ninja --settings build_type=Debug"
- name: Test Celix
run: |
docker run --rm -v ~/.conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
docker run --rm -v .conan2:/root/.conan2 -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \
"cd /workspace/build && \
source conanrun.sh && \
ctest --output-on-failure"
Expand All @@ -51,7 +52,7 @@ jobs:
"mkdir /workspace/build && cd /workspace/build && \
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXPERIMENTAL=ON -DENABLE_TESTING=ON -DRSA_JSON_RPC=ON \
-DRSA_REMOTE_SERVICE_ADMIN_SHM_V2=ON -DENABLE_CCACHE=ON .. && \
make -j &&"
make -j"
- name: Test Celix
run: |
docker run --rm -v $(pwd):/workspace apache/celix-apt-build:latest /bin/bash -c \
Expand Down
41 changes: 41 additions & 0 deletions conan.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "0.5",
"requires": [
"zstd/1.5.5#1f239731dc45147c7fc2f54bfbde73df%1715599909.17",
"zlib/1.2.13#4e74ebf1361fe6fb60326f473f276eb5%1705999194.457",
"xz_utils/5.4.5#51e5a6e6564f4ea3afd79def01f035ad%1712043875.075",
"util-linux-libuuid/2.39.2#339f80aea7e5cf507b5b9839a128909f%1704959804.303",
"rapidjson/1.1.0#9f5e39d1f4a6b67d48c6a343c4592f32%1705070241.006",
"openssl/3.2.2#899583c694f9deccec74dbe0bbc65a15%1717540517.968",
"mdnsresponder/1310.140.1#5116b98dc767ebb2ea48a2a584a365b4%1686542086.05",
"libzip/1.10.1#502a2dde4cadffadd89a63e9bd824b08%1701463072.681",
"libxml2/2.12.7#737a1eba03113d1aa22d67579ced7d5e%1717577274.077",
"libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd%1707122814.387",
"libffi/3.4.6#21f87d4a555c33a87a8dc87c58570407%1712271678.82",
"libcurl/8.8.0#9170903d66d6f6e6795fbb566a403129%1718115143.514",
"jansson/2.14#42fc601d5b8e236e050e48f2321ef851%1676235093.781",
"gtest/1.10.0#b58a214095fea571a44c2b19dff70711%1715096215.707",
"civetweb/1.16#fbdec252dc18b011fcd68d0663054ed8%1717493460.975",
"bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4%1703591832.799"
],
"build_requires": [
"zstd/1.5.5#1f239731dc45147c7fc2f54bfbde73df%1715599909.17",
"pkgconf/2.1.0#27f44583701117b571307cf5b5fe5605%1701537936.436",
"ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21%1684431244.21",
"meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19%1702568761.764",
"m4/1.4.19#b38ced39a01e31fef5435bc634461fd2%1700758725.451",
"libtool/2.4.7#08316dad5c72c541ed21e039e4cf217b%1702300906.107",
"hiredis/1.1.0#4dc0176dbbd4e4257a0db69d0e2047b0%1707834163.397",
"gnu-config/cci.20210814#dc430d754f465e8c74463019672fb97b%1701248168.479",
"cmake/3.29.5#56dbff3ff8af6bcd4b9c170fbd4da068%1717779530.555",
"ccache/4.7.4#83eaaa1059cdc33a90eb35249e1df6fb%1689758368.487",
"automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50%1688481772.751",
"autoconf/2.71#f9307992909d7fb3df459340f1932809%1711983104.648"
],
"python_requires": [],
"overrides": {
"zlib/[>=1.2.11 <2]": [
"zlib/1.2.13"
]
}
}
19 changes: 17 additions & 2 deletions documents/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This document outlines the recommended coding conventions for Apache Celix devel
formatting, comments, control structures, functions and error handling.

Note that not all existing code adheres to these conventions.
New code should adhere to these conventions and when possible, existing code should be updated to adhere to these
New code should adhere to these conventions, and when possible, existing code should be updated to adhere to these
conventions.

## Naming Conventions
Expand Down Expand Up @@ -447,7 +447,6 @@ set(MY_LIB_PRIVATE_LIBS ...)
add_library(my_lib SHARED ${MY_LIB_SOURCES})
target_link_libraries(my_lib PUBLIC ${MY_LIB_PUBLIC_LIBS} PRIVATE ${MY_LIB_PRIVATE_LIBS})
celix_target_hide_symbols(my_lib)
...
if (ENABLE_TESTING)
add_library(my_lib_cut STATIC ${MY_LIB_SOURCES})
Expand Down Expand Up @@ -613,3 +612,19 @@ add_library(celix::my_bundle ALIAS my_bundle)
- Code should be checked for memory leaks using AddressSanitizer.
- Coverity scan are done on the master on a regular basis. Ideally new coverity issues should be fixed as soon as
possible.

## Conan Dependencies Locking

If Conan is used as a build tool, the dependencies are locked using a `conan.lock` file.
This file is committed to source control and should be periodically updated when dependencies change.

The lock file is used to ensure CI build caches and that developers work with the same dependencies.

When updating dependencies, the following Conan command should be used:

```bash
conan lock create --options build_all=True --options enable_address_sanitizer=True --options enable_testing=True --options enable_ccache=True --conf tools.cmake.cmaketoolchain:generator=Ninja .
```

This command ensures that all the dependencies needed for different build options are enabled and locked, including some
build dependencies like ccache and Ninja.

0 comments on commit ada1c88

Please sign in to comment.