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

Pass tags to go build? #109

Closed
dko1905 opened this issue Feb 22, 2023 · 5 comments · Fixed by #166
Closed

Pass tags to go build? #109

dko1905 opened this issue Feb 22, 2023 · 5 comments · Fixed by #166

Comments

@dko1905
Copy link

dko1905 commented Feb 22, 2023

I've searched the previous issues for "build tags" and couldn't find anything.
I have a project with go-sqlite3, and I require the 'sqlite_math_functions' tag.
I usually add --tags sqlite_math_functions to go build, how do I do so
using buildGoApplication in my nix flake?

@peterldowns
Copy link

Have you tried the tags attribute? [The documentation does not mention this attribute, but you can see how they're passed if you look at builder.nix.

@peterldowns
Copy link

peterldowns commented Feb 24, 2023

Confirmed, tags works as expected. Every string you include in the tags array will be passed to the go build command:

default = pkgs.buildGoApplication {
  checkPhase = false;
  pname = "demo";
  version = "0.0.1";
  src = ./.;
  modules = ./gomod2nix.toml;
  tags = [
    "sqlite_math_functions"
  ];
};

@dko1905
Copy link
Author

dko1905 commented Feb 26, 2023

Hi, thanks. Any reason it isn't in the documentation?

@peterldowns
Copy link

Unfortunately I don't know, I'm not a maintainer. My guess is it's an honest oversight and that you could probably submit a PR to fix it if you'd like.

@jtcarnes
Copy link
Contributor

jtcarnes commented Aug 4, 2024

I know this is a year old issue, but I had the problem. Small PR to add the documentation you mentioned @peterldowns to help the next guy.

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 a pull request may close this issue.

3 participants