-
Notifications
You must be signed in to change notification settings - Fork 17
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
Compilation Error: Duplicate action writing to desktop_resources_folder_cmd.bat
#17
Comments
I continued to investigate the problem and found the root cause, which occurs only on Windows systems. It is produced by the following code, originating from the file # Copies a file to another file. If the destination directory does not exist
# it will be created. (Windows version)
def _copy_action_windows(ctx, input_file, output_file):
bat = ctx.actions.declare_file(ctx.label.name + "_cmd.bat")
# ... rest of the code
# Implementation function for rule below.
def _magritte_resources_folder_impl(ctx):
# ... rest of the code
for file in ctx.files.runtime_data:
# ...
if ctx.attr.is_windows:
_copy_action_windows(ctx, file, output_file) The error was occurring due to multiple actions trying to write to the same I've identified two solutions to resolve this problem and created two separate pull requests for them: Solution 1: Direct Command Execution (Pull Request #18 )Instead of writing to a cmd_part1 = "(if not exist \"%s\" mkdir \"%s\")" % (destination_folder, destination_folder)
cmd_part2 = " && @copy /Y \"%s\" \"%s\"" % (file_to_copy, destination_folder)
cmd = cmd_part1 + cmd_part2
ctx.actions.run(
inputs=[input_file],
outputs=[output_file],
executable="cmd.exe",
arguments=["/C", cmd],
use_default_shell_env=True,
) Solution 2: Unique
|
Description:
While compiling a project using the following command:
I encountered an error indicating a conflict with the file
desktop_resources_folder_cmd.bat
. The exact error message is:Environment:
Additional Information:
desktop_resources_folder_cmd.bat
multiple times, which is causing the conflict..bat
filename is unique to its context.I would appreciate any insights or potential fixes for this issue. Let me know if any additional information is required. Thanks in advance for your support.
Best regards,
The text was updated successfully, but these errors were encountered: