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

tfplugindocs does not handle tags #101

Open
abergmeier opened this issue Dec 18, 2021 · 3 comments
Open

tfplugindocs does not handle tags #101

abergmeier opened this issue Dec 18, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@abergmeier
Copy link

I have a Terraform Provider which needs special tags to build.
These tags I can pass to:

go run -tags containers_image_openpgp github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs

The problem is though, that tfplugindocs does not pass along the tags.
As a result tflugindocs fails building Go files.

Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:17:16: undefined: gpgme.Context
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:67:44: undefined: gpgme.Context
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:68:14: undefined: gpgme.New
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:72:27: undefined: gpgme.ProtocolOpenPGP
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:76:28: undefined: gpgme.ProtocolOpenPGP
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:98:20: undefined: gpgme.NewDataBytes
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:127:20: undefined: gpgme.NewDataBytes
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:132:18: undefined: gpgme.NewDataWriter
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:136:25: undefined: gpgme.Key
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:136:61: undefined: gpgme.SigModeNormal
Error: /home/runner/go/pkg/mod/github.com/containers/image/v5@v5.16.2-0.20211021181114-25411654075f/signature/mechanism_gpgme.go:136:61: too many errors

Thus I would need a way for tfplugindocs to handle tags when generating code.

@bflad bflad added the enhancement New feature or request label Dec 23, 2021
@bflad
Copy link
Member

bflad commented Dec 23, 2021

Given the current code structure and that it does not appear that Go exposes build tags during runtime, it seems this would require a new CLI flag that gets threaded through to the build call.

@abergmeier
Copy link
Author

abergmeier commented Dec 23, 2021

seems this would require a new CLI flag that gets threaded through to the build call.

And IMO this would be preferable since once you have to use build tags I would expect that you KnowWhatYouAreDoing™.
The corner case might be though, where a valid compilation gets produced with or without certain build tags.

Anyway - I started a naive implementation here: #103. Comments very welcome.

@Soneca-ii
Copy link

this would be much appreciated. Is there any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants