YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Building Projects: [macOS] "post_run_step" script is not called at the correct time if using the Windows IDE #5453

Closed tabularelf closed 6 months ago

tabularelf commented 6 months ago

Is your feature request related to a problem?

Right now there's no real way on operating or executing on the final product, after it has been completely built. That being whether it is on Windows, MacOSX or Linux. This may seem minimal, but it does really complicate things. My small extension, MulticClient requires MacOSX and Linux builds to be fully built (VM in particular) in order for me to run and intercept the build process to run multiple executables at once for network testing. But this could also be used in cases where a developer may wish to automate the whole build process, and upload to services like Steam via Steampipe, itch.io via Butler, or any other service with their own custom CLI tooling.

Describe the solution you'd like

I'd like to propose post_output_step, which will run at the very end of the build process, just after the files have been placed in their output destination. (On export, that'll be the export destination. Running from the IDE, that will be just the current temporary test folder that the final executable/wad and game files are stored)

Describe alternatives you've considered

For MultiClient, there is no easy alternatives besides just telling the user to export their game and then run it multiple of times lol.

But for the other scenario:

Additional context

No response

stuckie commented 6 months ago

This will already be available with GMRT

DiasFranciscoA commented 6 months ago

Hello @tabularelf,

For what is worth this should be already possible. If you look at post_run_step is, by definition the script is ran just before Igor launches your game. So at this point the game already exists fully built.

The GDKExtension does exactly that it executes commands after the game has finished being built and then forces igor to quite by exiting with code 1

[!TIP] You can make use of post_run_step event to post-process your fully built game. Just make sure to always exit 1 from this script. This will make igor believe there was an error executing the script and will halt meaning it will not actually run your game. Packages work differently post_package_step is executed right before the packaging final step so you can actually change stuff in the process to the final product before packaging.

tabularelf commented 6 months ago

Hello @tabularelf,

For what is worth this should be already possible. If you look at post_run_step is, by definition the script is ran just before Igor launches your game. So at this point the game already exists fully built.

Hello @DiasFranciscoA, I am well aware that does work, for Windows. This doesn't work for platforms like MacOSX (in the case of building from Windows to MacOSX, with the VM target) as the rest of the games assets have not been sent over to MacOSX yet. It executes post_run_step, and then sends over the game assets. If I were to run this in YYC however, everything gets sent and compiled over there with xcode. This is keeping in mind that I have tested MultiClient just now on IDE v2024.2.0.132 Runtime v2024.2.0.163. Which sure, maybe building from Windows to MacOSX isn't much of a concern for the final package output. So fair.

While post_run_step.sh does work on MacOSX (while not in the intended place they should be I feel, they are obtainable at the very least and therefore their arguments can be replicated to run an app at the destination), they both fail on post_package_step on VM, from Windows to MacOSX, to directly exporting on MacOSX via the Mac GameMaker IDE. The files themselves are not packaged yet, nor are ready to run at this stage. This could possibly be remedied by running post_package_step AFTER the files have been completed, but I fear that would just cause some issues.

DiasFranciscoA commented 6 months ago

So what we will be changing is the post_run_step. The post_run_step should be executed after the build product is transfered to the remote machine, this will still always be local to the actual machine running the IDE so if we are on Windows -> macOS this script will run on the windows machine.

DiasFranciscoA commented 6 months ago

@tabularelf sorry about the mistake just updated the post_package_step information. We will also be changing the post_run_step execution on macOS to be in the correct place.

Emc1923 commented 3 months ago

Verified done, closing.