Skip to content

[SYCL] Add flag to print CMake args without execution to buildbot.py #19636

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

Merged
merged 1 commit into from
Aug 1, 2025

Conversation

blenderfreaky
Copy link
Contributor

Adds a --print-cmake-flags option to the configure.py helper script.

When used, the script will print the generated list of CMake arguments to stdout and exit immediately. This suppresses all other output and does not invoke the cmake command.

This is useful for packaging or integrating with build systems that need/prefer to call cmake manually.

Tagging @sarnex

Copy link
Contributor

@KornevNikita KornevNikita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - do you plan to use the output as part of some automation?

@sarnex
Copy link
Contributor

sarnex commented Jul 30, 2025

@KornevNikita This is a follow up from the discussion in issue #19347, they're working on NixOS packaging and the raw CMake commands is useful to them

@@ -411,9 +416,13 @@ def main():
parser.add_argument(
"--use-zstd", action="store_true", help="Force zstd linkage while building."
)
parser.add_argument(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could call the flag --dry-run? that one is commonly used and seems to fit here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 140 would be a less obvious change with dry-run as option name. Not that I'm arguing for one or another, just stating.

Copy link
Contributor

@sarnex sarnex Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah fair, based on the description it seems generating a cmake command with no other output is important for this use case, so the name is fine enough as is and i don't think we need to spend 15 years bikeshedding :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make it clear, we still reserve the right to remove the entire script if we switch to using CMake caches instead of it. Use it in any automation at your own risk.

@blenderfreaky

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right sorry, I mentioned it in the issue I linked in my other comment but this script is for the convenience of developers in the repo, and the only stable interface is the LLVM CMake infrastructure which we have extended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that was my reasoning behind not naming it --dry-run as well.

I understand that the script isn't stable, I'm just using it because it's the method recommended by the docs and makes it easier to keep in sync. (It's also what the AUR packages uses for example)

The way updates on Nix work, any update will require manual approval anyways, so there shouldn't be any random breakage if it gets removed.

Adds a `--print-cmake-flags` option to the configure.py helper script.

When used, the script will print the generated list of CMake
arguments to stdout and exit immediately. This suppresses all
other output and does not invoke the cmake command.

This is useful for packaging or integrating with build systems
that need/prefer to call cmake manually.
@blenderfreaky
Copy link
Contributor Author

Rebased to fix formatting errors

@aelovikov-intel aelovikov-intel merged commit 76a887e into intel:sycl Aug 1, 2025
25 checks passed
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