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:
if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
displayName: 'Load Docker cache'
- script: |
cd $(Build.SourcesDirectory)/azure-pipelines/docker
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
cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
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 &&
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'
- task: docker@0
......
ARG BASE
FROM $BASE
FROM $BASE AS apt
RUN apt-get update && \
apt-get install -y --no-install-recommends \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
clang \
cmake \
curl \
gcc \
git \
gosu \
libcurl4-openssl-dev \
libpcre3-dev \
libssh2-1-dev \
......@@ -19,11 +18,12 @@ RUN apt-get update && \
openssl \
pkgconf \
python \
sudo \
valgrind \
&& \
rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd
FROM apt AS mbedtls
RUN cd /tmp && \
curl --location --silent https://tls.mbed.org/download/mbedtls-2.16.2-apache.tgz | \
tar -xz && \
......@@ -34,7 +34,9 @@ RUN cd /tmp && \
cd .. && \
rm -rf mbedtls-2.16.2
FROM mbedtls AS configure
COPY entrypoint.sh /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"]
#!/bin/bash -e
useradd --shell /bin/bash libgit2
chown -R $(id -u libgit2) /home/libgit2
exec gosu libgit2 "$@"
chown --recursive libgit2:libgit2 /home/libgit2
exec sudo --preserve-env --user=libgit2 "$@"
......@@ -8,7 +8,6 @@ RUN apt-get update && \
curl \
gcc \
git \
gosu \
krb5-user \
libcurl4-gnutls-dev \
libgcrypt20-dev \
......@@ -23,7 +22,10 @@ RUN apt-get update && \
openssl \
pkgconf \
python \
valgrind
sudo \
valgrind \
&& \
rm -rf /var/lib/apt/lists/*
FROM apt AS mbedtls
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)
void test_object_cache__fast_thread_rush(void)
{
int try, th, data[THREADCOUNT*2];
int try, th, data[THREADCOUNT];
#ifdef GIT_THREADS
git_thread t[THREADCOUNT*2];
git_thread t[THREADCOUNT];
#endif
for (try = 0; try < REPEAT; ++try) {
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;
#ifdef GIT_THREADS
cl_git_pass(
......@@ -263,7 +263,7 @@ void test_object_cache__fast_thread_rush(void)
}
#ifdef GIT_THREADS
for (th = 0; th < THREADCOUNT*2; ++th) {
for (th = 0; th < THREADCOUNT; ++th) {
void *rval;
cl_git_pass(git_thread_join(&t[th], &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