Skip to content

Conversation

@matt-sm
Copy link
Contributor

@matt-sm matt-sm commented Oct 2, 2025

Follow up to 1d8e362.

We are still experiencing intermittent occurances of this issue whereby the wrapper script is empty on windows. Was finally able to repro with a target that had a dep on a large number of runnable binaries. Inexplicably, when I changed the redirect to a pipe, the target never failed. With a redirect I would still see intermittent failures.

Closest msys2 related bug: msys2/MSYS2-packages#1703 (comment)

@matt-sm matt-sm force-pushed the empty-wrapper-error branch 3 times, most recently from 8dd0ab1 to ab2f617 Compare October 9, 2025 20:36
@matt-sm matt-sm marked this pull request as draft October 9, 2025 20:37
@matt-sm matt-sm force-pushed the empty-wrapper-error branch 2 times, most recently from c8d32b8 to f684b22 Compare October 10, 2025 02:05
@matt-sm matt-sm changed the title print an error message for empty runnable binary wrapper pipe runnable_binary wrapper output Oct 10, 2025
@matt-sm matt-sm marked this pull request as ready for review October 10, 2025 02:12
@matt-sm
Copy link
Contributor Author

matt-sm commented Nov 7, 2025

@cerisier this is another PR for your review. We've been running our windows builds with this fix for a while now and haven't seen any more runnable_binary failures

@cerisier
Copy link
Collaborator

cerisier commented Nov 8, 2025

Can you try with this or the equivalent as the cmd_ps attribute of the genrule ?

(Get-Content "$(location @rules_foreign_cc//foreign_cc/private:runnable_binary_wrapper.sh)") -replace 'EXECUTABLE', "$(rlocationpath {name})" | Set-Content $@

@matt-sm
Copy link
Contributor Author

matt-sm commented Nov 19, 2025

The problem with this idea is that private:runnable_binary_wrapper.sh won't run in ps

Fails on first line

line 1: #!/usr/bin/env: No such file or directory

As a follow up to 1d8e362, we are still experiencing intermittent occurances of this issue whereby the wrapper script is empty on windows, and have been unable to reliably repro. This error message will at least give the user a clue of what the actual problem is.
@matt-sm matt-sm force-pushed the empty-wrapper-error branch from 7bdddf5 to ce4752e Compare November 19, 2025 06:31
@matt-sm
Copy link
Contributor Author

matt-sm commented Nov 19, 2025

During more testing on windows with multiple runnable_binary rules, there was a race condition whereby the contents of tmp were written to the wrong wrapper.

Changing to tmp_$$$$ to make this file unique.

@cerisier
Copy link
Collaborator

All of this sound more and more like a sandboxing issue. Do you have the sandbox enabled ? are your actions local only ?

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