Unverified Commit 1256b462 by Edward Thomson Committed by GitHub

Merge pull request #5406 from libgit2/pks/azure-fix-arm32

azure: fix ARM32 builds by replacing gosu(1)
parents 5254c9bb eaa70c6c
...@@ -13,9 +13,9 @@ steps: ...@@ -13,9 +13,9 @@ steps:
if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
displayName: 'Load Docker cache' displayName: 'Load Docker cache'
- script: | - script: |
cd $(Build.SourcesDirectory)/azure-pipelines/docker cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . &&
if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi &&
docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar
displayName: 'Build Docker image' displayName: 'Build Docker image'
- task: docker@0 - task: docker@0
......
ARG BASE ARG BASE
FROM $BASE FROM $BASE AS apt
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
clang \ clang \
cmake \ cmake \
curl \ curl \
gcc \ gcc \
git \ git \
gosu \
libcurl4-openssl-dev \ libcurl4-openssl-dev \
libpcre3-dev \ libpcre3-dev \
libssh2-1-dev \ libssh2-1-dev \
...@@ -19,11 +18,12 @@ RUN apt-get update && \ ...@@ -19,11 +18,12 @@ RUN apt-get update && \
openssl \ openssl \
pkgconf \ pkgconf \
python \ python \
sudo \
valgrind \ valgrind \
&& \ && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd
FROM apt AS mbedtls
RUN cd /tmp && \ RUN cd /tmp && \
curl --location --silent https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \ curl --location --silent https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \
tar -xz && \ tar -xz && \
...@@ -34,7 +34,9 @@ RUN cd /tmp && \ ...@@ -34,7 +34,9 @@ RUN cd /tmp && \
cd .. && \ cd .. && \
rm -rf mbedtls-2.16.2 rm -rf mbedtls-2.16.2
FROM mbedtls AS configure
COPY entrypoint.sh /usr/local/bin/entrypoint.sh COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod a+x /usr/local/bin/entrypoint.sh RUN chmod a+x /usr/local/bin/entrypoint.sh
RUN mkdir /var/run/sshd
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
#!/bin/bash -e #!/bin/bash -e
useradd --shell /bin/bash libgit2 useradd --shell /bin/bash libgit2
chown -R $(id -u libgit2) /home/libgit2 chown --recursive libgit2:libgit2 /home/libgit2
exec gosu libgit2 "$@" exec sudo --preserve-env --user=libgit2 "$@"
...@@ -8,7 +8,6 @@ RUN apt-get update && \ ...@@ -8,7 +8,6 @@ RUN apt-get update && \
curl \ curl \
gcc \ gcc \
git \ git \
gosu \
krb5-user \ krb5-user \
libcurl4-gnutls-dev \ libcurl4-gnutls-dev \
libgcrypt20-dev \ libgcrypt20-dev \
...@@ -23,7 +22,10 @@ RUN apt-get update && \ ...@@ -23,7 +22,10 @@ RUN apt-get update && \
openssl \ openssl \
pkgconf \ pkgconf \
python \ python \
valgrind sudo \
valgrind \
&& \
rm -rf /var/lib/apt/lists/*
FROM apt AS mbedtls FROM apt AS mbedtls
RUN cd /tmp && \ RUN cd /tmp && \
......
#!/bin/sh
set -e
set -x
TMPDIR=${TMPDIR:-/tmp}
if [ -z "$SKIP_APT" ]; then
apt-get update
apt-get -y install build-essential pkg-config clang cmake openssl libssl-dev libssh2-1-dev libcurl4-gnutls-dev openssh-server
fi
mkdir -p /var/run/sshd
if [ "$MBEDTLS" ]; then
MBEDTLS_DIR=${MBEDTLS_DIR:-$(mktemp -d ${TMPDIR}/mbedtls.XXXXXXXX)}
git clone --depth 10 --single-branch --branch mbedtls-2.6.1 https://github.com/ARMmbed/mbedtls.git ${MBEDTLS_DIR}
cd ${MBEDTLS_DIR}
CFLAGS=-fPIC cmake -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON .
cmake --build .
if [ -z "$SKIP_MBEDTLS_INSTALL" ]; then
make install
fi
fi
...@@ -244,15 +244,15 @@ static void *cache_quick(void *arg) ...@@ -244,15 +244,15 @@ static void *cache_quick(void *arg)
void test_object_cache__fast_thread_rush(void) void test_object_cache__fast_thread_rush(void)
{ {
int try, th, data[THREADCOUNT*2]; int try, th, data[THREADCOUNT];
#ifdef GIT_THREADS #ifdef GIT_THREADS
git_thread t[THREADCOUNT*2]; git_thread t[THREADCOUNT];
#endif #endif
for (try = 0; try < REPEAT; ++try) { for (try = 0; try < REPEAT; ++try) {
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git"))); cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
for (th = 0; th < THREADCOUNT*2; ++th) { for (th = 0; th < THREADCOUNT; ++th) {
data[th] = th; data[th] = th;
#ifdef GIT_THREADS #ifdef GIT_THREADS
cl_git_pass( cl_git_pass(
...@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void) ...@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void)
} }
#ifdef GIT_THREADS #ifdef GIT_THREADS
for (th = 0; th < THREADCOUNT*2; ++th) { for (th = 0; th < THREADCOUNT; ++th) {
void *rval; void *rval;
cl_git_pass(git_thread_join(&t[th], &rval)); cl_git_pass(git_thread_join(&t[th], &rval));
cl_assert_equal_i(th, *((int *)rval)); cl_assert_equal_i(th, *((int *)rval));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment