Comments (17)
i suddenly remembered something about mkdir on windows.... the reason you cant run commands like mkdir on windows, is because its an internal cmd command and not a standalone executable.
meaning, it only works when inside a windows shell environment.
duckscript is indeed the way to go forward since it provides a real cross platform api.
from bevy_game_template.
I ran it outside of the scripts 😀 I'll do a clean download of your template and try everything again.
from bevy_game_template.
Same error for me on Win10 running Windows Terminal/Powershell/Starship prompt. I've tried
[tasks.create-build-dir]
args = ["./build/web/target"]
command = "mkdir"
and
[tasks.create-build-dir]
args = ["-p", "./build/web/target"]
command = "mkdir"
Running either mkdir
command directly from the command line in the project root creates the folders as expected. I can skip this step by manually creating the folder and adding
[tasks.create-build-dir]
ignore_errors = true
# ...
But then I get a "file not found" error on copying the wasm file to the target directory.
I've also tried
[tasks.echo-path]
command = "echo"
args = ["${CARGO_MAKE_WORKING_DIRECTORY}/build/web/target"]
[tasks.create-build-dir]
args = ["-p", "${CARGO_MAKE_WORKING_DIRECTORY}/build/web/target"]
command = "mkdir"
dependencies = ["echo-path"]
The correct path is printed but the create-build-dir
task still fails. Replacing /build/web/target
with \\build\\web\\target
also fails.
This works though
[tasks.create-build-dir]
script_runner = "@duckscript"
script = [
'''
p = canonicalize "build/web/target"
mkdir ${p}
''']
from bevy_game_template.
Hey @NiklasEi, I emailed you recently, not sure if you mind.
from bevy_game_template.
It seems there are some weird path things on windows. I had to replace all the cp
and mv
commands with this before it worked.
[tasks.copy-files-for-release]
script_runner = "@duckscript"
script = [
'''
target = set "./build/web/target"
web = set "./build/web"
windows = set "./build/windows"
echo "Creating ${target}"
rm -r ${web}
mkdir ${target}
echo "Copying ${windows}/icon.ico to ${web}/icon.ico"
cp ${windows}/icon.ico ${web}/icon.ico
echo "Moving ${web}/icon.ico to ${web}/favicon.ico"
mv ${web}/icon.ico ${web}/favicon.ico
echo "Copying ${TARGET_DIR}${CARGO_MAKE_CRATE_NAME}.wasm to ${target}"
cp ${TARGET_DIR}${CARGO_MAKE_CRATE_NAME}.wasm ${target}/${CARGO_MAKE_CRATE_NAME}.wasm
echo "Copying ${TARGET_DIR}wasm.js to ${target}"
cp ${TARGET_DIR}wasm.js ${target}/wasm.js
echo "Copying ${TARGET_DIR}wasm_bg.wasm to ${target}"
cp ${TARGET_DIR}wasm_bg.wasm ${target}/wasm_bg.wasm
echo "Copying ./index.html to ${web}"
cp ./index.html ${web}/index.html
echo "Copying ./assets to ${web}"
cp ./assets ${web}
echo "Copying ./credits to ${web}"
cp ./credits ${web}
''']
from bevy_game_template.
Resolved using the script @will-hart proposed
from bevy_game_template.
Hey, thanks for raising the issue.
I am currently settign up my windows PC to be able to test this myself, but it looks like the mkdir
command just needs to be different for Windows.
from bevy_game_template.
I tried to run the command separately and it didn't complain. Thanks for helping out!
from bevy_game_template.
I finally finished setting up my Windows machine. In my case the command worked out of the box. I have very little experience with commands on Windows, so I am not sure how to change it to be more compatible.
I tried to run the command separately and it didn't complain.
Do you mean you ran the mkdir
command as is outside of the cargo-make
task? Or did you run several mkdir
commands always just creating one subdirectory?
from bevy_game_template.
Nah, same thing. How would you suggest to debug this 🧐 ? Quite annoying to wait for a whole minute for everything to compile just to get this error.
from bevy_game_template.
This seems to be a simple issue, but to be honest I have no idea what mkdir
on windows actually does/can do. Seems that there are a lot of possible different setups here (actually "works on my Win10 machine" ^^).
Maybe you could try some small changes like build/web/target
-> ./build/web/target
? I don't think you need to do a clean download of the template every time. Just make sure to not have the build/web
directory, then the situation should be the same as for a fresh download.
from bevy_game_template.
This works though
[tasks.create-build-dir] script_runner = "@duckscript" script = [ ''' p = canonicalize "build/web/target" mkdir ${p} ''']
I tested this and for me, it also works. I will push this and maybe @rgripper can verify, that this also solves the issue on his machine?
from bevy_game_template.
don't have windows myself, but this is a strange one.
a task with a command + args is basically like running rust std::process::Command which i probably behaves differently than running the command inside a shell.
however, the question is this running inside a linux subsystem?
because i see an example of:
[tasks.create-build-dir]
args = ["-p", "${CARGO_MAKE_WORKING_DIRECTORY}/build/web/target"]
command = "mkdir"
dependencies = ["echo-path"]
and i'm not sure dos knows what -p is (could be wrong).
from bevy_game_template.
I can confirm that the issue appears in all cp
, mv
and mkdir
commands on Windows when run from cargo make serve
.
- However, all of the commands (except for mkdir's
-p
) work when executed manually outside themake
. - The workaround #7 (comment) solves the issue.
from bevy_game_template.
@MikulasZelinka Thanks for testing and reporting your findings!
@will-hart would you be willing to open a PR to close this issue with your changes above?
from bevy_game_template.
Hey sorry, been busy with IRL. I can create a PR, although I can't test on MacOS or Linux.
from bevy_game_template.
Link to the relevant PR: #10.
from bevy_game_template.
Related Issues (20)
- CI does not fail on clippy warnings
- Fullscreen CSS tweak HOT 4
- WARNING: No tag push needed to trigger workflows HOT 2
- Control canvas size thorugh game-container css class
- [iOS] crash on open url click HOT 4
- Cross-compile for windows with the GNU toolchain?
- Replace custom wasm-opt integration with trunks build-in support
- Cant get cargo apk or xbuild to work HOT 3
- Bevy 0.14 HOT 2
- 3d apps do not work in iOS simulator HOT 2
- Ensure running on an iOS Simulator still works HOT 1
- Stuck at trunk serve
- trunk only show black screen HOT 2
- Thanks
- Mac OS release CI workflow fails: "can't find crate for `core`" HOT 6
- Error when compiling apk HOT 1
- LTO options in release and dist profiles are swapped HOT 1
- Building for iOS causes errors HOT 7
- BUILD_INSTALLER doesn't work as expected
- trunk serve is broken HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy_game_template.