Skip to content

Commit 88e47b2

Browse files
committed
[alpine.Dockerfile] Fix Alpine Linux build & test ; [.github/workflows/github-actions.yml] Install with vcpkg ; [acquire/acquire_crc32c.h] Remove debug statement
1 parent c7eefcf commit 88e47b2

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

.github/workflows/github-actions.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ubuntu-latest, windows-latest, macos-latest]
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515

1616
name: ${{ matrix.os }}
1717

@@ -22,7 +22,7 @@ jobs:
2222
run: mkdir build
2323

2424
- name: Install dependencies for macOS
25-
run: brew install pkg-config libarchive
25+
run: brew install libarchive libbsd pkg-config
2626
if: matrix.os == 'macos-latest'
2727

2828
- name: Install dependencies for Ubuntu
@@ -54,13 +54,9 @@ jobs:
5454
run: ./vcpkg/bootstrap-vcpkg.sh
5555
if: matrix.os != 'windows-latest'
5656

57-
- name: Install vcpkg ports (Windows) --triplet "${{ runner.arch }}-${{ runner.os }}"
57+
- name: Install vcpkg ports --triplet "${{ runner.arch }}-${{ runner.os }}"
5858
run: ./vcpkg/vcpkg install --classic $(jq -r '.dependencies[] | select(type == "string")' vcpkg.json)
59-
if: matrix.os == 'windows-latest' && steps.cache-vcpkg.outputs.cache-hit != 'true'
60-
61-
- name: Install vcpkg ports (macOS, Linux)
62-
run: jq '.dependencies[] | select(type == "string")' vcpkg.json | xargs ./vcpkg/vcpkg install --classic
63-
if: matrix.os != 'windows-latest' && steps.cache-vcpkg.outputs.cache-hit != 'true'
59+
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
6460

6561
- name: configure (with vcpkg on Windows)
6662
working-directory: ./build
@@ -90,7 +86,7 @@ jobs:
9086
- name: release (Ubuntu)
9187
working-directory: ./build
9288
run: |
93-
echo "${{ secrets.GITHUB_TOKEN }}" > .token
89+
printf '%s' "${{ secrets.GITHUB_TOKEN }}" > .token
9490
gh auth login --with-token < .token
9591
rm .token
9692
gh release delete -y amalgamation || true

acquire/acquire_crc32c.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ bool crc32c(const char *const filename, const char *const hash) {
140140
fclose(fh);
141141

142142
snprintf(computed, sizeof(computed), "%08x", crc32_res);
143-
fprintf(stderr, "computed: \"%s\"\n", computed);
144143
return strcmp(computed, hash) == 0;
145144
}
146145

alpine.Dockerfile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,43 @@
11
FROM alpine
22

33
RUN apk add --no-cache \
4+
bash \
5+
build-base \
46
cmake \
7+
curl \
58
curl-dev \
9+
g++ \
610
gcc \
11+
git \
712
libarchive-dev \
813
libbsd-dev \
9-
rhash-dev \
1014
linux-headers \
1115
make \
1216
musl-dev \
17+
ninja-build \
1318
openssl-dev \
14-
pkgconf
19+
perl \
20+
pkgconf \
21+
python3 \
22+
rhash-dev \
23+
sudo \
24+
unzip \
25+
zip && \
26+
ln -s /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
27+
RUN echo -DCMAKE_C_COMPILER="$(which gcc)" -DCMAKE_CXX_COMPILER="$(which gcc)" -DCMAKE_MAKE_PROGRAM="$(which ninja)"
28+
WORKDIR /
29+
RUN git clone --depth=1 --single-branch https://github.com/offscale/vcpkg -b project0 && \
30+
cd vcpkg && \
31+
./bootstrap-vcpkg.sh -disableMetrics && \
32+
./vcpkg install kubazip libarchive rhash
1533

1634
COPY . /libacquire
1735

1836
WORKDIR /libacquire/build
1937

20-
RUN cmake -DCMAKE_BUILD_TYPE="Debug" .. && \
38+
RUN cmake -DCMAKE_BUILD_TYPE='Debug' \
39+
-DCMAKE_TOOLCHAIN_FILE='/vcpkg/scripts/buildsystems/vcpkg.cmake' \
40+
.. && \
2141
cmake --build .
2242

2343
CMD ctest .

0 commit comments

Comments
 (0)