-
Notifications
You must be signed in to change notification settings - Fork 69
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 details on default build options used by meson-python #338
Conversation
4accafc
to
98d14a1
Compare
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.
@rgommers thanks! I have a one comment, and a couple of suggestions, but overall looks good.
Meson offers many `built-in options <https://mesonbuild.com/Builtin-options.html>`__, | ||
and in the vast majority of cases those have good defaults. There are a couple | ||
of cases however where ``meson-python`` either needs to or chooses to override | ||
those with its own defaults. To view what those are for the version of |
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.
possible improvement:
We could split the paragraph here and also document why we might choose to override the defaults. I wrote about the reasoning in #325 (comment).
We could also note that the options we do need to set are mostly for build/installation details that should not be relevant to the user. The only exception is the native file, but the user should be able to override the parts of it that make sense (IIRC everything but the Python interpreter).
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.
If we keep meson install
I would much prefer if we would get rid of the --prefix
and --python.{plat,pure}lib
options and use the $DESTDIR
environment variable pointing to somewhere in /tmp
instead. This would have the additional benefit of putting the installation directory on tmpfs, with possible significant speedups when building large wheels.
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.
... and also document why we might choose to override the defaults.
This I already have in a fair amount of detail.
We could also note that the options we do need to set are mostly for build/installation details that should not be relevant to the user.
I'll see if I should add a few more words of clarification, but thought it was pretty clear already.
If we keep
meson install
I would much prefer if we would get rid of the--prefix
and--python.{plat,pure}lib
options and use the$DESTDIR
environment variable pointing to somewhere in/tmp
instead.
That sounds potentially useful. Let's cross that bridge when we get to it I'd say; this PR adds docs for the current state of things, and if/when we add $DESTDIR
they can be changed.
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.
We could split the paragraph here and also document why we might choose to override the defaults. I wrote about the reasoning in #325 (comment).
I checked it in more detail, and it's effectively the same as what I already have in this PR: "because Meson defaults to values that are appropriate for development, while the main purpose of meson-python is to build release artifacts."
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.
If we keep
meson install
I would much prefer if we would get rid of the--prefix
and--python.{plat,pure}lib
options and use the$DESTDIR
environment variable pointing to somewhere in/tmp
instead.
I don't think this is even a question, is it 🤣? Those options and DESTDIR
serve two different purposes. We only set those options for the heuristics, so they can be removed now.
Regarding DESTDIR
, we already set it to a subdirectory of working_dir
, which currently when using the PEP 517 hooks is always set by tempfile.TemporaryDirectory
(in with_temp_working_dir
), so isn't that true already?
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.
The working dir is created inside the project directory, thus it is on the same filesystem as the project sources.
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.
Ah, you're right 😅. IIRC I did that to make things work properly for packagers by default, where access to /tmp
might be a bit tricky. We can consider changing the default, though.
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'll leave this comment thread open, because it seems like useful info. It doesn't apply to this PR directly though; it's discussion of a potential future design change. If that materializes, the docs can simply be updated.
98d14a1
to
a760766
Compare
It would be nice to have this combined somehow with the "Passing arguments to Meson" section. By the way, I just read that section and it contain several inaccuracies and some errors, for example all the pip command lines are wrong. I'm fixing it. |
This follows up on the `n_debug` default added in mesonbuildgh-325, documents all other default options and they are used, as well as improves the page on using `pyproject.toml` settings.
Ah, that is new. I don't have more time to spend on this right now, maybe end of the week. It looks to me like only the end of the page overlaps. How about leaving the explanation here, and the two examples of overriding arguments can be merged into the other page (so everything after "It is possible to override these defaults, either permanently in your project or at build time.")? |
Seems appropriate. I just noticed that you placed this page in the "Explanations" section. Why? I think it would be better in the "Reference" section. Anyhow, I think we can merge it as it is and tweak it up later. |
I think the page as-is should be in the explanations section, as its main purpose is to explain the reason behind the options we set, but it might make sense to have a page in the reference section detailing the default options we override. |
@rgommers feel free to apply any of the changes suggested, if you want, and then merge. |
a760766
to
cb1c86c
Compare
The pre-commit failure is unrelated to this PR, it complains about a missing |
All comments are addressed and CI is happy enough, so merged. Thanks for the reviews @dnicolodi and @FFY00 |
This follows up on the
n_debug
default added in gh-325, documents all other default options and they are used, as well as improves the page on usingpyproject.toml
settings.