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

Improve paths in assets builder #357

Open
2 tasks
boozook opened this issue May 9, 2024 · 7 comments
Open
2 tasks

Improve paths in assets builder #357

boozook opened this issue May 9, 2024 · 7 comments
Assignees
Labels
assets Assets Build System bug Something isn't working build-utils cargo About cargo or cargo-playdate windows About windows target and related problems

Comments

@boozook
Copy link
Owner

boozook commented May 9, 2024

Because there is infinite troubles with windows' paths.
Also just to ensure that all going well on each step.

  • use something like relative-path or typed-path
  • write more tests
@boozook boozook added enhancement New feature or request assets Assets Build System build-utils labels May 9, 2024
@notpeter
Copy link
Contributor

notpeter commented May 9, 2024

Yeah, compiling the stock hello world example throws this error on windows

C:\Users\peter\code\pd-hello>cargo +nightly playdate run
error: The filename, directory name, or volume label syntax is incorrect. (os error 123), caused when planning assets for pd-hello v0.1.0 (C:\Users\peter\code\pd-hello).
error: The filename, directory name, or volume label syntax is incorrect. (os error 123)

This error is caused by these lines in the generated Cargo.toml:

[package.metadata.playdate.assets]
"img/system/" = "${PLAYDATE_SDK_PATH}/Examples/Game Template/Source/SystemAssets/*.png"
"sfx/jump.wav" = "${PLAYDATE_SDK_PATH}/Examples/Level 1-1/Source/sfx/jump.wav"

It works if you hard code a windows path on the RHS so I assume it has something to do with the env var interpolation or something related to #352.

@boozook boozook added bug Something isn't working windows About windows target and related problems cargo About cargo or cargo-playdate and removed enhancement New feature or request labels May 9, 2024
@boozook boozook self-assigned this May 12, 2024
@boozook boozook moved this to Todo in Playdate Development May 12, 2024
@boozook
Copy link
Owner Author

boozook commented May 12, 2024

"img/system/" = "${PLAYDATE_SDK_PATH}/Examples/Game Template/Source/SystemAssets/*.png"

Is's a glob in the path. There is blocking wax's issue olson-sean-k/wax#34 , but I'll try to workaround it translating paths to normal slash / and escaping : in volume name - to make path more look like valid pattern.

@boozook
Copy link
Owner Author

boozook commented May 12, 2024

Also, seems to current implementation works normally if run in the bash-like shell on windows, but not in powershell.

@bremco
Copy link

bremco commented Nov 24, 2024

Hi! I just ran into something similar in bash (in Linux Manjaro) -- I had to remove the { and } from both lines mentioned above, otherwise I got:

[remco@deck pd-hello]$ cargo playdate run
error: malformed glob expression: adjacent component boundaries `/` or `**`, caused when planning assets for pd-hello v0.1.0 (/home/remco/code/pd-hello)
error: malformed glob expression: adjacent component boundaries `/` or `**`

So it seems it's not just a Windows problem.

@boozook
Copy link
Owner Author

boozook commented Nov 24, 2024

@bremco Are you one hundred percent sure that the environment variables you specified are set? This may be if the variable is missed, because I removed the panic for the missed variables and instead of panic just left the path as it is. If I remember correctly. I know that it’s not good, it’s the point to change.

@bremco
Copy link

bremco commented Nov 24, 2024

This is the one you mean right?

[remco@deck pd-hello]$ echo $PLAYDATE_SDK_PATH
/home/remco/opt/PlaydateSDK-2.6.1/

I'm only getting started with Rust, but I've been developing for the Playdate for a while. I always take care to set that environment variable, otherwise my own scripts would also fail :-)

In any case, everything (well, at least the basic example, both in the sim and on the device) works properly if I just remove {}s (at least in my case).

@boozook
Copy link
Owner Author

boozook commented Nov 24, 2024

This is the one you mean right?

Yes, exactly.

works properly if I just remove {}s

That's strange because resolver with regex requires curly braces - (${([^}]+)}). And there is default as-is string if can't resolve.

Okay, anyway that resolver should be rewritten entirely, as I planned it. Thank you, I'll look at it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Assets Build System bug Something isn't working build-utils cargo About cargo or cargo-playdate windows About windows target and related problems
Projects
Status: Todo
Development

No branches or pull requests

3 participants