Skip to content

Unable to build .NET projects inside a WinFSP filesystem #475

@hach-que

Description

@hach-que

Bug Report

I've been working a WinFSP filesystem for about a week now, and I've been unable to get "dotnet build" to run successfully from within the filesystem (where both "dotnet.exe", it's related files and the project to build are all part of the filesystem).

In an effort to diagnose the root cause, I put together a test suite that tests the example WinFSP filesystems in this scenario. Unfortunately this demonstrates that "dotnet build" doesn't work reliably in any of them either, including NTPTFS. "dotnet build" obviously works in a normal folder (i.e. using the kernel's NTFS filesystem).

I've put the test suite together here: https://src.redpoint.games/redpointgames/msbuild-fstest/. Feel free to clone it, etc. to try and diagnose the root cause. I've been at it for a week and I'm still no closer to understanding what the bug is, other than it's likely to do with subtle threading issues (though adding locks in the filesystem implementation or using coarse guarding does not resolve it).

As an aside, Dokany also has this problem, as my initial implementation was on Dokany and I moved to WinFSP in an attempt to resolve the issue.

How to Reproduce

To run the test for any of the given filesystems, run .\test-fs.ps1 -FS <name>. The current test results are available at: https://msbuild-fstest.redpointgames.dev/

And a description of the tests:

  • ntfs: Just copies the tests to a folder and runs them on top of the computer's NTFS filesystem.
  • ntfs-unc: Just copies the tests to a folder, but runs everything from a UNC path (\\COMPUTERNAME\C$\Test\Path) to see if dotnet build works over the Windows file sharing protocol.
  • winfsp-memfs-netframework: The WinFSP .NET MemFS implementation exactly as provided by WinFSP.
  • winfsp-memfs-netframework-extra: The .NET MemFS test above, with the -F NTFS -i flags..
  • winfsp-memfs-cpp: The WinFSP C++ MemFS implementation exactly as provided by WinFSP.
  • winfsp-memfs-cpp-extra: The C++ MemFS test above, with the -F NTFS -i flags.
  • winfsp-passthrough-netframework: The WinFSP .NET Passthrough implementation exactly as provided by WinFSP.
  • winfsp-passthrough-netcore: The WinFSP .NET Passthrough implementation ported to .NET Core. This only changes calls to match what .NET Framework APIs got mapped to in .NET 6, so it should behave exactly the same, but from the test results, it does not.
  • winfsp-ntptfs: The WinFSP NTPTFS implementation exactly as provided by WinFSP.
  • winfsp-ntptfs-extra: The NTPTFS test above, with -o ExtraFeatures.
  • dokan-memfs-cpp: The Dokany C++ MemFS sample.
  • dokan-mirror-cpp: The Dokany C++ mirror sample.
  • dokan-mirror-dotnet: The Dokan .NET mirror sample.
  • projfs-mirror-dotnet: The ProjFS Managed API sample.

Behaviors

"dotnet build" should be reliably working on WinFSP filesystems, at the very least NTPTFS given it's supposed to be a production example.

Environment

  • OS version and build: 22000.1219
  • WinFsp version and build: 1.12.22339

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions