| Commit message (Collapse) | Author | Age |
| |
|
|\ |
|
| |
| |
| |
| |
| | |
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
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
> The -v flag causes vendor to print the names of vendored modules and packages
> to standard error.
The `-v` flag helped me debug a `buildGoModule` derivation yesterday evening.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
the hook is for gotools, doesn't need to live with buildGoModule
- also remove duplicate buildGoPackage hook
|
|\ \
| |/
|/| |
go-modules: don't set trimpath for tests
|
| | |
|
|/ |
|
|\
| |
| | |
go-modules/packages: Run unit tests under subdirs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Bug:
Due to the way `buildGoDir` function was repurposed to also run `go
test`, if `checkFlags` was defined, `go test` was ran only at the top
level directory. Only the first element of `checkFlags` array would get
passed to the `go test` command as arguments.
Fix:
Now the first parameter to `buildGoDir` is handled as the command. If
the command is "test" `checkFlags` get passed as arguments along with
other build flags like ldflags, tags, etc.
Readability:
- Iteratively build a flag array in `buildGoDir` instead of single long
variable expansion command line.
- Bash style: Single line local assignment of positional parameters.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 361139c574ab2a37c46cd705fac90ada130ea139, reversing
changes made to 77ee91f1d318a03fa96571656ce8af25a236fbca.
This broke tests in some go packages, and at this point I don't want
further delays from figuring out what's wrong. This probably won't
make it to 22.05. Example failures:
https://hydra.nixos.org/build/176551928
https://hydra.nixos.org/build/176546993
but I think there were more among
https://hydra.nixos.org/eval/1762178?compare=1762151#tabs-now-fail
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Fix handling of `checkFlags` derivation attribute when it's a list of
two or more elements.
- Improve the readability go `buildGoDir` function with flag array
building and "test" command conditional.
- Bash style: Single line local assignment of positional parameters.
|
| | | |
|
| |/
|/|
| |
| | |
follow up from 8a8c88de70bd7f967cb20ad07583ea9ef12a4a94
|
|/ |
|
|
|
|
|
|
|
|
|
| |
The exclusion logic was moved out of getGoDirs but only buildPhase was updated
causing checkPhase to possibly fail. This happened in golint as it has go
files in testdata that are meant as testdata files and not go packages to
test which caused the checkPhase to fail.
Fixes #167717
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no backslash interpretation going on within single-quote strings
which means there's no need to escape the backslash. Since this was going
on within single-quote strings the $exclude variable ended up having 2
backslashes (`\\`) instead of the intended single backslash. This meant
that the regex that was built up was incorrect. For example prometheus'
exclude contents before and after this change are:
✕: \(/_\|examples\|Godeps\|testdata\\|documentation/prometheus-mixin\)
✓: \(/_\|examples\|Godeps\|testdata\|documentation/prometheus-mixin\)
|
|
|
|
| |
with sandboxing disabled this could still access the network
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
follow up from 8a8c88de70bd7f967cb20ad07583ea9ef12a4a94
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|\ |
|
| | |
|
|/
|
|
|
|
| |
enableParallelBuilding is unset so NIX_BUILD_CORES is always 1.
This copies how enableParallelBuilding is set in buildGoPackage.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
also remove a `disabled` leftover from 26117ed4b78020252e49fe75f562378063471f71
|
|
|
|
| |
This doesn't seem to have been used since pkgs/top-level/go-packages.nix was split up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building a go binary that's linking against some .so/.a, while
cross-compiling, we need to pass the correct compiler, otherwise
`go build` will fail with the not-so helpful error message:
```
gcc_arm64.S: Assembler messages:
gcc_arm64.S:28: Error: no such instruction: `stp x29,x30,[sp,'
gcc_arm64.S:32: Error: too many memory references for `mov'
gcc_arm64.S:34: Error: no such instruction: `stp x19,x20,[sp,'
gcc_arm64.S:37: Error: no such instruction: `stp x21,x22,[sp,'
gcc_arm64.S:40: Error: no such instruction: `stp x23,x24,[sp,'
gcc_arm64.S:43: Error: no such instruction: `stp x25,x26,[sp,'
gcc_arm64.S:46: Error: no such instruction: `stp x27,x28,[sp,'
gcc_arm64.S:50: Error: too many memory references for `mov'
gcc_arm64.S:51: Error: too many memory references for `mov'
gcc_arm64.S:52: Error: too many memory references for `mov'
gcc_arm64.S:54: Error: no such instruction: `blr x20'
gcc_arm64.S:55: Error: no such instruction: `blr x19'
gcc_arm64.S:57: Error: no such instruction: `ldp x27,x28,[sp,'
gcc_arm64.S:60: Error: no such instruction: `ldp x25,x26,[sp,'
gcc_arm64.S:63: Error: no such instruction: `ldp x23,x24,[sp,'
gcc_arm64.S:66: Error: no such instruction: `ldp x21,x22,[sp,'
gcc_arm64.S:69: Error: no such instruction: `ldp x19,x20,[sp,'
gcc_arm64.S:72: Error: no such instruction: `ldp x29,x30,[sp],'
```
|
|
|
|
| |
This is unnecessary with `buildGoModule`, it's usually cruft from `buildGoPackage` conversions.
|
|
|
|
|
|
|
| |
Also drop removeReferencesTo
`-trimpath` removes all file system paths from the compiled executable,
this should improve reproducibility.
|
|
|
|
| |
Allow the second phase to modify the contents of the vendor directory.
|
| |
|
|
|
|
| |
This commit should not change eval results
|
|
|
|
| |
also suppresses errors if those directories are not present
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|