Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the builder happier with Windows environments #1356

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

turt2live
Copy link
Member

There's two main issues with Windows environments:

  • Slashes
  • Windows still notifies about some directories we've ignored, therefore we need to filter them too

It's not super pretty, but it does work.

There's two main issues with Windows environments:
* Slashes
* Windows still notifies about some directories we've ignored, therefore we need to filter them too

It's not super pretty, but it does work.
@turt2live turt2live merged commit 26a62bc into matrix-org:master Jul 3, 2018
@turt2live turt2live deleted the travis/windows-2.0 branch July 3, 2018 16:59
Copy link
Member

@uhoreg uhoreg left a comment

Choose a reason for hiding this comment

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

I guess I'm a bit late to the review party, but...

@@ -99,6 +99,7 @@ func makeWalker(base string, w *fsnotify.Watcher) filepath.WalkFunc {
}

// skip a few things that we know don't form part of the spec
rel = strings.Replace(rel, "\\", "/", -1) // normalize slashes (thanks to windows)
Copy link
Member

Choose a reason for hiding this comment

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

should this be rel = filepath.ToSlash instead? (https://golang.org/pkg/path/filepath/#ToSlash )

@@ -125,6 +126,14 @@ func filter(e fsnotify.Event) bool {
return false
}

// Forcefully ignore directories we don't care about (Windows, at least, tries to notify about some directories)
filePath := strings.Replace(e.Name, "\\", "/", -1) // normalize slashes (thanks to windows)
Copy link
Member

Choose a reason for hiding this comment

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

same as above

@@ -149,6 +158,10 @@ func serve(w http.ResponseWriter, req *http.Request) {
}
b, ok = m.bytes[file]

if !ok {
b, ok = m.bytes[strings.Replace(file, "/", "\\", -1)] // Attempt a Windows lookup
Copy link
Member

Choose a reason for hiding this comment

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

should this be ...filepath.FromSlash(file)... instead (probably in the original b, ok = m.bytes... line)?

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.

None yet

3 participants