Skip to content

Commit 54490a5

Browse files
authored
java: Build async-profiler with -static-libstdc++ (#139)
* Build async-profiler with devtoolset 7 (for new GCC) and -static-libstdc++ * Build static jattach (why not) * Bump gProfiler version
1 parent 989934b commit 54490a5

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ COPY scripts/phpspy_build.sh .
4646
RUN ./phpspy_build.sh
4747

4848
# async-profiler
49+
# requires CentOS 6, so the built DSO can be loaded into machines running with old glibc.
4950
# centos:6
5051
FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder
5152
COPY scripts/async_profiler_env.sh .

gprofiler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.4"
1+
__version__ = "1.1.6"

pyi.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ COPY scripts/phpspy_build.sh .
3535
RUN ./phpspy_build.sh
3636

3737
# async-profiler
38+
# requires CentOS 6, so the built DSO can be loaded into machines running with old glibc.
39+
# centos:6
3840
FROM centos@sha256:dec8f471302de43f4cfcf82f56d99a5227b5ea1aa6d02fa56344986e1f4610e7 AS async-profiler-builder
3941
COPY scripts/async_profiler_env.sh .
4042
RUN ./async_profiler_env.sh

scripts/async_profiler_build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
#
66
set -euo pipefail
77

8-
VERSION=v2.0g3
8+
VERSION=v2.0g4
9+
GIT_REV=9d29169e34abc004f534a85ba6a4cf8920250381
910
OUTPUT=async-profiler-2.0-linux-x64.tar.gz
1011

11-
git clone --depth 1 -b "$VERSION" https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard 51447a849d686e899c1cd393e83f0f7c41685d95
12+
git clone --depth 1 -b "$VERSION" https://github.com/Granulate/async-profiler.git && cd async-profiler && git reset --hard "$GIT_REV"
13+
set +eu # this funny script has errors :shrug:
14+
source scl_source enable devtoolset-7
15+
set -eu
1216
make release
1317

1418
# add a version file to the build directory

scripts/async_profiler_env.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
#
66
set -euo pipefail
77

8-
# fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450
9-
# this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented)
10-
# and replaces the domain from mirror.centos.org to vault.centos.org.
11-
sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/*
8+
function fix_legacy_repos() {
9+
# fix legacy yum repos. slightly adapted from https://stackoverflow.com/a/53848450
10+
# this basically comments out all mirrorlist URLs, uncomments all baseurls (all seem to be commented)
11+
# and replaces the domain from mirror.centos.org to vault.centos.org.
12+
sed -i -e 's|^mirrorlist|#mirrorlist|' -e 's|^# *baseurl|baseurl|' -e 's|mirror.centos.org|vault.centos.org|' /etc/yum.repos.d/*
13+
}
1214

13-
yum install -y gcc g++ gcc-c++.x86_64 make java-1.8.0-openjdk-devel glibc-static git
15+
fix_legacy_repos
16+
yum install -y centos-release-scl
17+
fix_legacy_repos # fix again, after adding new scl repos
18+
yum install -y devtoolset-7-toolchain make java-1.8.0-openjdk-devel glibc-static git

0 commit comments

Comments
 (0)