Skip to content

Commit d9a6015

Browse files
committed
wip: python package tooling
1 parent 9cc23ec commit d9a6015

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

pyroscope_ffi/python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Packages
55
*.egg
6+
.eggs/
67
!/tests/**/*.egg
78
*/*.egg-info
89
*.egg-info

pyroscope_ffi/python/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ clean:
44
rm -rf dist
55
rm -rf wheelhouse
66
rm -rf pyroscope_beta.egg-info
7+
rm -rf lib/target
78

89
.PHONY: build
910
build: clean

pyroscope_ffi/python/manylinux.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Install tooling
5+
yum -y -q install wget gcc libffi-devel
6+
7+
# Install Rust
8+
curl https://sh.rustup.rs -sSf | sh -s -- -y
9+
export PATH=~/.cargo/bin:$PATH
10+
11+
# Install libunwind
12+
wget https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz
13+
tar -zxvf libunwind-1.6.2.tar.gz
14+
cd libunwind-1.6.2
15+
./configure --disable-minidebuginfo --enable-ptrace --disable-tests --disable-documentation
16+
make
17+
make install
18+
19+
# Build wheels
20+
/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel
21+
22+
# Audit wheels
23+
for wheel in dist/*-linux_*.whl; do
24+
auditwheel repair $wheel -w dist/
25+
rm $wheel
26+
done
File renamed without changes.

pyroscope_ffi/python/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ def build_native(spec):
1919
in_path='target/release'),
2020
header_filename=lambda:
2121
build.find_header('pyroscope_ffi.h',in_path='include'),
22-
rtld_flags=['NOW', 'NODELETE']
22+
rtld_flags=['NOW']
2323
)
2424

2525
setup(
26+
platforms="any",
2627
milksnake_tasks=[build_native],
28+
setup_requires=["milksnakex>=0.1.6"],
2729
)

0 commit comments

Comments
 (0)