Skip to content

Conversation

mkosiba
Copy link

@mkosiba mkosiba commented Jul 31, 2025

In #2661 the exec_compatible_with was added. This breaks some of our Linux-based tests where we use systemtap dtrace. I was hoping we could move the constraint onto the tool itself (that way we can supply one that's Linux-compatible and things keep working).target_compatible_with works for my usecase, but it's not exactly the same as the previous solution. @brentleyjones, could you have a look and let me know if this works for you?

Copy link

google-cla bot commented Jul 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mkosiba mkosiba force-pushed the dtrace_exec_compat branch from 4dcbfc0 to 7ab34a6 Compare July 31, 2025 17:58
@brentleyjones
Copy link
Collaborator

target_compatible_with doesn't influence toolchain selection, which is what is needed for exec_compatible_with. So some form of exec_compatible_with will be needed still.

@mkosiba
Copy link
Author

mkosiba commented Aug 5, 2025

@brentleyjones, can you explain a bit more about toolchain selection for dtrace_compile? AFAICT the dtrace binary path is hardcoded (so not affected by toolchain resolution). Or is it that you have both macos and linux remote workers available and want to make sure this rule only runs on the macos workers?

@brentleyjones
Copy link
Collaborator

Or is it that you have both macos and linux remote workers available and want to make sure this rule only runs on the macos workers?

Something like that. We initiate our builds from Linux, to run on macOS executors, and without this change it could select Linux exectors.

@mkosiba
Copy link
Author

mkosiba commented Sep 4, 2025

ok, so I think using a toolchain (as the updated PR now does) should work for that setup. I did a bit of testing:

  • if --host_platform=linux then the build fails with a toolchain resolution error (I'm assuming that's OK from a UX perspective),
  • if --host_platform=linux --extra_execution_platforms=linux,macos then the macos platform gets chosen for the rule, so this should have similar behavior to setting exec_compatible_with on the rule,
  • if --host_platform=macos then this works without any extra configuration.

I'm happy to toolchain-ify the other rules that have exec_compatible_with set if you'd like me to (I don't think there is benefit to this other than consistency).

@brentleyjones
Copy link
Collaborator

Neat!

I'm happy to toolchain-ify the other rules that have exec_compatible_with set if you'd like me to (I don't think there is benefit to this other than consistency).

Only a benefit if we are using a path that we want to override.

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.

2 participants