-
-
Notifications
You must be signed in to change notification settings - Fork 76
Add support for experimental .NET builds (GDExtension) #136
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| if [ "${DOTNET}" != "1" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| dnf install -y clang python-unversioned-command | ||
|
|
||
| git clone https://github.com/raulsntos/godot-dotnet | ||
| cd godot-dotnet | ||
| git checkout upgrade-assistant-plus-source-code-plugin-wip | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently it's using the latest commit on the WIP branch. We'll have to decide whether we want to have a local Git checkout and set the commit manually (like we do for Godot itself), or always build the latest dev branch. I'm not sure how the versioning for godot-dotnet will be like long term. |
||
|
|
||
| echo "Building and generating .NET extension..." | ||
|
|
||
| # TODO: Get rid of this when we fix all these trimming warnings in godot-dotnet. | ||
| cat << EOF >> .editorconfig | ||
| # Disable trimming warnings because it spams the output too much. | ||
| dotnet_diagnostics.IL2111.severity = none | ||
| EOF | ||
|
|
||
| prerelease_label="${GODOT_VERSION#*-}" | ||
| version_prefix="${GODOT_VERSION%-*}" | ||
|
|
||
| if [[ "${prerelease_label}" == "${GODOT_VERSION}" ]]; then | ||
| prerelease_label="" | ||
| fi | ||
|
|
||
| # TODO: Ensure we don't accidentally make stable releases. We can remove this when we're ready for a stable release. | ||
| if [[ -z "$prerelease_label" ]]; then | ||
| echo "YOU ARE NOT SUPPOSED TO MAKE A STABLE RELEASE WITH THIS" | ||
| exit -1 | ||
| fi | ||
|
|
||
| version_component_count=$(grep -o "\." <<< "$version_prefix" | wc -l) | ||
|
|
||
| if [ "$version_component_count" -eq 0 ]; then | ||
| version_prefix="${version_prefix}.0.0" | ||
| elif [ "$version_component_count" -eq 1 ]; then | ||
| version_prefix="${version_prefix}.0" | ||
| fi | ||
|
|
||
| if [[ -n "$prerelease_label" ]]; then | ||
| if [[ "$prerelease_label" =~ ^dev ]]; then | ||
| prerelease_label="${prerelease_label/dev/alpha}" | ||
| fi | ||
|
|
||
| prerelease_label=$(echo "$prerelease_label" | sed -E 's/([^0-9])([0-9])/\1.\2/g') | ||
| fi | ||
|
|
||
| echo "Building Godot .NET version ${version_prefix} (prerelease: '${prerelease_label}')" | ||
|
|
||
| dotnet --info | ||
|
|
||
| build_id="$(date +%Y%m%d).1" | ||
| final_version_kind="release" | ||
| if [[ -n "$prerelease_label" ]]; then | ||
| final_version_kind="prerelease" | ||
| fi | ||
|
|
||
| ./build.sh --productBuild --ci --warnAsError false \ | ||
| /p:GenerateGodotBindings=true \ | ||
| /p:VersionPrefix=${version_prefix} \ | ||
| /p:OfficialBuildId=${build_id} \ | ||
| /p:FinalVersionKind=${final_version_kind} \ | ||
| /p:PreReleaseVersionLabel=${prerelease_label} | ||
|
|
||
| cp -r artifacts/packages/Release/Shipping/* /root/out/ | ||
akien-mga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| echo ".NET bindings generated successfully" | ||
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 didn't need to install
python-unversioned-commandin my changes, is this to fix this error?:I "fixed" it by downloading the .NET SDK outside of the container. (raulsntos@ca22bd4#diff-4d2a8eefdf2a9783512a35da4dc7676a66404b6f3826a8af9aad038722da6823R273-R285)
But we could alternatively download the .NET SDK with the dotnet install script in the container image, so it's pre-downloaded, and then in this build script we just copy it to the
.dotnetdirectory. We just need to make sure it matches the version required inglobal.json(which right now is a moving target).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 didn't get that error myself. It's a bit weird that you fixed it by installing .NET outside the container, as it shouldn't use anything outside the container when in-container.
The reason I needed
python-unversioned-commandis that there's no/usr/bin/pythonby default in a barebones Fedora image. You had it working because you used our Linux SDK which providespython, but I don't think it's relevant to use our Linux SDK here as we don't need to create portable Linux binaries with GCC (I assume we only use dotnet and ClangSharp in this build?).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.
To be clear, when I said downloading .NET SDK outside the container, this just creates a
.dotnetdirectory inside the cloned repo that gets archived and sent to the container.That's correct, I just copied it from the
build-mono-gluescript without giving it much thought.