Skip to content

Commit 1256b46

Browse files
authored
Merge pull request libgit2#5406 from libgit2/pks/azure-fix-arm32
azure: fix ARM32 builds by replacing gosu(1)
2 parents 5254c9b + eaa70c6 commit 1256b46

File tree

6 files changed

+19
-42
lines changed

6 files changed

+19
-42
lines changed

azure-pipelines/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ steps:
1313
if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
1414
displayName: 'Load Docker cache'
1515
- script: |
16-
cd $(Build.SourcesDirectory)/azure-pipelines/docker
17-
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} .
18-
if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi
16+
cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
17+
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . &&
18+
if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi &&
1919
docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar
2020
displayName: 'Build Docker image'
2121
- task: docker@0

azure-pipelines/docker/bionic

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
ARG BASE
2-
FROM $BASE
2+
FROM $BASE AS apt
33
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
4+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
55
clang \
66
cmake \
77
curl \
88
gcc \
99
git \
10-
gosu \
1110
libcurl4-openssl-dev \
1211
libpcre3-dev \
1312
libssh2-1-dev \
@@ -19,11 +18,12 @@ RUN apt-get update && \
1918
openssl \
2019
pkgconf \
2120
python \
21+
sudo \
2222
valgrind \
2323
&& \
2424
rm -rf /var/lib/apt/lists/*
25-
RUN mkdir /var/run/sshd
2625

26+
FROM apt AS mbedtls
2727
RUN cd /tmp && \
2828
curl --location --silent https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \
2929
tar -xz && \
@@ -34,7 +34,9 @@ RUN cd /tmp && \
3434
cd .. && \
3535
rm -rf mbedtls-2.16.2
3636

37+
FROM mbedtls AS configure
3738
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
3839
RUN chmod a+x /usr/local/bin/entrypoint.sh
40+
RUN mkdir /var/run/sshd
3941

4042
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash -e
22
useradd --shell /bin/bash libgit2
3-
chown -R $(id -u libgit2) /home/libgit2
4-
exec gosu libgit2 "$@"
3+
chown --recursive libgit2:libgit2 /home/libgit2
4+
exec sudo --preserve-env --user=libgit2 "$@"

azure-pipelines/docker/xenial

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ RUN apt-get update && \
88
curl \
99
gcc \
1010
git \
11-
gosu \
1211
krb5-user \
1312
libcurl4-gnutls-dev \
1413
libgcrypt20-dev \
@@ -23,7 +22,10 @@ RUN apt-get update && \
2322
openssl \
2423
pkgconf \
2524
python \
26-
valgrind
25+
sudo \
26+
valgrind \
27+
&& \
28+
rm -rf /var/lib/apt/lists/*
2729

2830
FROM apt AS mbedtls
2931
RUN cd /tmp && \

azure-pipelines/setup-linux.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/object/cache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ static void *cache_quick(void *arg)
244244

245245
void test_object_cache__fast_thread_rush(void)
246246
{
247-
int try, th, data[THREADCOUNT*2];
247+
int try, th, data[THREADCOUNT];
248248
#ifdef GIT_THREADS
249-
git_thread t[THREADCOUNT*2];
249+
git_thread t[THREADCOUNT];
250250
#endif
251251

252252
for (try = 0; try < REPEAT; ++try) {
253253
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
254254

255-
for (th = 0; th < THREADCOUNT*2; ++th) {
255+
for (th = 0; th < THREADCOUNT; ++th) {
256256
data[th] = th;
257257
#ifdef GIT_THREADS
258258
cl_git_pass(
@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void)
263263
}
264264

265265
#ifdef GIT_THREADS
266-
for (th = 0; th < THREADCOUNT*2; ++th) {
266+
for (th = 0; th < THREADCOUNT; ++th) {
267267
void *rval;
268268
cl_git_pass(git_thread_join(&t[th], &rval));
269269
cl_assert_equal_i(th, *((int *)rval));

0 commit comments

Comments
 (0)