Skip to content

fix: determine copy file action based on execution platform #235

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

Closed
wants to merge 1 commit into from

Conversation

kormide
Copy link
Collaborator

@kormide kormide commented Sep 2, 2022

@alexeagle || @gregmagolan

Trying to follow the suggestions in these threads 1, 2. Apparently what we're doing here is choosing the batch or the shell script based on the target platform rather than the platform that's doing the copy.

I'm stuck. Running into errors like the following:

While resolving toolchains for target //lib/tests/copy_file:a_copy_from_dir: Unable to find an execution platform for target platform @local_config_platform//:host from available execution platforms []

Seems like it isn't recognizing my host system (Linux) as an execution platform. I haven't worked much with platforms or constraints in bazel yet, so maybe I'm missing something.

Related Slack thread

@kormide kormide force-pushed the copy-file-exec-groups branch from dbf7632 to 8c18c52 Compare September 2, 2022 19:15
Comment on lines -86 to +88
def copy_file_action(ctx, src, dst, dir_path = None, is_windows = False):
def copy_file_action(ctx, src, dst, dir_path = None):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I might have to keep this parameter for now if we want to avoid a breaking change since this is public. We may also want to pass in the exec_group names in case a downstream user doesn't use windows/not_windows.

@alexeagle alexeagle removed their request for review September 12, 2022 16:49
@gregmagolan
Copy link
Collaborator

This approach won't work since all exec_groups in a rule must be satisfy-able from available execution platforms

@gregmagolan
Copy link
Collaborator

We can fix the bug in copy actions using this approach however #241

@kormide kormide closed this Sep 13, 2022
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