Commit Graph

10 Commits

Author SHA1 Message Date
ajs124
0d5c464ad6 buildGoModule: add vendorHash
the _unset hack is kind of ugly, but it needs to default to something
and it can't be null, because that already has special meaning
2022-08-02 07:28:13 +10:00
Manuel Mendez
8b5a7940b0 go: Bunch of fixes when using excludedPackages and other bits
Few things going on in this commit:

Do not print "Building subPakage $pkg" message if actually going to skip the
package. This was confusing to me when I was trying to figure out how to set
excludedPackages and seeing the "Building subpackage $pkg" messages for
packages I wanted to skip. Turns out this messages was being printed before
checking if we actually wanted to build the package and not necessarily that my
excludedPackages was wrong.

Make go-packages look a little bit more like go-modules, by adding testdata to
the default list of excluded packages.

This commit also does some setup outside the buildGoDir function so that we
avoid checking `excludedPackages` for every package and cut down the number
of grep calls by half since we always want at least one grep for the default
excludedPackages, might as well just add to the patterns being checked.

Finally, adds documentation for usage of excludedPackages and subPackages. I
had to read the implementation to figure out how to correctly use these
function arguments since there was no documentation and different uses in the
code base. So this commit documents usage of the arguments.
2022-03-04 13:32:44 +10:00
zowoq
8a8c88de70 buildGoModule: use proxyVendor instead of runVend 2022-01-06 14:00:58 +10:00
zowoq
e67813b0c6 doc/go: remove platform from example
this should only be set if the package doesn't work with the default platforms
2022-01-06 09:25:43 +10:00
zowoq
9f0aab9827 doc/go: remove runVend from example 2022-01-02 13:35:15 +10:00
zowoq
a4461b97c6 buildGoModule: add proxyVendor 2021-08-06 09:10:09 +10:00
zowoq
b60dde0c1e buildGo{Module,Package}: add tags argument
Simpler method of setting tags rather than using some combination of buildFlags, buildFlagsArray, preBuild, etc

Using `lib.concatStringsSep ","` as space separated tags are deprecated in go.
2021-08-06 09:09:58 +10:00
Jan Tojnar
6ecc641d08
doc: prepare for commonmark
We are still using Pandoc’s Markdown parser, which differs from CommonMark spec slightly.

Notably:
- Line breaks in lists behave differently.
- Admonitions do not support the simpler syntax https://github.com/jgm/commonmark-hs/issues/75
- The auto_identifiers uses a different algorithm – I made the previous ones explicit.
- Languages (classes) of code blocks cannot contain whitespace so we have to use “pycon” alias instead of Python “console” as GitHub’s linguist

While at it, I also fixed the following issues:
- ShellSesssion was used
- Removed some pointless docbook tags.
2021-06-07 06:34:59 +02:00
Silvan Mosberger
155ae682a5 buildGoModule/buildGoPackage: Introduce ldflags argument
Previously it was not possible to define multiple ldflags, since only
the last definition applies, and there's some quoting issues with
`buildFlagsArray`. With the new `ldflags` argument it's possible to do
this, e.g.

    ldflags = drv.ldflags or [] ++ [
      "-X main.Version=1.0"
    ]

can now properly append a flag without clearing all previous ldflags.
2021-06-05 09:54:36 +10:00
Jörg Thalheim
80b395015b
doc/go: convert to markdown 2020-11-28 07:32:10 +01:00