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

How to select compiler in build options? #533

Open
eabase opened this issue Nov 15, 2022 · 2 comments
Open

How to select compiler in build options? #533

eabase opened this issue Nov 15, 2022 · 2 comments

Comments

@eabase
Copy link

eabase commented Nov 15, 2022

I'm trying to convert the following into something that is compatible with python -m build ...format.

Following #202, and #517, I tried this:

# Convert any of these: 
python setup.py --no-user-cfg --verbose build --compiler=mingw32 --force   # with = 

# into this:
python -m build -n -w -C="--global-option=--no-user-cfg" -C="--global-option=--verbose" -C="--build-option=--compiler=mingw32" -C="--build-option=--force"

This fails with:

* Getting build dependencies for wheel...
C:\Python310\lib\site-packages\setuptools\config\pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  warnings.warn(msg, _BetaConfiguration)
running egg_info
writing src\black_scholes.egg-info\PKG-INFO
writing dependency_links to src\black_scholes.egg-info\dependency_links.txt
writing top-level names to src\black_scholes.egg-info\top_level.txt
reading manifest file 'src\black_scholes.egg-info\SOURCES.txt'
adding license file 'LICENSE.md'
writing manifest file 'src\black_scholes.egg-info\SOURCES.txt'
* Building wheel...
C:\Python310\lib\site-packages\setuptools\config\pyprojecttoml.py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  warnings.warn(msg, _BetaConfiguration)
usage: _in_process.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: _in_process.py --help [cmd1 cmd2 ...]
   or: _in_process.py --help-commands
   or: _in_process.py cmd --help

error: option --compiler not recognized

ERROR Backend subprocess exited when trying to invoke build_wheel

I also tried without the =, that also works with setup.py.

python setup.py --no-user-cfg --verbose build --compiler mingw32 --force  # without =

But also failed.

Finally tried this:
python -m build -n -w -C="--no-user-cfg" -C="--verbose" -C="--compiler=mingw32" -C="--force"

But that completely ignored the mingw32 compiler.

@dlaugt
Copy link

dlaugt commented Nov 20, 2022

I've asked me the same question on how to pass --debug option to the backend build command to be able to compile in debug.

The following translation is working for me:
python_d setup.py bdist_wheel build --debug
into:
python_d -m build --wheel --no-isolation -C--build-option="build --debug"

Perhaps, you can try the following:
python -m build -C--global-option=--no-user-cfg -C--global-option=--verbose -C--build-option="build --compiler=mingw32 --force"

@eabase
Copy link
Author

eabase commented Nov 24, 2022

After a discussion here:

The best solution was to just copy (the now ignored) distutils.cfg into your projects folder and name it setup.cfg instead. (There is also another env variable solution, that I haven't tried yet.)

So no more dumb and contorted CLI option-option-options... 👍

lgautier added a commit to rpy2/rpy2 that referenced this issue Sep 16, 2023
There is seemingly no doc for this. Trying the incantation here:
pypa/build#533
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

No branches or pull requests

2 participants