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

parse issue go.dev/govulncheck #882

Closed
dcvz opened this issue Dec 5, 2023 · 4 comments
Closed

parse issue go.dev/govulncheck #882

dcvz opened this issue Dec 5, 2023 · 4 comments

Comments

@dcvz
Copy link

dcvz commented Dec 5, 2023

Suddenly started getting this today:

error: Uncaught (in promise) Error: package.yml parse error: /Users/dcvz/Library/Application Support/pkgx/pantry/projects/go.dev/govulncheck/package.yml
            throw new PantryParseError(project, filename, cause);
                  ^
    at https://deno.land/x/[email protected]/src/hooks/usePantry.ts:62:19
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async find (https://deno.land/x/[email protected]/src/hooks/usePantry.ts:160:20)
    at async failsafe (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/failsafe.ts:5:12)
    at async default (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/parse-pkg-str.ts:12:20)
Caused by: YAMLError: end of the stream or a document separator is expected in "/Users/dcvz/Library/Application Support/pkgx/pantry/projects/go.dev/govulncheck/package.yml" at line 63, column 34:
        - (govulncheck ./... 2>&1 || 
                                     ^
    at generateError (https://deno.land/[email protected]/yaml/_loader/loader.ts:88:10)
    at throwError (https://deno.land/[email protected]/yaml/_loader/loader.ts:91:9)
    at readDocument (https://deno.land/[email protected]/yaml/_loader/loader.ts:1079:12)
    at loadDocuments (https://deno.land/[email protected]/yaml/_loader/loader.ts:1103:5)
    at load (https://deno.land/[email protected]/yaml/_loader/loader.ts:1122:21)
    at parse (https://deno.land/[email protected]/yaml/parse.ts:13:10)
    at Path.readYAML (https://deno.land/x/[email protected]/src/utils/Path.ts:331:14)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async find (https://deno.land/x/[email protected]/src/hooks/usePantry.ts:160:20)
    at async failsafe (file:///Users/builder/actions-runner/_work/pkgx/pkgx/src/prefab/failsafe.ts:5:12)
Caused by: "/Users/dcvz/Library/Application Support/pkgx/pantry/projects/go.dev/govulncheck/package.yml"
@jhheider
Copy link
Contributor

jhheider commented Dec 5, 2023

Can you post the contents of /Users/dcvz/Library/Application Support/pkgx/pantry/projects/go.dev/govulncheck/package.yml? It should match https://github.com/pkgxdev/pantry/blob/main/projects/go.dev/govulncheck/package.yml. Specifically, it looks like it's complaining about the last line

Assuming there's a difference, pkgx --sync should fix it. However, if it's not different, then we need to figure out why it's complaining.

@dcvz
Copy link
Author

dcvz commented Dec 5, 2023

Here are the contents:

Contents
distributable:
  url: https://github.com/golang/vuln/archive/refs/tags/v{{version}}.tar.gz
  strip-components: 1

versions:
  github: golang/vuln/tags

provides:
  - bin/govulncheck

build:
  dependencies:
    go.dev: ^1.19
  script: |
    go mod download
    mkdir -p "{{ prefix }}"/bin
    go build -v -trimpath -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd/govulncheck
  env:
    GOPROXY: https://proxy.golang.org,direct
    GOSUMDB: sum.golang.org
    GO111MODULE: on
    CGO_ENABLED: 0
    BUILDLOC: '{{prefix}}/bin/govulncheck'
    LDFLAGS:
      - -s
      - -w
    linux:
      # or segmentation fault
      # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
      LDFLAGS:
      - -buildmode=pie

test:
  fixture: |
    package main

    import (
            "fmt"
            "os"

            "golang.org/x/text/language"
    )

    func main() {
            for _, arg := range os.Args[1:] {
                    tag, err := language.Parse(arg)
                    if err != nil {
                            fmt.Printf("%s: error: %v\n", arg, err)
                    } else if tag == language.Und {
                            fmt.Printf("%s: undefined\n", arg)
                    } else {
                            fmt.Printf("%s: tag %s\n", arg, tag)
                    }
            }
    }
  dependencies:
    go.dev: ^1.19
  script:
    - go mod init vuln.tutorial
    - cp $FIXTURE main.go
    - go mod tidy
    - go get golang.org/x/[email protected]
    - (govulncheck ./... 2>&1 || ��������������������������

It turns out that pkgx --sync also errors..

Dec 5 Screenshot from Discord

@jhheider
Copy link
Contributor

jhheider commented Dec 5, 2023

@mxcl here's an example of a corrupted package.yml in the wild. File is 1562B, so i'm not sure the point of corruption is significant.

gnup.org/pinentry is a directory in the current pantry. so there's definite corruption of your pantry, @dcvz . for a quick fix, you can probably mv /Users/dcvz/Library/Application Support/pkgx/pantry{,.bak} && pkgx --sync (moving it to a .bak location in case we can do further troubleshooting.

mxcl added a commit that referenced this issue Jan 5, 2024
Will fix some errors due to invalid pantry parsing

Refs #882
Refs #865
mxcl added a commit that referenced this issue Jan 5, 2024
Will fix some errors due to invalid pantry parsing

Refs #882
Refs #865
mxcl added a commit that referenced this issue Jan 5, 2024
* Will fix some errors due to invalid pantry parsing
* Removes platform specific moustaches devenvs, these weren't documented so even though this is strictly a breaking change I would be willing to risk the tea protocol slash consequences for it in a tea protocol future

Refs #882
Refs #865
mxcl added a commit that referenced this issue Jan 5, 2024
* Will fix some errors due to invalid pantry parsing
* Removes platform specific moustaches devenvs
  * these weren't documented so even though this is strictly a breaking change I would be willing to risk the tea protocol slash consequences for it in a tea protocol future
  * there is potential utility in platform/arch being there so we should propose a proper addition
* Fix CD

Refs #882
Refs #865
mxcl added a commit that referenced this issue Jan 5, 2024
* Will fix some errors due to invalid pantry parsing
* Removes platform specific moustaches devenvs
  * these weren't documented so even though this is strictly a breaking change I would be willing to risk the tea protocol slash consequences for it in a tea protocol future
  * there is potential utility in platform/arch being there so we should propose a proper addition
* Fix CD

Refs #882
Refs #865
@mxcl
Copy link
Member

mxcl commented Jan 30, 2024

Closing in favor of #865

This issue is much reduced in impact since 1.1.1, but still happens and needs to be understood and fixed.

@mxcl mxcl closed this as completed Jan 30, 2024
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

No branches or pull requests

3 participants