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

Publishing a C# Project via AOT with Spaces in the Project Name Fails #102747

Closed
milesdesiran opened this issue Feb 12, 2025 · 1 comment
Closed

Comments

@milesdesiran
Copy link

Tested versions

  • Reproducible in: 4.3 stable (mono)

System information

Arch Linux x64 | gcc 14.2.1, clang 19.1.7, dotnet-sdk/runtime 9.0.1.sdk102

Issue description

When using NativeAOT export, if the project's name has a space in it, the publish command will not quote the .exports file, causing compilation to fail.

MSB3073: The command ""clang" "/home/user/cool-project/.godot/mono/temp/obj/ExportDebug/linux-x64/native/Cool Project.o" -o "/home/user/cool-project/.godot/mono/temp/bin/ExportDebug/linux-x64/native/Cool Project.so" -Wl,--version-script=/home/user/cool-project/.godot/mono/temp/obj/ExportDebug/linux-x64/native/Cool Project.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/sdk/libbootstrapperdll.o /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/sdk/libRuntime.WorkstationGC.a /home/user/nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/sdk/libeventpipe-disabled.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/sdk/libstdc++compat.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/framework/libSystem.Native.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/framework/libSystem.Globalization.Native.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/framework/libSystem.IO.Compression.Native.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/framework/libSystem.Net.Security.Native.a /home/user/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.12/framework/libSystem.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -lrt -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" exited with code 1. /home/user/.nuget/packages/microsoft.dotnet.ilcompiler/8.0.12/build/Microsoft.NETCore.Native.targets(366,5)

--version-script=/home/user/cool-project/.godot/mono/temp/obj/ExportDebug/linux-x64/native/Cool Project.exports is the problem.

The .csproj:

<Project Sdk="Godot.NET.Sdk/4.3.0">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
    <EnableDynamicLoading>true</EnableDynamicLoading>
    <RootNamespace>CoolProject</RootNamespace>
    <PublishAOT>true</PublishAOT>
  </PropertyGroup>

  <ItemGroup>
    <TrimmerRootAssembly Include="GodotSharp" />
    <TrimmerRootAssembly Include="$(TargetName)" />
  </ItemGroup>
</Project>

Steps to reproduce

  1. Create new Godot project with C# enabled, with a space in the project's name
  2. Generate .csproj+.sln via editor tools
  3. Add <PublishAOT>true</PublishAOT> and root block to prevent trimming
  4. Create any export preset and try to export, with or without debug

Minimal reproduction project (MRP)

example-project.zip

@raulsntos
Copy link
Member

Thanks for the report, this appears to be an upstream issue in the .NET SDK. Godot simply executes dotnet publish to export the C# project, the clang command is launched by the .NET SDK.

It looks like this specific issue has already been reported upstream in dotnet/runtime#13740, so follow that issue for updates.

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

No branches or pull requests

3 participants