Skip to content
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

Fix post-build file move on Windows #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aixxe
Copy link

@aixxe aixxe commented Nov 28, 2023

This is the only issue I encountered when building USBemani for my controller on Windows.

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf
FAILED: community_aixxe_mini-4-optical.elf 
cmd.exe /C "[...] && cd /D D:\usbemani\obj\community_aixxe_mini-4-optical && mv community_aixxe_mini-4-optical.* D:\usbemani/build/""
'mv' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.

This change uses the move command when the host system is Windows.

Unlike mv, it will print paths for each moved file by default:

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.bin
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.dis
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.elf
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.elf.map
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.hex
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.uf2
        6 file(s) moved.

Build finished

The > NUL at the end of the command supresses this, so it should be consistent with the behaviour on Linux/macOS.

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf

Build finished

@progmem
Copy link
Owner

progmem commented Nov 28, 2023

This will work, though I have a couple thoughts:

  • I need to double-check to see what's happening for the AVR builds as well. There's a good chance we would have a failure there as well.
  • Ideally, it might be worth making this part of the process that normally just delegates to CMake/DMBS/etc., rather than having the build process worry about it.

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