-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Document the Unification of tools/target build type configuration #6316
Document the Unification of tools/target build type configuration #6316
Conversation
|
||
scons p=<platform> tools=yes module_mono_enabled=yes mono_glue=no | ||
scons p=<platform> target=editor module_mono_enabled=yes mono_glue=no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mono_glue
is no longer used. Build process is:
- Build executable with
module_mono_enabled=yes
- Run
--headless --generate-mono-glue modules/mono/glue
- Run
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform={PLATFORM_NAME}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the first binary need to be a target=editor
build or can it be one of the template_debug
or template_release
templates as well?
Do we need special steps to create target=template_release production=yes
builds?
In the current documentation examples list all the commands to create all three variants. What would be the updated equivalent?
# Build temporary binary
scons p=windows target=editor module_mono_enabled=yes
# Generate glue sources
bin\godot.windows.editor.x86_64.mono --generate-mono-glue modules/mono/glue
# Build binaries
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform={PLATFORM_NAME}
# are the below steps needed with the new commands?
### Build binaries normally
# Editor
scons p=windows target=editor module_mono_enabled=yes
# Export templates
scons p=windows target=template_debug module_mono_enabled=yes
scons p=windows target=template_release module_mono_enabled=yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs for setting up Visual Studio Code are also incorrect at this point. I was unable to hit any breakpoints until I set the "dev_build=yes"
scons option in my build task.
I've tried to incorporate all feedback. Some things are still unclear (see above). Please re-review |
79f1267
to
4e97306
Compare
rebased to solve conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the instructions for compiling with "Mono" and left a few suggestions but there are many other issues unrelated to this PR with this documentation since building with the .NET module is very different from what it was in 3.x.
Mono is no longer required as it's not used anymore, we also no longer build the Mono runtime and mobile is not currently supported (likely won't be until 4.1+). Since this grows the scope of the PR I think it's fine to ignore and open a separate PR for the .NET documentation.
Keep in mind that the process will likely change again with the editor unification so it may not be worth updating the .NET documentation for now.
@@ -58,15 +58,15 @@ Generate the glue | |||
Glue sources are the wrapper functions that will be called by managed methods. | |||
These source files must be generated before building your final binaries. In | |||
order to generate them, first, you must build a temporary Godot binary with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer a temporary Godot binary it's the final one, now we only need to build Godot once.
This path must be ``modules/mono/glue`` in the Godot directory:: | ||
|
||
<godot_binary> --generate-mono-glue modules/mono/glue | ||
<godot_binary> --headless --generate-mono-glue modules/mono/glue | ||
|
||
This command will tell Godot to generate the file ``modules/mono/glue/mono_glue.gen.cpp``, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer generate a mono_glue.gen.cpp
file.
Once you have generated the Mono glue, you can build the final binary with | ||
``mono_glue=yes``. This is the default value for ``mono_glue``, so you can also | ||
omit it. To build a Mono-enabled editor:: | ||
Once you have generated the Mono glue, you can generate the final binary with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't generate the Godot binary, it just builds the .NET assemblies into DLLs that will be loaded by the .NET module.
We may also want to add instructions about setting up a local NuGet repository like in the module's README.md.
|
||
### Build binaries normally | ||
# Editor | ||
scons p=windows target=release_debug tools=yes module_mono_enabled=yes | ||
scons p=windows target=editor module_mono_enabled=yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is no longer necessary since the first scons
build is already the final binary, no need to build it again. Same for other platforms.
bin\godot.windows.tools.64.mono --generate-mono-glue modules/mono/glue | ||
bin\godot.windows.editor.x86_64.mono --generate-mono-glue modules/mono/glue | ||
# Generate binaries | ||
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run a python script like this in Windows? I think you might need to execute it with the python
command and the directory separator should probably be replaced with \
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forward slash directory separators should be converted automatically by Windows, but the leading ./
should be removed as it won't work (it can also be removed on macOS/Linux, for files that are in a subfolder).
You will need to add the python
command in front of the script path though.
|
||
- Whether to include the glue source files in the build | ||
and define ``MONO_GLUE_DISABLED`` as a preprocessor macro. | ||
|
||
- **mono_prefix**\ =path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mono_prefix
is now an argument of the build_assemblies.py
script, although it probably should be removed as we no longer use Mono and I feel like using Mono's MSBuild may not work.
mono_static
and copy_mono_root
have also been removed in 4.0.
I'm in favor of merging this PR first and doing that work in a follow-up PR. |
I left some comments regarding spelling and typos. Otherwise it looks fine and I want to get this merged!:) |
We can use Squash on merge on the godot-docs repository, so it's not necessary here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The Mono/.NET documentation should be updated in a follow up and was partly outdated before already.
Introduced in godotengine/godot#66242 the `tools=yes/no` option was removed and merged into the `target` preset. Replace the `tools=yes/no` calls in the documentation to the new template target presets `editor`, `template_release` and `template_debug`.
Changed mentions for `vscode`, `kdevelop` and `qtcreator`
Co-authored-by: Raul Santos <[email protected]> Co-authored-by: Marius Hanl <[email protected]>
c08d4c5
to
fe9b6fd
Compare
Thanks for the feedback, incorporated the non-mono parts. I'm in favor of leaving out the mono-related changes in this PR as it seems those need someone more capable to incorporate those .NET documentation changes. I also have no Windows installation to check the documented commands. So please if possible merge this PR, as I don't intend to update the mono documentation because of the mentioned reasons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good to me. I reviewed the introduction to buildsystem page quite closely as well as the platforms I am familiar with: Android, Linuxbsd, macOS, web, and windows.
I have a left a few suggestions for improvements. I can also see that there are a few outstanding comments for building with mono. The building with mono page seems quite complex and it may be best to have one of the mono maintainers do the update rather than including it here. I want to avoid blocking this PR any longer as these pages desperately need the update.
Co-authored-by: Clay John <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything except the mono page seem fine to me.
We discussed this a bit on the rocketchat and agreed to move forward with this PR as-is. The Mono changes are not from godotengine/godot#66242, but from all of the other changes that have happened recently so it is fine for them to be made in a separate PR from someone who is more knowledgeable about the c sharp specific changes to the buildsystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thank you very much @NeroBurner for your hard work and sticking with this PR. And congratulations on your first merged PR in this repo! Thanks to you as well @Maran23 for your multiple diligent reviews. |
Was |
Introduced in godotengine/godot#66242 the
tools=yes/no
option was removed and merged into thetarget
preset.Replace the
tools=yes/no
calls in the documentation to the new template target presetseditor
,template_release
andtemplate_debug
.It's my first PR here, so please tell me if something is missing or done wrong. I just was confused why the
scons target=debug
builds didn't work. After finding out about the change I thought I'd take this opportunity to fix the documentation for everyone and learn quite a bit in the process