GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mount: some refactor and improved GoDoc about Windows support by thaJeztah · Pull Request #31 · moby/sys

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Sep 18, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Commit 0c569e0 (#26) added a fast-path for Linux, but inadvertendly changed the behavior on Windows, which previously handled RecursiveUnmount() as a no-op, and now panicked.

This patch makes RecursiveUnmount() a no-op again on Windows.

[Kir: fixed commit/PR reference]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thaJeztah thaJeztah mentioned this pull request Sep 18, 2020
vendor: moby/sys mountinfo/v0.4.0 moby/moby#41458
Merged
@thaJeztah

thaJeztah commented Sep 18, 2020

Copy link
Copy Markdown
Member Author

Relates to moby/moby#41458 (comment)

ping @kolyshkin @cpuguy83 PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kolyshkin

kolyshkin commented Sep 18, 2020

Copy link
Copy Markdown
Collaborator

Thanks! Is it possible to add some CI job to prevent this kinds of mishap in the future?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kolyshkin

kolyshkin commented Sep 18, 2020

Copy link
Copy Markdown
Collaborator

It looks like Unmount() and RecursiveUnmount() should behave in a similar way. Currently, they both panic on Windows, and it makes sense to me, as they should not be called on Windows. This commit makes them behave differently.

Perhaps we can make both no-op? This will

  • make this patch much smaller;
  • make the behavior consistent between the two.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah
thaJeztah force-pushed the dont_panic branch from 6a27b5f to 8b5e03d Compare September 19, 2020 11:45
@thaJeztah

thaJeztah commented Sep 19, 2020

Copy link
Copy Markdown
Member Author

@kolyshkin updated, but I noticed that before 0c569e0, Unmount() already produced a panic on Windows, so I'm a bit on the fence on updating.

Actually thinking now if we should accept the breaking change and update downstream code or not 🤔 (the package is still pre v1.0, so from that perspective, it should be ok)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kolyshkin

kolyshkin commented Sep 21, 2020

Copy link
Copy Markdown
Collaborator

If you can just change unmountBare (and unmount) for Windows to return nil that will have the same effect with much smaller set of changes needed.

Yet we need to decide first whether we want them both to be no-op or panic. I don't have a strong preference but would like to hear other opinions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kolyshkin

kolyshkin commented Sep 21, 2020

Copy link
Copy Markdown
Collaborator

moby/moby#41458 (comment) it seems that the panic behavior is better than no-op. In these two cases, it clearly tells the test is not working (and it should not work on Windows).

So, I'm in favor of panic.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah
thaJeztah force-pushed the dont_panic branch from 8b5e03d to b4a0e04 Compare September 21, 2020 16:01
@thaJeztah thaJeztah changed the title Make RecursiveUnmount() a no-op on Windows Some refactor and improved GoDoc about Windows support Sep 21, 2020
thaJeztah
thaJeztah commented Sep 21, 2020
View reviewed changes
Comment thread mount/mount.go Outdated
Comment on lines 27 to 43
// RecursiveUnmount is not implemented on Windows.
func RecursiveUnmount(target string) error {

@thaJeztah thaJeztah Sep 21, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

So, alternatively, I guess we could not implement at all on Windows (move this to a _linux.go or _unix.go wdyt?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kolyshkin kolyshkin Sep 28, 2020

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, I think the rename + build flags will be slightly cleaner.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kolyshkin

kolyshkin commented Sep 23, 2020

Copy link
Copy Markdown
Collaborator

What I'd like to see here is a minimal patch. Moving lots of code around makes it harder to dig through git history, and unless there is a good reason to, I'd rather not do it.

Maybe I'm wrong and this is unavoidable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah

thaJeztah commented Sep 23, 2020

Copy link
Copy Markdown
Member Author

The situation currently is that we have separate files for platform-specific implementations, but there's code in files that doesn't work on the platform it's enabled on.

So, yes, I agree that a smaller diff would be good, but it looks like code is in the wrong files.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah
thaJeztah force-pushed the dont_panic branch from b4a0e04 to 7e37eaf Compare September 24, 2020 20:27
AkihiroSuda
AkihiroSuda approved these changes Oct 1, 2020
View reviewed changes
@thaJeztah

thaJeztah commented Oct 1, 2020

Copy link
Copy Markdown
Member Author

I see @kolyshkin preferred "Yeah, I think the rename + build flags will be slightly cleaner."; let me have a look what that looks like.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah
Some refactor and improved GoDoc about Windows support
32b8cf3
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
thaJeztah force-pushed the dont_panic branch 2 times, most recently from 585c7f1 to 832bd36 Compare October 1, 2020 16:07
@thaJeztah
mount: remove Windows stubs
7a52162
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
thaJeztah force-pushed the dont_panic branch from 832bd36 to 7a52162 Compare October 1, 2020 16:34
@thaJeztah

thaJeztah commented Oct 1, 2020

Copy link
Copy Markdown
Member Author

@kolyshkin pushed a commit with those changes; if you think this looks good, I'll squash

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kolyshkin
kolyshkin approved these changes Oct 1, 2020
View reviewed changes

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kolyshkin
kolyshkin merged commit 832ae17 into moby:master Oct 1, 2020
@thaJeztah
thaJeztah deleted the dont_panic branch October 1, 2020 19:51
@thaJeztah thaJeztah changed the title Some refactor and improved GoDoc about Windows support mount: some refactor and improved GoDoc about Windows support Nov 10, 2020
@thaJeztah thaJeztah mentioned this pull request Nov 10, 2020
RFC: tag mount/v0.2.0 #57
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kolyshkin kolyshkin kolyshkin approved these changes
@AkihiroSuda AkihiroSuda AkihiroSuda approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@thaJeztah @kolyshkin @AkihiroSuda
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.