| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -747,6 +747,17 @@ Compiler flags | |
| extensions. Use it when a compiler flag should *not* be part of the | ||
| distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`). | ||
|
|
||
| In particular, :envvar:`CFLAGS` should not contain: | ||
|
|
||
| * the compiler flag `-I` (for setting the search path for include files). | ||
| The `-I` flags are processed from left to right, and any flags in | ||
| :envvar:`CFLAGS` would take precedence over user- and package-supplied `-I` | ||
| flags. | ||
|
|
||
| * hardening flags such as `-Werror` because distributions cannot control | ||
| whether packages installed by users conform to such heightened | ||
| standards. | ||
|
|
||
| .. versionadded:: 3.5 | ||
|
|
||
| .. envvar:: EXTRA_CFLAGS | ||
| Expand Down Expand Up | @@ -859,6 +870,13 @@ Linker flags | |
| :envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of | ||
| the distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`). | ||
|
|
||
| In particular, :envvar:`LDFLAGS` should not contain: | ||
|
|
||
| * the compiler flag `-L` (for setting the search path for libraries). | ||
| The `-L` flags are processed from left to right, and any flags in | ||
| :envvar:`LDFLAGS` would take precedence over user- and package-supplied `-L` | ||
| flags. | ||
|
Comment thread
Comment on lines
+873
to
+878
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIn pyenv/pyenv#2381, we found out that at least one -L flag from LDFLAGS was required when linking against Python to find libintl. We even had to add it to python-config --ldflags via a hack since python-config ignores compile-time LDFLAGS for some reason.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityDo you think we should add guidance here for downstream packagers that informs them of other, more suitable ways to set flags -- namely setting environment variables CFLAGS, LDFLAGS, CPATH, LIBRARY_PATH at the runtime of Python?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
I'm not sure how you expect downstream packagers to do that -- and why they need to do that in the first place since distutils and python-config specifically exist to take care of providing all the necessary flags to link against a specific Python installation.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAren't the pyenv shims already setting environment variables? Specifically, they are setting PATH. https://trac.sagemath.org/ticket/29285#comment:20
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
conda and nix use activation scripts for their environments. homebrew provides brew sh for this purpose.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIf we set the flags in an envvar, they would likely still override package-supplied flags (skimmed through distutils sources, it looks like that). If so, that won't help your original problem.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThat may be true for CFLAGS, but definitely not for CPATH. By the way, https://github.com/pypa/setuptools/blob/main/docs/userguide/ext_modules.rst now has some info (from my PR pypa/setuptools#3368); we can expand it to cover all necessary details to resolve this discussion.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis is now pypa/setuptools#3387
Sorry, something went wrong.
All reactions
|
||
|
|
||
| .. envvar:: CONFIGURE_LDFLAGS_NODIST | ||
|
|
||
| Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.