diff options
Diffstat (limited to 'doc/languages-frameworks/go.xml')
-rw-r--r-- | doc/languages-frameworks/go.xml | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/doc/languages-frameworks/go.xml b/doc/languages-frameworks/go.xml index 84b146532b1..26414f23c7d 100644 --- a/doc/languages-frameworks/go.xml +++ b/doc/languages-frameworks/go.xml @@ -36,10 +36,14 @@ pet = buildGoModule rec { sha256 = "0m2fzpqxk7hrbxsgqplkg7h2p7gv6s1miymv3gvw0cz039skag0s"; }; - modSha256 = "1879j77k96684wi554rkjxydrj8g3hpp0kvxz03sd8dmwr3lh83j"; <co xml:id='ex-buildGoModule-1' /> + vendorSha256 = "1879j77k96684wi554rkjxydrj8g3hpp0kvxz03sd8dmwr3lh83j"; <co xml:id='ex-buildGoModule-1' /> subPackages = [ "." ]; <co xml:id='ex-buildGoModule-2' /> + deleteVendor = true; <co xml:id='ex-buildGoModule-3' /> + + runVend = true; <co xml:id='ex-buildGoModule-4' /> + meta = with lib; { description = "Simple command-line snippet manager, written in Go"; homepage = "https://github.com/knqyf263/pet"; @@ -56,7 +60,7 @@ pet = buildGoModule rec { <calloutlist> <callout arearefs='ex-buildGoModule-1'> <para> - <varname>modSha256</varname> is the hash of the output of the intermediate fetcher derivation. + <varname>vendorSha256</varname> is the hash of the output of the intermediate fetcher derivation. </para> </callout> <callout arearefs='ex-buildGoModule-2'> @@ -64,16 +68,26 @@ pet = buildGoModule rec { <varname>subPackages</varname> limits the builder from building child packages that have not been listed. If <varname>subPackages</varname> is not specified, all child packages will be built. </para> </callout> + <callout arearefs='ex-buildGoModule-3'> + <para> + <varname>deleteVendor</varname> removes the pre-existing vendor directory and fetches the dependencies. This should only be used if the dependencies included in the vendor folder are broken or incomplete. + </para> + </callout> + <callout arearefs='ex-buildGoModule-4'> + <para> + <varname>runVend</varname> runs the vend command to generate the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build. + </para> + </callout> </calloutlist> </para> <para> - <varname>modSha256</varname> can also take <varname>null</varname> as an input. + <varname>vendorSha256</varname> can also take <varname>null</varname> as an input. - When `null` is used as a value, the derivation won't be a - fixed-output derivation but disable the build sandbox instead. This can be useful outside - of nixpkgs where re-generating the modSha256 on each mod.sum changes is cumbersome, - but will fail to build by Hydra, as builds with a disabled sandbox are discouraged. + When `null` is used as a value, rather than fetching the dependencies + and vendoring them, we use the vendoring included within the source repo. + If you'd like to not have to update this field on dependency changes, + run `go mod vendor` in your source repo and set 'vendorSha256 = null;' </para> </section> @@ -192,18 +206,6 @@ deis = buildGoPackage rec { </para> <para> - <varname>buildGoPackage</varname> produces <xref linkend='chap-multiple-output' xrefstyle="select: title" /> where <varname>bin</varname> includes program binaries. You can test build a Go binary as follows: -<screen> -<prompt>$ </prompt>nix-build -A deis.bin -</screen> - or build all outputs with: -<screen> -<prompt>$ </prompt>nix-build -A deis.all -</screen> - <varname>bin</varname> output will be installed by default with <varname>nix-env -i</varname> or <varname>systemPackages</varname>. - </para> - - <para> You may use Go packages installed into the active Nix profiles by adding the following to your ~/.bashrc: <screen> for p in $NIX_PROFILES; do |