Skip to content

DotnetFuzzing doesn't compile on linux succesfully #113285

Open

Description

@personnumber3377

Description

After building dotnet with ./build.sh -subset clr+libs -configuration Release -runtimeConfiguration Debug and then trying to run dotnet build with the compiled binary in the fuzzers directory, I am hit with the following error:

~/runtime/src/libraries/Fuzzing/DotnetFuzzing$ dotnet build

  Determining projects to restore...
  Restored /home/oof/runtime/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj (in 390 ms).
  Restored /home/oof/runtime/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj (in 377 ms).
  Restored /home/oof/runtime/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj (in 379 ms).
  Restored /home/oof/runtime/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj (in 390 ms).
  Restored /home/oof/runtime/src/libraries/System.Formats.Nrbf/src/System.Formats.Nrbf.csproj (in 389 ms).
  Restored /home/oof/runtime/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj (in 377 ms).
  Restored /home/oof/runtime/src/tools/illink/src/linker/Mono.Linker.csproj (in 377 ms).
  Restored /home/oof/runtime/src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.csproj (in 377 ms).
  Restored /home/oof/runtime/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj (in 379 ms).
  Restored /home/oof/runtime/src/tools/illink/src/linker/ref/Mono.Linker.csproj (in 377 ms).
  Restored /home/oof/runtime/src/libraries/System.Collections/ref/System.Collections.csproj (in 377 ms).
  Restored /home/oof/runtime/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj (in 379 ms).
  Restored /home/oof/runtime/src/libraries/System.Runtime/ref/System.Runtime.csproj (in 3 ms).
  Restored /home/oof/runtime/src/tools/illink/src/ILLink.CodeFix/ILLink.CodeFixProvider.csproj (in 8 ms).
  Restored /home/oof/runtime/src/tools/illink/src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj (in 10 ms).
  Restored /home/oof/runtime/src/libraries/System.Formats.Nrbf/ref/System.Formats.Nrbf.csproj (in 24 ms).
  Restored /home/oof/runtime/src/libraries/Fuzzing/DotnetFuzzing/DotnetFuzzing.csproj (in 25 ms).
  Restored /home/oof/runtime/src/libraries/System.Runtime.InteropServices/gen/DownlevelLibraryImportGenerator/DownlevelLibraryImportGenerator.csproj (in 8 ms).
/home/oof/runtime/.dotnet/sdk/10.0.100-preview.3.25125.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(515,5): error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'. [/home/oof/runtime/src/libraries/Fuzzing/DotnetFuzzing/DotnetFuzzing.csproj]

Build FAILED.

/home/oof/runtime/.dotnet/sdk/10.0.100-preview.3.25125.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(515,5): error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'. [/home/oof/runtime/src/libraries/Fuzzing/DotnetFuzzing/DotnetFuzzing.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.22

The runtime isn't finding the sdk for some reason.

Reproduction Steps

Repro explained in previous step

Expected behavior

Should compile fuzzers succesfully

Actual behavior

Doesn't compile succesfully. Exits with error.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 8, 2025
  2. MihaZupan commented on Mar 8, 2025

    @MihaZupan
    Member

    The setup is currently specific to Windows.

    See note in https://github.com/dotnet/runtime/tree/main/src/libraries/Fuzzing readme

    Note

    The instructions assume you are running on Windows as that is what the continuous fuzzing runs currently use.

  3. added and removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 8, 2025
  4. dotnet-policy-service commented on Mar 8, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/runtime-infrastructure
    See info in area-owners.md if you want to be subscribed.

  5. danmoseley commented on Mar 8, 2025

    @danmoseley
    Contributor

    Is it something fixable @MihaZupan

  6. MihaZupan commented on Mar 8, 2025

    @MihaZupan
    Member

    Sure, it should be possible, it's "just work".
    Having the option to run with AFL or similar could also be interesting (we're using libFuzzer currently).

    Other than dev inner loop for Linux, I don't think there's a pressing need for it given that the things we're currently testing shouldn't differ much by OS.

  7. personnumber3377 commented on Mar 9, 2025

    @personnumber3377
    Author

    I mean the readme just says that it assumes that you are running windows, not that the fuzzer is windows only. I think it is poorly worded. I am new to dotnet development and I don't really know how to make it work with linux. And I agree that this isn't really needed, but this would be convenient because you don't need to work with visual studio etc. on linux platforms.

  8. dotnet-policy-service commented on Jul 21, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
    See info in area-owners.md if you want to be subscribed.

  9. added this to the Future milestone on Jul 21, 2025
  10. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 21, 2025
  11. am11 commented on Jan 28, 2026

    @am11
    Member

    After building dotnet with ./build.sh -subset clr+libs -configuration Release -runtimeConfiguration Debug and then trying to run dotnet build with the compiled binary in the fuzzers directory, I am hit with the following error:

    ~/runtime/src/libraries/Fuzzing/DotnetFuzzing$ dotnet build
    

    One issue is that it is missing -c Release from DotnetFuzzing's dotnet build command. The host package, in this case, was built for Release based on the first command (it publishes as self-contained app which is why host package matters). I was having this exact issue on win-x64 yesterday and found this oopsie.

  12. MihaZupan commented on Jan 28, 2026

    @MihaZupan
    Member

    Might also be an issue with the fact we're currently hardcoding the path for the Debug apphost.
    Ideally we should check to see which one actually exists here and allow using a Release one.

    <AppHostSourcePath>$(ArtifactsDir)\bin\win-x64.Debug\corehost\apphost.exe</AppHostSourcePath>

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions