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

AddDirRecursive is broken on with go1.20 #241

Closed
dprotaso opened this issue Mar 6, 2023 · 14 comments
Closed

AddDirRecursive is broken on with go1.20 #241

dprotaso opened this issue Mar 6, 2023 · 14 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@dprotaso
Copy link

dprotaso commented Mar 6, 2023

https://pkg.go.dev/k8s.io/gengo/parser#Builder.AddDirRecursive doesn't work if a path doesn't contain any go code. Prior go1.19 returned NoGoError which was handled here. Now it returns a different error breaking the parser.

See upstream issue: golang/go#58903

Workaround is to create an empty go file - ie. doc.go at every intermediate level. Maybe gengo parser can just handle the new error type.

@aojea
Copy link
Member

aojea commented Mar 7, 2023

/cc @thockin

@dprotaso
Copy link
Author

dprotaso commented Mar 7, 2023

I didn't really understand the response from the go team - it seems counter intuitive so I'm poking upstream.

@dprotaso
Copy link
Author

dprotaso commented Mar 7, 2023

Ok - it seems like the better option would be to use context.ImportDir vs Import

https://pkg.go.dev/go/build#Context.ImportDir - it will return https://pkg.go.dev/go/build#NoGoError if there is no go present

see the upstream issue for the description

@thockin
Copy link
Member

thockin commented Mar 7, 2023 via email

@thockin
Copy link
Member

thockin commented Mar 9, 2023

Cool - this explains a weird behavior I saw just this weekend :)

My branch (hopefully to become gengo/v2) totally overhauls this path (to use packages.Load), so it's all moot eventually

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 7, 2023
@thockin
Copy link
Member

thockin commented Jun 7, 2023

I'm still working on it, but very slowly. Is there a specific use-case that is broken right now?

@thockin thockin removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 7, 2023
@dprotaso
Copy link
Author

dprotaso commented Jun 7, 2023

This broke some crd to docs tools but there's a work around - add an empty go file to the dirs with no code

@thockin
Copy link
Member

thockin commented Jun 7, 2023 via email

@dprotaso
Copy link
Author

dprotaso commented Jun 7, 2023

If there's an easy fix, I am open to it.

Switch to ImportDir

#241 (comment)

@thockin
Copy link
Member

thockin commented Jun 7, 2023

If it is a drop-in replacement, I'd be OK with that.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 22, 2024
@thockin
Copy link
Member

thockin commented Jan 28, 2024

Will be fixed in v2 (#259)

@thockin thockin closed this as completed Jan 28, 2024
@dprotaso
Copy link
Author

dprotaso commented Jan 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants