Skip to content

Conversation

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Dec 10, 2025

This runs "go mod verify" against gomodfs in NFS mode on all three
OSes (linux, darwin, windows) and additionally runs Windows in WinFsp
mode.

In the process, this also implements the magic ".gomodfs-status" file
work in PowerShell with WinFsp. (Powershell sets FILE_OPEN_NO_RECALL
which go-winfsp was rejecting. So this adds a wrapper that unsets
that bit.)

And this fixes a gitstore bug that made "go mod verify" fail on a repo
with exotic filenames. (#15)

Updates tailscale/corp#34812
Fixes #15

@bradfitz bradfitz requested review from irbekrm and tomhjp December 10, 2025 19:54
@bradfitz bradfitz force-pushed the bradfitz/fsp_ci branch 16 times, most recently from 25c5efa to 3f9a4cc Compare December 11, 2025 00:02
@bradfitz bradfitz changed the title testing: add winfsp to our nascent CI integration tests testing: flesh out winfsp, add to CI, expand CI, fix gitstore bug Dec 11, 2025
@bradfitz bradfitz force-pushed the bradfitz/fsp_ci branch 10 times, most recently from b8a149e to 7ac7182 Compare December 11, 2025 01:49
@bradfitz bradfitz force-pushed the bradfitz/fsp_ci branch 2 times, most recently from 3ff04e1 to f4a1e44 Compare December 11, 2025 02:10
bradfitz referenced this pull request in bramvdbogaerde/go-scp Dec 11, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really relevant to this PR, but as a general comment it might be nice to create a wrapper function for CombinedOutput that includes the output in the error if it's non-nil. I had an old version of git causing local tests to fail, and to get any details I had to go find the right call site and update the error by hand (it's just e.g. "exit status 129").

Not a big deal on its own, but I can imagine it will be hard to debug prod issues for the same reason if we ever encounter unexpected issues with git.

Comment on lines +78 to +79
// from OpenFile calls. Otherwise PowerShell sets it and then
// winfsp/gofs rejects the open, which is arguably a bug.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit I am not 100% following this sequence of events. Is PowerShell involved because we're running a build from PowerShell, and the issue is you can't have 2 different processes open the same file with this bit set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, even interactive use from PowerShell and doing "type .gomod-status" was failing because PowerShell sets that bit.

I'm working around a ~bug in our fsp Go bindings which are arguably too defensive/paranoid.

But not working in PowerShell is then also annoying for GitHub Actions for steps that want to use a shell.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Makes sense

// the "base" filesystem returned by [gofs.New].
type goFSImpl interface {
winfsp.BehaviourBase
winfsp.BehaviourGetSecurityByName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately obvious why we include all these interfaces as well as the base one that is accepted by the gofs function signature. AFAIU gofs.New optionally switches behaviour on if the type implements these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofs.New should really be returning an exported concrete type so it can be embedded without losing optional methods.

But gofs returns only winfsp.BehaviourBase even though it implements a dozen more methods. If we used its static type as our embedded type, we'd then lose the "forwarding" of those dozen methods and the fsp.Mount wouldn't call those methods and we'd fail to work (as I discovered).

So I had to forward all of these methods too.

I want to send a PR to upstream to change that signature.

This runs "go mod verify" against gomodfs in NFS mode on all three
OSes (linux, darwin, windows) and additionally runs Windows in WinFsp
mode.

In the process, this also implements the magic ".gomodfs-status" file
work in PowerShell with WinFsp. (Powershell sets FILE_OPEN_NO_RECALL
which go-winfsp was rejecting.  So this adds a wrapper that unsets
that bit.)

And this fixes a gitstore bug that made "go mod verify" fail on a repo
with exotic filenames. (#15)

Updates tailscale/corp#34812
Fixes #15

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz bradfitz merged commit fb052f6 into main Dec 13, 2025
7 checks passed
@tomhjp tomhjp deleted the bradfitz/fsp_ci branch December 15, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"go mod verify" failure on Windows with NFS

2 participants