go-modules/packages: Improve checkFlags handling#171177
go-modules/packages: Improve checkFlags handling#171177grahamc merged 1 commit intoNixOS:stagingfrom
checkFlags handling#171177Conversation
|
Converting this to a draft/wip so it isn't prematurely merged, I'll review in the next day or two. A few comments:
cc @mmlb You may be interested in this? |
checkFlags handlingcheckFlags handling
Done.
Doh! Done. |
|
What's the actual (not just a hypothetical) use case for Adding it to just match
|
|
To make this easier to test I'd prefer to narrow it to just I'm happy do to |
- 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.
Identical to the reason I hit this while I was trying to skip some tests that triggered a local networking issue with OfBorg's Linux runners in another PR. The arguments I needed to pass were |
Done and updated the PR description too.
Understood. I'll send a |
|
@grahamc Why was this merged? |
|
Like seriously, why?
|
|
I don't know why I'm bothering being the maintainer/codeowner if someone else is just going to come along and hit the merge button without even asking first ... |
|
By my read it was a good improvement to the readability and made the code more understandable. It also wasn't very invasive and looked like it was of low likelihood to cause real problems. Furthermore, it is from a contributor I think fairly highly of. If there are problems with it, we can go ahead and revert. |
|
So why do we have maintainers and codeowners if you're going to do a drive by merge? I absolutely don't understand why you couldn't at least have asked first? And yes, I do believe there will be some packages that have problems as a result of this. |
…ling" This reverts commit 361139c, reversing changes made to 77ee91f. 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
|
Reverted and explained in e11568d |
|
We got an eval diff that contains only revert of this PR, so that should be a good reference for what broke: https://hydra.nixos.org/eval/1762195#tabs-now-succeed |
|
Thanks @vcunat for the revert, sorry for the issues. Nice that there is such a clear diff to look at! |
|
@vcunat thanks for the revert, fixing build failures. When we look at the build output though, we see what is currently in master does not actually run the tests in subdirectories. Builds succeed because, well, we don't run a good chunk of tests for most Go projects. example: komposenewly succeeding kompose build's log shows it's actually not running the failing tests. Change in #171177 fixes running the tests in subdirectories. example: delvefrom newly succeeding delve build log: from failing build with this change: |
|
So how should I proceed? Surely we have a bunch of Go based packages that simply cannot pass unit tests. So another thing I can do is to go over the failing packages and disable their tests with a TODO for me and their maintainers. I believe it'd be good to ship a correct I'm relatively new to NixOS, and have little-to-no understanding of its release engineering practices. I'd love to hear your thoughts. |
|
I think only a handful of Go based packages were flying under the radar before this change. You can check the build logs and search for "running tests" and see how no unit test under subdirectories are run because the same tests from top level are run again for each sub-directory |
|
It would be ideal to fix most of these packages in the same pull request. Ping respective |
Fix handling of
checkFlagsderivation attribute when it's a list oftwo or more elements.
Improve the readability go
buildGoDirfunction with flag arraybuilding and "test" command conditional.
Bash style: Single line local assignment of positional parameters.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes