golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.45k stars 17.59k forks source link

syscall: recent file related breakage on Darwin for the Hugo build #31515

Closed bep closed 2 years ago

bep commented 5 years ago

The Travis build for Go tip on Darwin has started to fail recently with what looks like file operations in the os package. I have not looked too closely into it.

https://travis-ci.org/gohugoio/hugo/jobs/520378962

The build passes on all platforms on the latest Go 1.11/12 and on tip for Linux. But breaks on tip for Darwin.

agnivade commented 5 years ago

A short reproducible code sample will be very helpful.

bradfitz commented 5 years ago

@randall77, sorry, more.

Snippet from URL above:

exec: go test ./...
?       github.com/gohugoio/hugo    [no test files]
ok      github.com/gohugoio/hugo/bufferpool 0.176s
ok      github.com/gohugoio/hugo/cache  0.019s
ok      github.com/gohugoio/hugo/cache/filecache    1.466s
ok      github.com/gohugoio/hugo/cache/namedmemcache    0.021s
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x2d00dc]
goroutine 5 [running]:
testing.tRunner.func1(0x11cd60a0)
    /Users/travis/.gimme/versions/go/src/testing/testing.go:830 +0x33e
panic(0x32c280, 0x6510a8)
    /Users/travis/.gimme/versions/go/src/runtime/panic.go:619 +0x15f
github.com/gohugoio/hugo/codegen.(*Inspector).parseSource.func1.1(0x11d00000, 0x28, 0x0, 0x0, 0x3ee690, 0x11cc0ce0, 0x0, 0x0)
    /Users/travis/src/hugo/codegen/methods.go:190 +0x2c
path/filepath.walk(0x11c1c0f4, 0x1e, 0x3f3c20, 0x11cd6140, 0x11c0c060, 0x0, 0x10)
    /Users/travis/.gimme/versions/go/src/path/filepath/path.go:378 +0x16f
path/filepath.Walk(0x11c1c0f4, 0x1e, 0x11c0c060, 0x4, 0x12)
    /Users/travis/.gimme/versions/go/src/path/filepath/path.go:404 +0xd7
github.com/gohugoio/hugo/codegen.(*Inspector).parseSource.func1()
    /Users/travis/src/hugo/codegen/methods.go:189 +0x115
sync.(*Once).doSlow(0x11c16068, 0x11c344d8)
    /Users/travis/.gimme/versions/go/src/sync/once.go:52 +0x8c
sync.(*Once).Do(0x11c16068, 0x11c344d8)
    /Users/travis/.gimme/versions/go/src/sync/once.go:43 +0x3d
github.com/gohugoio/hugo/codegen.(*Inspector).parseSource(0x11c16060)
    /Users/travis/src/hugo/codegen/methods.go:178 +0x46
github.com/gohugoio/hugo/codegen.(*Inspector).MethodsFromTypes(0x11c16060, 0x11d07fa0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x91, 0x0, 0x0)
    /Users/travis/src/hugo/codegen/methods.go:57 +0x2c
github.com/gohugoio/hugo/codegen.TestMethods.func1(0x11cd60a0)
    /Users/travis/src/hugo/codegen/methods_test.go:41 +0x8f
testing.tRunner(0x11cd60a0, 0x11c0c020)
    /Users/travis/.gimme/versions/go/src/testing/testing.go:865 +0x90
created by testing.(*T).Run
    /Users/travis/.gimme/versions/go/src/testing/testing.go:916 +0x2a6
FAIL    github.com/gohugoio/hugo/codegen    0.013s
Building sites … Total in 0 ms
Error: Error building site: lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli533509124/content/1.md: no such file or directory
--- FAIL: TestExecute (0.02s)
    require.go:794: 
            Error Trace:    commands_test.go:43
            Error:          Received unexpected error:
                            lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli533509124/content/1.md: no such file or directory
                            Error building site
                            github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3
                                /Users/travis/src/hugo/commands/hugo.go:314
                            golang.org/x/sync/errgroup.(*Group).Go.func1
                                /Users/travis/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20180314180146-1d60e4601c6f/errgroup/errgroup.go:58
                            runtime.goexit
                                /Users/travis/.gimme/versions/go/src/runtime/asm_386.s:1324
            Test:           TestExecute
Hugo Static Site Generator v0.56.0-DEV darwin/386 BuildDate: unknown
GOOS="darwin"
GOARCH="386"
GOVERSION="devel +d91f7e6637 Mon Apr 15 14:53:19 2019 +0000"
Hugo Static Site Generator v0.56.0-DEV darwin/386 BuildDate: unknown
Error: Error building site: lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli800008083/content/1.md: no such file or directory
--- FAIL: TestCommandsExecute (0.01s)
    require.go:794: 
            Error Trace:    commands_test.go:206
            Error:          Received unexpected error:
                            lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli800008083/content/1.md: no such file or directory
                            Error building site
                            github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3
                                /Users/travis/src/hugo/commands/hugo.go:314
                            golang.org/x/sync/errgroup.(*Group).Go.func1
                                /Users/travis/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20180314180146-1d60e4601c6f/errgroup/errgroup.go:58
                            runtime.goexit
                                /Users/travis/.gimme/versions/go/src/runtime/asm_386.s:1324
            Test:           TestCommandsExecute
            Messages:       []
Building sites … Total in 0 ms
Error: Error building site: lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli139008317/contentOverride/1.md: no such file or directory
--- FAIL: TestHugoWithContentDirOverride (0.01s)
    require.go:794: 
            Error Trace:    hugo_test.go:50
            Error:          Received unexpected error:
                            lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli139008317/contentOverride/1.md: no such file or directory
                            Error building site
                            github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3
                                /Users/travis/src/hugo/commands/hugo.go:314
                            golang.org/x/sync/errgroup.(*Group).Go.func1
                                /Users/travis/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20180314180146-1d60e4601c6f/errgroup/errgroup.go:58
                            runtime.goexit
                                /Users/travis/.gimme/versions/go/src/runtime/asm_386.s:1324
            Test:           TestHugoWithContentDirOverride
Congratulations! Your new Hugo site is created in base/blog.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
Congratulations! Your new Hugo site is created in base/blog.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
Congratulations! Your new Hugo site is created in base/blog.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
Building sites … Total in 0 ms
Error: Error building site: lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli268155768/content/1.md: no such file or directory
Usage:
  server [flags]
Aliases:
  server, serve
Flags:
      --appendPort             append port to baseURL (default true)
  -b, --baseURL string         hostname (and path) to the root, e.g. http://spf13.com/
      --bind string            interface to which the server will bind (default "127.0.0.1")
  -D, --buildDrafts            include content marked as draft
  -E, --buildExpired           include expired content
  -F, --buildFuture            include content with publishdate in the future
      --cacheDir string        filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
      --cleanDestinationDir    remove files from destination not found in static directories
  -c, --contentDir string      filesystem path to content directory
  -d, --destination string     filesystem path to write files to
      --disableBrowserError    do not show build errors in the browser
      --disableFastRender      enables full re-renders on changes
      --disableKinds strings   disable different kind of pages (home, RSS etc.)
      --disableLiveReload      watch without enabling live browser reload on rebuild
      --enableGitInfo          add Git revision, date and author info to the pages
  -e, --environment string     build environment
      --forceSyncStatic        copy all files when static is changed.
      --gc                     enable to run some cleanup tasks (remove unused cache files) after the build
  -h, --help                   help for server
      --i18n-warnings          print missing translations
      --ignoreCache            ignores the cache directory
  -l, --layoutDir string       filesystem path to layout directory
      --liveReloadPort int     port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
      --meminterval string     interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
      --memstats string        log memory usage to this file
      --minify                 minify any supported output format (HTML, XML etc.)
      --navigateToChanged      navigate to changed content file on live browser reload
      --noChmod                don't sync permission mode of files
      --noHTTPCache            prevent HTTP caching
      --noTimes                don't sync modification time of files
      --path-warnings          print warnings on duplicate target paths etc.
  -p, --port int               port on which the server will listen (default 1313)
      --renderToDisk           render to Destination path (default is render to memory & serve from there)
  -s, --source string          filesystem path to read files relative from
      --templateMetrics        display metrics about template executions
      --templateMetricsHints   calculate some improvement hints when combined with --templateMetrics
  -t, --theme strings          themes to use (located in /themes/THEMENAME/)
      --themesDir string       filesystem path to themes directory
      --trace file             write trace to file (not useful in general)
  -w, --watch                  watch filesystem for changes and recreate as needed (default true)
--- FAIL: TestServer (2.01s)
    require.go:794: 
            Error Trace:    server_test.go:57
                                        asm_386.s:1324
            Error:          Received unexpected error:
                            lstat /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/hugo-cli268155768/content/1.md: no such file or directory
                            Error building site
                            github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3
                                /Users/travis/src/hugo/commands/hugo.go:314
                            golang.org/x/sync/errgroup.(*Group).Go.func1
                                /Users/travis/gopath/pkg/mod/golang.org/x/sync@v0.0.0-20180314180146-1d60e4601c6f/errgroup/errgroup.go:58
                            runtime.goexit
                                /Users/travis/.gimme/versions/go/src/runtime/asm_386.s:1324
            Test:           TestServer
    server_test.go:66: 
            Error Trace:    server_test.go:66
            Error:          Received unexpected error:
                            Get http://localhost:1331/: dial tcp [::1]:1331: connect: connection refused
            Test:           TestServer
FAIL
FAIL    github.com/gohugoio/hugo/commands   2.097s
prattmic commented 2 years ago

I'm assuming this was resolved? I can't imagine that hugo has been broken on Darwin for 3 years. :)