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

DOC: add some hints to build, test #42

Merged
merged 1 commit into from
Feb 3, 2023
Merged

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Jan 30, 2023

Some things I found helpful when trying this out

  • document that the tests will run "full" by default, and show how to skip slow tests
  • document adding CFLAGS for debugging. The meson FAQ seemed to suggest this is best practices, maybe there is a better way?

@eli-schwartz
Copy link
Contributor

document adding CFLAGS for debugging. The meson FAQ seemed to suggest this is best practices, maybe there is a better way?

These particular flags are really equivalent to passing the meson_args -Dbuildtype=debug.

@mattip
Copy link
Contributor Author

mattip commented Jan 31, 2023

Does -Dbuildtype=debug require a debug build of python either on linux or windows?

@mattip
Copy link
Contributor Author

mattip commented Jan 31, 2023

The first point is connected to #40

@eli-schwartz
Copy link
Contributor

Does -Dbuildtype=debug require a debug build of python either on linux or windows?

Definitely not on Linux, since it maps to exactly the combination of -Doptimization=0 -Ddebug=true.

Good point about Windows, since by default the value of b_vscrt is from_buildtype and per the table at https://mesonbuild.com/Builtin-options.html this will map to also setting /MDd.

(I have no idea whether it is compatible with a release build of python itself.)

@mattip
Copy link
Contributor Author

mattip commented Jan 31, 2023

The problem with /MDd is that it will link to a different runtime library, so it will require a debug build of python for windows. Then this will percolate out to all other c-extension modules, so you must rebuild the entire environment.

I usually set the cflags "/Od /Zi" instead, which is much more like "-O0 -g" for gcc. Well, that is what I tell people I do. In reality, since using a debugger in windows is painful, I first use a lot of debug prints to see if I can avoid using a debugger at all, so then all I care about is having a small failing test and a quick build turn-around.

@stefanv
Copy link
Member

stefanv commented Feb 3, 2023

Thanks for this, Matti!

@stefanv stefanv merged commit a0dd289 into scientific-python:main Feb 3, 2023
@jarrodmillman jarrodmillman added this to the 0.1 milestone Mar 10, 2023
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 this pull request may close these issues.

4 participants