Skip to content

Commit ee835d5

Browse files
committed
Use GLibc version for unknown libcs
1 parent 5c0b484 commit ee835d5

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

bin/releaser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def get_release(release: str) -> Dict[str, Any]:
7373

7474

7575
def get_release_versions() -> List[str]:
76-
return [release["tag_name"][1:] for release in get_releases() if not release["tag_name"][1:].startswith("1.")]
76+
return [release["tag_name"][1:] for release in get_releases() if not release["tag_name"][1:].startswith("1.")
77+
and release["tag_name"][-1].isdigit()]
7778

7879

7980
def get_most_recent_release() -> str:

src/main/java/one/profiler/AsyncProfilerLoader.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,10 @@ private static String getLibrarySuffix() {
139139
if (arch.equals("arm64") || arch.equals("aarch64")) {
140140
librarySuffix = version + "-linux-aarch64.so";
141141
} else if (arch.equals("x86_64") || arch.equals("x64") || arch.equals("amd64")) {
142-
if (isOnGLibc()) {
143-
librarySuffix = version + "-linux-x64.so";
144-
} else if (isOnMusl()) {
142+
if (isOnMusl()) {
145143
librarySuffix = version + "-linux-x64-musl.so";
146144
} else {
147-
throw new IllegalStateException("Async-profiler does not work with the given libc");
145+
librarySuffix = version + "-linux-x64.so";
148146
}
149147
} else {
150148
throw new IllegalStateException("Async-profiler does not work on Linux " + arch);
@@ -201,17 +199,6 @@ public static String getVersion() {
201199
return version;
202200
}
203201

204-
private static boolean isOnGLibc() {
205-
// see https://unix.stackexchange.com/questions/120380/what-c-library-version-does-my-system-use
206-
try {
207-
Process process = Runtime.getRuntime().exec(new String[] {"getconf", "GNU_LIBC_VERSION"});
208-
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
209-
return reader.readLine() != null;
210-
} catch (IOException e) {
211-
return false;
212-
}
213-
}
214-
215202
private static boolean isOnMusl() {
216203
// based on https://docs.pleroma.social/backend/installation/otp_en/#detecting-flavour
217204
try {

0 commit comments

Comments
 (0)