Skip to content

Project with spaces (or other characters) doesn't build with NativeAOT on Android #115165

Closed
@jonathanpeppers

Description

@jonathanpeppers

Description

I noticed this while setting up some MSBuild integration tests for Android+NativeAOT:

But then, I found a simpler repro. In a Linux GitHub Codespace:

  1. mkdir 'Test Me'
  2. cd Test\ Me/
  3. dotnet new console
  4. dotnet publish -p:PublishAot=true -bl

Errors with:

Restore complete (2.1s)
  Test Me failed with 2 error(s) (3.9s) → bin/Release/net9.0/linux-x64/Test Me.dll
    clang : error : no such file or directory: 'Me.exports'
    /home/codespace/.nuget/packages/microsoft.dotnet.ilcompiler/9.0.4/build/Microsoft.NETCore.Native.targets(376,5): error MSB3073: The command ""clang" "obj/Release/net9.0/linux-x64/native/Test Me.o" -o "bin/Release/net9.0/linux-x64/native/Test Me" -Wl,--version-script=obj/Release/net9.0/linux-x64/native/Test Me.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libbootstrapper.o /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libRuntime.WorkstationGC.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libeventpipe-disabled.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libRuntime.VxsortEnabled.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libstandalonegc-disabled.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libstdc++compat.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/framework/libSystem.Native.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/framework/libSystem.Globalization.Native.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/framework/libSystem.IO.Compression.Native.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/framework/libSystem.Net.Security.Native.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/framework/libSystem.Security.Cryptography.Native.OpenSsl.a /home/codespace/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/9.0.4/sdk/libz.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -pthread -ldl -lrt -lm -pie -Wl,-pie -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" exited with code 1.

Build failed with 2 error(s) in 6.3s

This is pretty much exactly the same error we got targeting Android.

Reproduction Steps

See above.

Expected behavior

I can create console apps with spaces (or other odd characters) in the name, like Test Me.

Actual behavior

I get a build error with a project named Test Me.

Regression?

NativeAOT on Android is new, unsure if this worked previously on Linux.

Known Workarounds

Name your project Test_Me.

Configuration

$ dotnet --info
.NET SDK:
 Version:           9.0.203
 Commit:            dc7acfa194
 Workload version:  9.0.200-manifests.9df47798
 MSBuild version:   17.13.20+a4ef1e90f

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/9.0.203/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.4
  Architecture: x64
  Commit:       f57e6dc747

.NET SDKs installed:
  8.0.407 [/usr/share/dotnet/sdk]
  9.0.203 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.14 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other information

Binlog file: Test Me.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions