Skip to content

Ability to set environment variables in pyproject.toml #1114

Open
@jabraham17

Description

@jabraham17

The chapel team has switched the build process for some of our developer tools to use scikit-build, but we are now running into issues configuring the build on some machines.

In our CMakeLists.txt file, we invoke an external script that determines the correct system compiler to use. But we are finding on some systems that it is being messed up by sckikit-build setting CC/CXX (even when the user didn't set them). This was done by @henryiii in #782 to fix fortran builds, but it is resulting in CC/CXX being set to invalid values. We would like to be able to opt-out of this behavior.

Currently, this can be achieved by doing CC=$(CC) CXX=$(CXX) pip install ., so that CC/CXX are present in the environment and set to their current value, if they have one.

Is there a way to specify environment variables like this to opt out of CC/CXX being inferred? Either indirectly by setting CC/CXX in pyproject.toml or directly.

For example:

[tool.scikit-build.environment]
CC=...
CXX=...

OR

[tool.scikit-build]
infer-cc = false

If such a feature doesn't exist, can it please be added. Alternatively, please suggest other ways to workaround this problem. We would like to avoid having users have to manually set CC/CXX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions