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

Add a run option to SCons to automatically run an engine binary after it was compiled #11719

Open
Calinou opened this issue Feb 7, 2025 · 0 comments · May be fixed by godotengine/godot#102550

Comments

@Calinou
Copy link
Member

Calinou commented Feb 7, 2025

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

When you compile a Godot binary, you have to run it manually afterwards. This can be accomplished with an external command, but it's slower than letting SCons itself run the binary as SCons takes some time to shut down after running everything (usually 1-2 seconds). Also, if you don't run Godot after it's compiled, you may be distracted while doing something else.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a run option to SCons to automatically run an engine binary after it was successfully compiled. This option accepts an argument that will be passed to the engine binary as command line arguments. For example:

# Run project manager.
scons run=-p

# This passes "yes" as a positional argument to Godot, which Godot won't do anything about, so it'll act the same as above unless CWD is a project folder.
scons run=yes

# Open a project in the editor.
scons run=/path/to/project.godot

# Run a project directly.
scons run="--path /path/to/project"

When combined with #11717, this is where the feature becomes the most powerful:

scons run="--import-project ~/Downloads/project.zip /tmp/project"

# Or if support for importing projects URLs was also implemented:
scons run="--import-project https://example.com/project.zip /tmp/project"
# This way, you don't need to download the MRP's ZIP anymore.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Modify the top-level SConstruct to add a new task that runs when the build finishes. This should only be done if the value of the run option is a non-empty string.

If this enhancement will not be used often, can it be worked around with a few lines of script?

You can write a shell script like gd-pr-test.sh, but such scripts are generally not cross-platform.

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving the developer experience (DX) for engine contributors and power users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant