Skip to content

Commit 17ec792

Browse files
BUILD on old ubuntu to support colab (#63)
colab has GLIBC 2.35 but building on ubuntu 24 makes us require 2.39 ... building on ubuntu 22 fixes the issue and I also extract the actual GLIBC version and attach it to the pypi wheel fixes #62
1 parent 8699f2d commit 17ec792

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/prerelease.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: true
3434
matrix:
35-
os: [ubuntu-24.04, macos-13, macos-14]
35+
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
3636
python-version: ['3.10', '3.11', '3.12']
3737
steps:
3838
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -64,7 +64,11 @@ jobs:
6464
env:
6565
TARGET_PYTHON: ${{ matrix.python-version }}
6666
run: |
67-
bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel
67+
glibc_version=$(ldd --version | awk '/ldd/{print $NF}')
68+
export GLIBC_VERSION="${glibc_version//./_}"
69+
echo $GLIBC_VERSION
70+
sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true
71+
bazel build --define GLIBC_VERSION=$GLIBC_VERSION --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel
6872
6973
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
7074
with:

.github/workflows/stable-release-workflow.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: true
3333
matrix:
34-
os: [ubuntu-24.04, macos-13, macos-14]
34+
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
3535
python-version: ['3.10', '3.11', '3.12']
3636

3737
steps:
@@ -64,6 +64,10 @@ jobs:
6464
env:
6565
TARGET_PYTHON: ${{ matrix.python-version }}
6666
run: |
67+
glibc_version=$(ldd --version | awk '/ldd/{print $NF}')
68+
export GLIBC_VERSION="${glibc_version//./_}"
69+
echo $GLIBC_VERSION
70+
sed "s/^MANYLINUX_VERSION.*/MANYLINUX_VERSION=\"manylinux_${GLIBC_VERSION}_x86_64.manylinux2014_x86_64\"/" BUILD -i || true
6771
bazel build --define TARGET_VERSION="$(python -c "print(\"py${TARGET_PYTHON}\".replace(\".\", \"\"))")" --define VERSION="$(cat version/version.txt)" :tesseract_decoder_wheel
6872
6973
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4

BUILD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ filegroup(
1313
visibility = ["//visibility:public"],
1414
)
1515

16+
MANYLINUX_VERSION="manylinux_2_17_x86_64.manylinux2014_x86_64"
17+
1618
py_wheel(
1719
name="tesseract_decoder_wheel",
1820
distribution = "tesseract_decoder",
@@ -29,7 +31,7 @@ py_wheel(
2931
":macos_arm": "macosx_11_0_arm64",
3032
":macos_x86": "macosx_10_13_x86_64",
3133
"@platforms//os:windows": "win32",
32-
"@platforms//os:linux": "manylinux_2_17_x86_64.manylinux2014_x86_64",
34+
"@platforms//os:linux": MANYLINUX_VERSION,
3335
}),
3436
strip_path_prefixes = ["src"],
3537
description_file=":package_description",

0 commit comments

Comments
 (0)