Skip to content

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

@milesdesiran

Description

@milesdesiran

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions