Skip to content

Commit 1cd7926

Browse files
authored
chore: fix package build for conan2 (#741)
1 parent 7f90a05 commit 1cd7926

File tree

6 files changed

+30
-40
lines changed

6 files changed

+30
-40
lines changed

.github/actions/build-cpp/Dockerfile

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

3-
LABEL author="Everton Haise Taques <[email protected]>"
4-
LABEL maintainer="Orb Community"
5-
LABEL version="1.0.0"
6-
7-
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python wget"
3+
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3 python3-pip python3-setuptools ca-certificates libasan6 zip curl wget"
84

95
COPY ./entrypoint.sh /entrypoint.sh
106

@@ -13,9 +9,9 @@ RUN mkdir -p /pktvisor-src
139
WORKDIR /pktvisor-src
1410

1511
RUN apt-get update && \
16-
apt-get upgrade --yes --force-yes && \
17-
apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \
18-
pip3 install conan --force-reinstall
12+
apt-get upgrade --yes && \
13+
apt-get install --yes --no-install-recommends ${BUILD_DEPS} && \
14+
pip3 install conan --force-reinstall --break-system-packages
1915

2016
RUN chmod +x /entrypoint.sh
2117

.github/actions/build-cpp/entrypoint.sh

+11-17
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,28 @@ function build() {
1919
cp -rf /github/workspace/cmake/ /pktvisor-src/cmake/
2020
cp -rf /github/workspace/CMakeLists.txt /pktvisor-src/
2121
cp -rf /github/workspace/conanfile.py /pktvisor-src/
22-
mkdir /tmp/build
23-
cd /tmp/build
24-
cp -rf /pktvisor-src/build/conan_home/ .
25-
chmod -R 777 /tmp/build/conan_home/
26-
conan profile new --detect default
27-
conan profile update settings.compiler.libcxx=libstdc++11 default
28-
conan config set general.revisions_enabled=1
29-
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN /pktvisor-src
22+
cd /pktvisor-src/build/
23+
conan profile detect -f
24+
PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN ..
3025
make all -j 4
3126
}
3227

3328
function move() {
3429
echo "========================= Compacting binary and copying ========================="
35-
cd /tmp/build
36-
cp -rf /tmp/build/bin/pktvisord /github/workspace/
37-
strip -s /tmp/build/bin/crashpad_handler
38-
cp -rf /tmp/build/bin/crashpad_handler /github/workspace/
39-
cp -rf /tmp/build/bin/pktvisor-reader /github/workspace/
40-
cp -rf /tmp/build/VERSION /github/workspace/
41-
chmod -R 777 /tmp/build/conan_home/
42-
cp -rf /tmp/build/conan_home/ /github/workspace/build/
30+
cd /pktvisor-src/build/
31+
cp -rf /pktvisor-src/build/bin/pktvisord /github/workspace/
32+
strip -s /pktvisor-src/build/bin/crashpad_handler
33+
cp -rf /pktvisor-src/build/bin/crashpad_handler /github/workspace/
34+
cp -rf /pktvisor-src/build/bin/pktvisor-reader /github/workspace/
35+
cp -rf /pktvisor-src/build/VERSION /github/workspace/
36+
cp -rf /pktvisor-src/build/p/ /github/workspace/build/
4337
cp -rf /pktvisor-src/golang/pkg/client/version.go /github/workspace/version.go
4438
cp -rf /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /github/workspace/custom-iana.csv
4539
}
4640

4741
function publishToBugsplat() {
4842
echo "========================= Publishing symbol to bugsplat ========================="
49-
cd /tmp/build
43+
cd /pktvisor-src/build/
5044
if [ "$INPUT_BUGSPLAT" == "true" ]; then
5145
wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms
5246
chmod a+x ./dump_syms

.github/workflows/build-develop.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Setup Conan Cache
4242
uses: actions/cache@v4
4343
with:
44-
path: ${{github.workspace}}/build/conan_home/
44+
path: ${{github.workspace}}/build/p/
4545
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
4646
restore-keys: conan-${{ runner.os }}-
4747

@@ -81,7 +81,7 @@ jobs:
8181
- name: Setup Conan Cache
8282
uses: actions/cache@v4
8383
with:
84-
path: ${{github.workspace}}/build/conan_home/
84+
path: ${{github.workspace}}/build/p/
8585
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
8686
restore-keys: conan-${{ runner.os }}-
8787

@@ -123,7 +123,7 @@ jobs:
123123
- name: Setup Conan Cache
124124
uses: actions/cache@v4
125125
with:
126-
path: ${{github.workspace}}/build/conan_home/
126+
path: ${{github.workspace}}/build/p/
127127
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
128128
restore-keys: conan-${{ runner.os }}-
129129

@@ -230,7 +230,7 @@ jobs:
230230
- name: Setup Conan Cache
231231
uses: actions/cache@v4
232232
with:
233-
path: ${{github.workspace}}/build/conan_home/
233+
path: ${{github.workspace}}/build/p/
234234
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
235235
restore-keys: conan-${{ runner.os }}-
236236

@@ -403,7 +403,7 @@ jobs:
403403
- name: Setup Conan Cache
404404
uses: actions/cache@v4
405405
with:
406-
path: ${{github.workspace}}/build/conan_home/
406+
path: ${{github.workspace}}/build/p/
407407
key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
408408
restore-keys: conan-${{ runner.os }}-arm64-
409409

.github/workflows/build-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Setup Conan Cache
3636
uses: actions/cache@v4
3737
with:
38-
path: ${{github.workspace}}/build/conan_home/
38+
path: ${{github.workspace}}/build/p/
3939
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
4040
restore-keys: conan-${{ runner.os }}-
4141

@@ -171,7 +171,7 @@ jobs:
171171
- name: Setup Conan Cache
172172
uses: actions/cache@v4
173173
with:
174-
path: ${{github.workspace}}/build/conan_home/
174+
path: ${{github.workspace}}/build/p/
175175
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
176176
restore-keys: conan-${{ runner.os }}-
177177

@@ -281,7 +281,7 @@ jobs:
281281
- name: Setup Conan Cache
282282
uses: actions/cache@v4
283283
with:
284-
path: ${{github.workspace}}/build/conan_home/
284+
path: ${{github.workspace}}/build/p/
285285
key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
286286
restore-keys: conan-${{ runner.os }}-arm64-
287287

@@ -400,7 +400,7 @@ jobs:
400400
- name: Setup Conan Cache
401401
uses: actions/cache@v4
402402
with:
403-
path: ${{github.workspace}}/build/conan_home/
403+
path: ${{github.workspace}}/build/p/
404404
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
405405
restore-keys: conan-${{ runner.os }}-
406406

.github/workflows/build_debug.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Conan Cache
2828
uses: actions/cache@v4
2929
with:
30-
path: ${{github.workspace}}/build/conan_home/
30+
path: ${{github.workspace}}/build/p/
3131
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
3232
restore-keys: conan-${{ runner.os }}-
3333

@@ -78,7 +78,7 @@ jobs:
7878
- name: Setup Conan Cache
7979
uses: actions/cache@v4
8080
with:
81-
path: ${{github.workspace}}/build/conan_home/
81+
path: ${{github.workspace}}/build/p/
8282
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
8383
restore-keys: conan-${{ runner.os }}-
8484

@@ -127,7 +127,7 @@ jobs:
127127
run: echo ${{ env.BRANCH_NAME }}
128128

129129
- name: Get VERSION
130-
run: echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
130+
run: echo "VERSION=`cat ${{github.workspace}}/VERSION`" >> $GITHUB_ENV
131131

132132
- name: Debug version
133133
run: echo ${{ env.VERSION }}

.github/workflows/code-ql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
# build and run tests
7575
sudo make all test
7676
#remove conan files
77-
rm -rf conan_home/
77+
rm -rf p/
7878
7979
- name: Perform CodeQL Analysis
8080
uses: github/codeql-action/analyze@v3
@@ -87,7 +87,7 @@ jobs:
8787
uses: advanced-security/filter-sarif@v1
8888
with:
8989
patterns: |
90-
-pktvisor/build/conan_home/**/*
90+
-pktvisor/build/p/**/*
9191
input: sarif-results/cpp.sarif
9292
output: sarif-results/cpp.sarif
9393

0 commit comments

Comments
 (0)