mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-12-23 08:47:50 +00:00
feat: test and lower glibc version requirement (#2143)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Lock Linux to minimum supported version (Ubuntu 18.04 / RHEL 8, glibc 2.28).
This commit is contained in:
parent
d617b145e2
commit
c8e723fac7
3 changed files with 74 additions and 0 deletions
3
.github/workflows/ci-check-e2e.yml
vendored
3
.github/workflows/ci-check-e2e.yml
vendored
|
|
@ -54,6 +54,9 @@ jobs:
|
|||
tar -xvf editors/vscode/out/tinymist-${{ matrix.rust-target }}.tar.gz -C editors/vscode/out
|
||||
mv editors/vscode/out/tinymist-${{ matrix.rust-target }}/tinymist editors/vscode/out/tinymist
|
||||
if: matrix.platform != 'win32'
|
||||
- name: Test GLIBC
|
||||
run: node ./scripts/test-glibc.mjs editors/vscode/out/tinymist
|
||||
if: matrix.platform != 'win32'
|
||||
- name: Test Tinymist (E2E)
|
||||
run: cargo test -p tests -- e2e
|
||||
- name: Upload Tinymist E2E Test Snapshot
|
||||
|
|
|
|||
|
|
@ -68,3 +68,31 @@ github-custom-job-permissions = { "build-vscode" = { contents = "write" } }
|
|||
[dist.github-custom-runners]
|
||||
global = "ubuntu-22.04"
|
||||
aarch64-pc-windows-msvc = "windows-latest"
|
||||
|
||||
# Begin: https://github.com/posit-dev/air/blob/d48bad11a28942ad11c19ca97c99d5b6d1c29218/dist-workspace.toml
|
||||
[dist.github-custom-runners.x86_64-apple-darwin]
|
||||
# Use Intel Mac runner to build Intel binary.
|
||||
# This is the dist default but we want to explicitly pin it.
|
||||
runner = "macos-13"
|
||||
|
||||
[dist.github-custom-runners.aarch64-apple-darwin]
|
||||
# Use ARM Mac runner to build ARM binary (not strictly required, but nice).
|
||||
# dist uses `macos-13` (Intel) by default and cross-compiles to ARM.
|
||||
runner = "macos-14"
|
||||
|
||||
[dist.github-custom-runners.x86_64-unknown-linux-gnu]
|
||||
# Lock Linux to minimum supported version (Ubuntu 18.04 / RHEL 8, glibc 2.28).
|
||||
# PyPa is the Python Packaging Authority, they manage old Linux variants for building Python wheels.
|
||||
# The container `host` uses MUSL because dist itself may require a newer glibc than we are locked to.
|
||||
# Runs on ubuntu-latest, dist defaults to oldest possible runner, but container usage means we can use latest
|
||||
# and not have to worry about it being EOL-ed.
|
||||
runner = "ubuntu-latest"
|
||||
container = { image = "quay.io/pypa/manylinux_2_28_x86_64", host = "x86_64-unknown-linux-musl" }
|
||||
|
||||
[dist.github-custom-runners.aarch64-unknown-linux-gnu]
|
||||
# See `x86_64-unknown-linux-gnu` comments
|
||||
# For ARM Linux, dist actually uses an x86_64 host and uses cargo-zigbuild to cross compile,
|
||||
# since GitHub doesn't offer a reliable free ARM Linux host yet.
|
||||
runner = "ubuntu-latest"
|
||||
container = { image = "quay.io/pypa/manylinux_2_28_x86_64", host = "x86_64-unknown-linux-musl" }
|
||||
# End: https://github.com/posit-dev/air/blob/d48bad11a28942ad11c19ca97c99d5b6d1c29218/dist-workspace.toml
|
||||
|
|
|
|||
43
scripts/test-glibc.mjs
Normal file
43
scripts/test-glibc.mjs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { exec as execSync } from "child_process";
|
||||
import util from "node:util";
|
||||
|
||||
const exec = util.promisify(execSync);
|
||||
const binaryPath = process.argv[2];
|
||||
|
||||
// get glibc symbols by l
|
||||
const symbols = await exec(`objdump -T ${binaryPath}`);
|
||||
|
||||
const GLIBC_VERSION_REGEX = /\(GLIBC_([\d.]+)\)/;
|
||||
|
||||
const versionSet = new Set(
|
||||
symbols.stdout
|
||||
.split("\n")
|
||||
.filter((line) => line.match(GLIBC_VERSION_REGEX))
|
||||
.map((line) => line.match(GLIBC_VERSION_REGEX)[1]),
|
||||
);
|
||||
|
||||
class GLIBCVersion {
|
||||
constructor(version) {
|
||||
this.semver = version.split(".").map((it) => Number.parseInt(it));
|
||||
}
|
||||
}
|
||||
|
||||
const versions = Array.from(versionSet)
|
||||
.map((version) => new GLIBCVersion(version))
|
||||
.filter((it) => it.semver.length == 2);
|
||||
|
||||
let maxMinor = 0;
|
||||
for (const version of versions) {
|
||||
if (version.semver[0] !== 2) {
|
||||
throw new Error("GLIBC version is not 2");
|
||||
}
|
||||
if (version.semver[1] > maxMinor) {
|
||||
maxMinor = version.semver[1];
|
||||
}
|
||||
}
|
||||
|
||||
console.log(maxMinor);
|
||||
|
||||
if (maxMinor > 28) {
|
||||
throw new Error(`GLIBC version is greater than 2.28, got GLIBC_2.${maxMinor}`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue