Skip to content
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

Debug builds? #73

Closed
wesm opened this issue Oct 2, 2016 · 11 comments · Fixed by #597
Closed

Debug builds? #73

wesm opened this issue Oct 2, 2016 · 11 comments · Fixed by #597

Comments

@wesm
Copy link
Member

wesm commented Oct 2, 2016

Any idea how much work it would be to have a, say, 3.5-debug Python version? Maybe this is already available somewhere.

@tadeu
Copy link
Member

tadeu commented Oct 19, 2016

@dfroger
Copy link

dfroger commented Nov 19, 2016

Just created the pull request #86 about this

@jakirkham
Copy link
Member

This is a great idea that we should really revive (especially as the tooling has caught up a bit). Raised issue ( conda-forge/conda-forge.github.io#544 ) to discuss how we do split packages and generate things like debug builds as products.

@jakirkham
Copy link
Member

@msarahan, do you know if any work has been done on this front in defaults? What recommendations do you and/or others have in terms of building and selecting between debug and non-debug builds of python both in downstream builds and conda installs? Are there options that conda-build 3 provides that would be helpful for this effort?

@jakirkham
Copy link
Member

It's worth noting as of Python 3.8 the interpreter includes all debug symbols. So a separate debug build is no longer needed for 3.8+.

ref: https://docs.python.org/3/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build

cc @conda-forge/core (for visibility)

@jakirkham
Copy link
Member

jakirkham commented Mar 27, 2020

With some of the recent work on PyPy, this seems more doable. Raising issue ( conda-forge/conda-forge.github.io#1017 ) to discuss.

@mingwandroid
Copy link
Contributor

mingwandroid commented Mar 27, 2020

I did some work for debug builds on Windows on Python 3.8. The ABI is not exactly the same. There is one symbol of difference ("CreateModule2" gets suffixed "Refcounted" or something like that).

I used this when I was looking into a Python 3.8 issue on Windows with LIEF. It builds a load of stuff with a huge amount of debug info using a very hacky batch file. To tweak change what gets built, see: https://github.com/AnacondaRecipes/python-feedstock/blob/master/build-locally-debug.bat#L3-L21

If anyone has time, this is how to run it. You need my latest WIP conda-build branch too!

conda activate
cd %TEMP%
mkdir debug-py-win
cd debug-py-win
git clone https://github.com/AnacondaRecipes/python-feedstock
git clone https://github.com/mingwandroid/conda-build -b 10-Add-build-id-pat-option
pushd conda-build
  python setup.py develop
popd
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-dbg_c-dbg_py_win-32.yaml
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-dbg_c-dbg_py_win-64.yaml
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-dbg_win-32.yaml
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-dbg_win-64.yaml
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-win-32.yaml
curl -SLO https://raw.githubusercontent.com/AnacondaRecipes/aggregate/master/conda_build_config-win-64.yaml
python-feedstock\build-locally-debug.bat

I've only ever run this on my own machines and without conda-forge in my channel list as I was debugging this against defaults.

I think Unix Python debug builds would be a great idea and should be pretty easy to get going. For Windows, I'd like us to do something different which is to heed the upstream maintainer's advice that we should make a release-with-debug-symbols build as our python 3.8 debug builds, for now at least.

Cheers!

@jakirkham
Copy link
Member

Thanks Ray! 😄

I did some work for debug builds on Windows on Python 3.8. The ABI is not exactly the same. There is one symbol of difference ("CreateModule2" gets suffixed "Refcounted" or something like that).

Did this get raised upstream?

@mingwandroid
Copy link
Contributor

Only in the sense that Steve Dower is the upstream main Windows Python maintainer.
I can dig out links to recent issues if you wish, but the declaration of ABI-compat was premature without the Windows caveats. There's also the issue of linking to the debug UCRT runtime. This is why my test script builds each subproject against each python.

@mingwandroid
Copy link
Contributor

I guess at Python 3.9 there might be some official debuggable-release build config.. maybe! Or we should put in the work and submit a PR.

@jakirkham
Copy link
Member

I see. Well at the bare minimum and issue would be useful to aid prioritization/visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants