Through the various machines me and my partner are developing with, it seems like the Windows SDK pdc.exe --main doesn’t work the same as it does on macOS and linux. The option is to override the main.lua to a different lua file, and it works just fine on those systems. On Windows, however, it seems to always run main.lua. Using the latest Playdate SDK on each machine.
I tried flipping the slashes to backslashes on windows, and it gave an error about needing a lua or pdx file. So I guess it wants forward slashes for that argument?
I also ran the command line from the source\ folder in my repo to remove relpaths entirely, and it still would not run with the main2.lua logic.
Just wanted to also mention that this should be very easy to repro using vscode and the excellent midouest.playdate-debug extension, which has a very nice UI to run a single lua file directly in the simulator. That’s why the command lines are being generated with abs paths and such.
When I do pdc –-main C:/path/to/main2.lua with unix path it worked for me. However, I noticed all compilers seem to ignore the output dir if you override main.
Thanks for trying out a bare pdc command line. I guess I’m glad it’s not impossible to make it work on Windows. Is it reasonable to assume that pdc should work the same way on each platform the SDK is available?
I have put together an end-to-end test app to demonstrate the issue on github at gorlak/PlaydateTest.
Diffing the two .pdx folders it’s easy to see that windows is disregarding the --main argument and packing main.pdz and main-dvd.pdz on windows (while only packing main.pdz on macOS).
It would be really nice if a fully qualified command line, with output directory, overridden main, sdk path, etc, worked the same on each platform. Not only is it more work to figure out which specific incantation works on each platform and coerce anything that may call pdc to use that incantation (vs. fixing this likely bug in the windows arg parser or pdx logic), but this also costs other people time figuring this out.
When I do "C:\Users\geoff\Documents\PlaydateSDK\bin\pdc" --main "c:/Users/geoff/Projects/PlaydateTest/source/main-dvd.lua" in that sample project I mentioned above, it doesn’t boot into the specified main-dvd.lua. Using SDK 2.7.6.