Skip to content

Commit fa53d6e

Browse files
authored
Merge pull request #13 from gitkraken/ubuntu-container
use docker container for glibc compat
2 parents 2f58bfa + 5286f1e commit fa53d6e

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
build:
2323
name: ${{ matrix.friendlyName }} ${{ matrix.arch }}
2424
runs-on: ${{ matrix.os }}
25+
container: ${{ matrix.image }}
2526
strategy:
2627
fail-fast: false
2728
matrix:
@@ -37,11 +38,23 @@ jobs:
3738
- os: ubuntu-22.04
3839
friendlyName: Linux
3940
targetPlatform: ubuntu
41+
image: 'ubuntu:20.04'
4042
exclude:
4143
- os: windows-latest
4244
arch: arm64
4345
timeout-minutes: 20
4446
steps:
47+
- name: Install dependencies into dockerfile on Ubuntu
48+
if: matrix.targetPlatform == 'ubuntu'
49+
run: |
50+
apt-get update
51+
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common lsb-release sudo wget curl build-essential jq autoconf automake pkg-config ca-certificates
52+
sudo add-apt-repository ppa:git-core/ppa -y
53+
sudo apt-get update
54+
sudo apt-get install -y git
55+
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
56+
sudo apt-get install -y nodejs
57+
git config --global --add safe.directory '*'
4558
# We need to use Xcode 14.3.1 for maximum compatibility with older macOS (x64)
4659
- name: Switch to oldest available Xcode
4760
if: matrix.targetPlatform == 'macOS' && matrix.arch == 'x64'
@@ -70,7 +83,7 @@ jobs:
7083
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'x64'
7184
run: |
7285
sudo apt-get update
73-
sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext
86+
sudo apt-get install -y libcurl4-gnutls-dev libexpat1-dev zlib1g-dev gettext libssl-dev
7487
- name: Install extra dependencies for building Git on Ubuntu (arm64)
7588
if: matrix.targetPlatform == 'ubuntu' && matrix.arch == 'arm64'
7689
run: |
@@ -79,7 +92,7 @@ jobs:
7992
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
8093
sudo dpkg --add-architecture arm64
8194
sudo apt-get update
82-
sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libcurl4-gnutls-dev:arm64 zlib1g-dev:arm64 libbrotli-dev:arm64 gettext
95+
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libcurl4-gnutls-dev:arm64 zlib1g-dev:arm64 libbrotli-dev:arm64 gettext
8396
- name: Build
8497
shell: bash
8598
run: script/build.sh

script/build-ubuntu.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,17 @@ fi
2222

2323
case "$TARGET_ARCH" in
2424
"x64")
25-
# __GLIBC_MINOR__ is used as a feature test macro. Replace it with the
26-
# earliest supported version of glibc 2.17 as was previously the case when building on ubuntu-18.04
27-
sudo sed -i 's|\(#define\s\+__GLIBC_MINOR__\)|\1 17 //|' "/usr/include/features.h"
28-
# fcntl64() was introduced in glibc 2.28. Make sure to use fcntl() instead.
29-
sudo sed -i '{N; s/#ifndef __USE_FILE_OFFSET64\(\nextern int fcntl\)/#if 1\1/}' "/usr/include/fcntl.h"
3025
DEPENDENCY_ARCH="amd64"
3126
export CC="gcc"
3227
STRIP="strip"
3328
HOST=""
3429
TARGET="" ;;
35-
"x86")
36-
DEPENDENCY_ARCH="x86"
37-
export CC="i686-linux-gnu-gcc"
38-
STRIP="i686-gnu-strip"
39-
HOST="--host=i686-linux-gnu"
40-
TARGET="--target=i686-linux-gnu" ;;
4130
"arm64")
42-
# __GLIBC_MINOR__ is used as a feature test macro. Replace it with the
43-
# earliest supported version of glibc 2.17 as was previously the case when building on ubuntu-18.04
44-
sudo sed -i 's|\(#define\s\+__GLIBC_MINOR__\)|\1 17 //|' "/usr/aarch64-linux-gnu/include/features.h"
45-
# fcntl64() was introduced in glibc 2.28. Make sure to use fcntl() instead.
46-
sudo sed -i '{N; s/#ifndef __USE_FILE_OFFSET64\(\nextern int fcntl\)/#if 1\1/}' "/usr/aarch64-linux-gnu/include/fcntl.h"
4731
DEPENDENCY_ARCH="arm64"
4832
export CC="aarch64-linux-gnu-gcc"
4933
STRIP="aarch64-linux-gnu-strip"
5034
HOST="--host=aarch64-linux-gnu"
5135
TARGET="--target=aarch64-linux-gnu" ;;
52-
"arm")
53-
DEPENDENCY_ARCH="arm"
54-
export CC="arm-linux-gnueabihf-gcc"
55-
STRIP="arm-linux-gnueabihf-strip"
56-
HOST="--host=arm-linux-gnueabihf"
57-
TARGET="--target=arm-linux-gnueabihf" ;;
5836
*)
5937
exit 1 ;;
6038
esac

0 commit comments

Comments
 (0)