-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
better cython debugging #53821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
better cython debugging #53821
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y build-essential git valgrind | ||
|
||
# cpython dev install | ||
RUN git clone -b 3.10 --depth 1 https://github.com/python/cpython.git /clones/cpython | ||
RUN apt-get install -y libbz2-dev libffi-dev libssl-dev zlib1g-dev liblzma-dev libsqlite3-dev libreadline-dev | ||
RUN cd /clones/cpython && ./configure --with-pydebug && CFLAGS="-g3" make -s -j$(nproc) && make install | ||
|
||
# gdb installation | ||
RUN apt-get install -y wget libgmp-dev | ||
RUN cd /tmp && wget http://mirrors.kernel.org/sourceware/gdb/releases/gdb-12.1.tar.gz && tar -zxf gdb-12.1.tar.gz | ||
RUN cd /tmp/gdb-12.1 && ./configure --with-python=python3 && make -j$(nproc) && make install | ||
RUN rm -r /tmp/gdb-12.1 | ||
|
||
# pandas dependencies | ||
RUN python3 -m pip install \ | ||
cython \ | ||
hypothesis \ | ||
ninja \ | ||
numpy \ | ||
meson \ | ||
meson-python \ | ||
pytest \ | ||
pytest-asyncio \ | ||
python-dateutil \ | ||
pytz \ | ||
versioneer[toml] | ||
|
||
# At the time this docker image was built, there was a bug/limitation | ||
# with meson where only having a python3 executable and not python | ||
# would cause the build to fail. This symlink could be removed if | ||
# users stick to always calling python3 within the container | ||
RUN ln -s /usr/local/bin/python3 /usr/local/bin/python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The Docker image here helps to set up an isolated environment containing a debug version of Python and a gdb installation which the Cython debugger can work with. | ||
|
||
If you have internet access, you can pull a pre-built image via | ||
|
||
```sh | ||
docker pull pandas/pandas-debug | ||
``` | ||
|
||
To build the image locally, you can do | ||
|
||
```sh | ||
docker build . -t pandas/pandas-debug -f Dockerfile.pandas-debug | ||
``` | ||
|
||
For pandas developers, you can push a new copy of the image to dockerhub via | ||
|
||
```sh | ||
docker push pandas/pandas-debug | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bug in Cython, which still uses optparse (deprecated in 3.2) insted of argparse. Seems like the tool should allow you to specify the build folder in theory, but in practice doesn't work. Will push up a PR separately to Cython to fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See cython/cython#5499