c-blake / cligen

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at
https://c-blake.github.io/cligen/
ISC License
501 stars 23 forks source link

nim CI broken after recent commit #142

Closed timotheecour closed 4 years ago

timotheecour commented 4 years ago

nim CI broke after a recent commit; this could be root caused by the broken way in which nim tests nimble packages; investigating ...

note: as of cligen 34578fc60d27da93d4873cdd838e449d00ac51f7


https://pipelines.actions.githubusercontent.com/ZRinn1OrR0LWxU3iWy1StaQcZRN2kXW9lHWwDJ3esfasrmfdRn/_apis/pipelines/1/runs/1087/signedlogcontent/3?urlExpires=2020-05-05T11%3A00%3A30.7579137Z&urlSigningMethod=HMACV1&urlSignature=kXw%2FA%2FnIdPvweqNFEOlAwrO582IYFVt7nrzz7ygwyoQ%3D

2020-05-05T10:11:52.5217820Z PASS: https://github.com/treeform/chroma C                         ( 5.25 sec)
2020-05-05T10:11:52.5218530Z PASS: https://github.com/status-im/nim-chronicles C                (39.52 sec)
2020-05-05T10:11:52.5219150Z FAIL: https://github.com/c-blake/cligen.git C
2020-05-05T10:11:52.5219820Z Test "https://github.com/c-blake/cligen.git" in category "nimble-packages"
2020-05-05T10:11:52.5220680Z Failure: reBuildFailed
2020-05-05T10:11:52.5220860Z package test failed
2020-05-05T10:11:52.5221400Z $ nim c -o:cligenn -r cligen.nim
2020-05-05T10:11:52.5222050Z Hint: used config file '/Users/runner/runners/2.169.1/work/Nim/Nim/config/nim.cfg' [Conf]
2020-05-05T10:11:52.5222710Z Hint: used config file '/Users/runner/runners/2.169.1/work/Nim/Nim/config/config.nims' [Conf]
2020-05-05T10:11:52.5222880Z Hint: system [Processing]
2020-05-05T10:11:52.5223040Z Hint: widestrs [Processing]
2020-05-05T10:11:52.5223180Z Hint: io [Processing]
2020-05-05T10:11:52.5223320Z Hint: cligen [Processing]
2020-05-05T10:11:52.5223460Z Hint: os [Processing]
2020-05-05T10:11:52.5223610Z Hint: strutils [Processing]
2020-05-05T10:11:52.5223760Z Hint: parseutils [Processing]
2020-05-05T10:11:52.5223900Z Hint: math [Processing]
2020-05-05T10:11:52.5224040Z Hint: bitops [Processing]
2020-05-05T10:11:52.5224180Z Hint: macros [Processing]
2020-05-05T10:11:52.5224330Z Hint: algorithm [Processing]
2020-05-05T10:11:52.5224480Z Hint: unicode [Processing]
2020-05-05T10:11:52.5224620Z Hint: pathnorm [Processing]
2020-05-05T10:11:52.5224770Z Hint: osseps [Processing]
2020-05-05T10:11:52.5224910Z Hint: posix [Processing]
2020-05-05T10:11:52.5225050Z Hint: times [Processing]
2020-05-05T10:11:52.5225200Z Hint: options [Processing]
2020-05-05T10:11:52.5225350Z Hint: typetraits [Processing]
2020-05-05T10:11:52.5225500Z Hint: tables [Processing]
2020-05-05T10:11:52.5225630Z Hint: hashes [Processing]
2020-05-05T10:11:52.5225790Z Hint: parseopt3 [Processing]
2020-05-05T10:11:52.5225940Z Hint: critbits [Processing]
2020-05-05T10:11:52.5226080Z Hint: argcvt [Processing]
2020-05-05T10:11:52.5226230Z Hint: strformat [Processing]
2020-05-05T10:11:52.5226370Z Hint: sets [Processing]
2020-05-05T10:11:52.5226500Z Hint: textUt [Processing]
2020-05-05T10:11:52.5226650Z Hint: terminal [Processing]
2020-05-05T10:11:52.5226790Z Hint: colors [Processing]
2020-05-05T10:11:52.5226930Z Hint: termios [Processing]
2020-05-05T10:11:52.5227080Z Hint: wordwrap [Processing]
2020-05-05T10:11:52.5227210Z Hint: gcarc [Processing]
2020-05-05T10:11:52.5227570Z Hint: sysUt [Processing]
2020-05-05T10:11:52.5227770Z Hint: macUt [Processing]
2020-05-05T10:11:52.5227920Z Hint: streams [Processing]
2020-05-05T10:11:52.5228060Z Hint: parsecfg [Processing]
2020-05-05T10:11:52.5228210Z Hint: lexbase [Processing]
2020-05-05T10:11:52.5228350Z Hint: humanUt [Processing]
2020-05-05T10:11:52.5228490Z Hint: textUt [Processing]
2020-05-05T10:11:52.5229280Z /Users/runner/.nimble/pkgs/cligen-0.9.45/cligen/humanUt.nim(1, 68) Warning: imported and not used: 'textUt' [UnusedImport]
2020-05-05T10:11:52.5230030Z /Users/runner/.nimble/pkgs/cligen-0.9.45/cligen/humanUt.nim(1, 61) Warning: imported and not used: 'posix' [UnusedImport]
2020-05-05T10:11:52.5230780Z /Users/runner/.nimble/pkgs/cligen-0.9.45/cligen/humanUt.nim(1, 24) Warning: imported and not used: 'algorithm' [UnusedImport]
2020-05-05T10:11:52.5231500Z /Users/runner/.nimble/pkgs/cligen-0.9.45/cligen/humanUt.nim(1, 35) Warning: imported and not used: 'sets' [UnusedImport]
2020-05-05T10:11:52.5231950Z /Users/runner/runners/2.169.1/work/Nim/Nim/pkgstemp/cligen/cligen/clCfgInit.nim(86, 53) Error: type mismatch: got <string, set[char], bool, keepPct: bool, termInAttr: bool>
2020-05-05T10:11:52.5232110Z but expected one of: 
2020-05-05T10:11:52.5232720Z proc specifierHighlight(fmt: string; pctTerm: set[char]; plain = false; pct = '%';
2020-05-05T10:11:52.5233300Z                        openBkt = {'{', '['}; closeBkt = {'}', ']'}): string
2020-05-05T10:11:52.5233980Z   first type mismatch at position: 4
2020-05-05T10:11:52.5234110Z   unknown named parameter: keepPct
2020-05-05T10:11:52.5234170Z 
2020-05-05T10:11:52.5234450Z expression: specifierHighlight(e.value, Whitespace, plain, keepPct = false, termInAttr = false)
2020-05-05T10:11:52.5234560Z 
2020-05-05T10:40:37.1497280Z PASS: https://github.com/samuelroy/coco C                          (17.33 sec)
2020-05-05T10:40:37.1498330Z PASS: https://github.com/PMunch/combparser C                       ( 4.38 sec)

and indeed I can reproduce locally;

nim c -o:cligenn -r cligen.nim

clCfgInit.nim(86, 53) Error: type mismatch: got <string, set[char], bool, keepPct: bool, termInAttr: bool>
but expected one of:
proc specifierHighlight(fmt: string; pctTerm: set[char]; plain = false; pct = '%';
                       openBkt = {'{', '['}; closeBkt = {'}', ']'}): string
  first type mismatch at position: 4
  unknown named parameter: keepPct

expression: specifierHighlight(e.value, Whitespace, plain, keepPct = false, termInAttr = false)
          of "usehdr", "usageheader":  c.useHdr   = hl(e.value)
c-blake commented 4 years ago

I cannot reproduce this failure with nim-1.2.0 or nim-devel..just copying your command line. What am I missing?

SolitudeSF commented 4 years ago

it only works/fails if older version of cligen is nimble installed. you can see from traceback that it uses modules from different sources.

timotheecour commented 4 years ago

this sounds like another instance of https://github.com/nim-lang/Nim/pull/13868#issuecomment-618890814 which points to important_package's broken way of testing packages

repro instructions:

nim -v e86a6d24d5ffe43e9dc7f230b80c274167376225

cd $dir
git clone https://github.com/c-blake/cligen.git cligen1 && cd cligen1
git checkout 71ce865a1af7d9db32e5fa0cd593a1bedcb0ddb2
nimble develop
cd $dir
git clone https://github.com/c-blake/cligen.git cligen2 && cd cligen2
nim c -o:cligenn -r -f cligen.nim # fails
nim c --path:. -o:cligenn -r -f cligen.nim # works

you may think this is silly, and indeed it is, but I think that's what's happening; not just to your package, this basically keeps breaking every few days for random packages.

this is very order-dependent (read: buggy), where package X depends on cligen at version N, but then cligen gets tested via version HEAD => bug.

simply passing --path:. works in this specific case but isn't a real general fix because HEAD may also need to be installed to pickup new dependencies.

kaushalmodi commented 4 years ago

From

but expected one of:
proc specifierHighlight(fmt: string; pctTerm: set[char]; plain = false; pct = '%';
                       openBkt = {'{', '['}; closeBkt = {'}', ']'}): string
  first type mismatch at position: 4
  unknown named parameter: keepPct

The CI has somehow fetched a roughly 21 hr older version of humanUt.nim from this repo, and not the latest.

c-blake commented 4 years ago

Well, I can punch the 0.9.46 release very soon. I was going to as soon as I heard back from @kaushalmodi this morning. Would that help since there would be a new tagged version? { It's definitely not designed to be cross compatible with old versions of itself. That's a crazy high bar... ;-) }

c-blake commented 4 years ago

I certainly don't want to hold up the whole Nim CI procedures (which do sound too fragile).

timotheecour commented 4 years ago

The CI has somehow fetched a roughly 21 hr older version of humanUt.nim from this repo, and not the latest.

exactly what I'm diagnosing in https://github.com/nim-lang/Nim/pull/13868#issuecomment-618890814 : nimble installs latest tag, but tests latest HEAD

Would that help since there would be a new tagged version

yes it will fix it in this case, so good enough as a quick fix, but the underlying testament bug remains ...

It's definitely not designed to be cross compatible with old versions of itself. That's a crazy high bar

once testament is fixed that won't be needed (current bar is HEAD vs latest tag, not tag N vs tag N-1)

c-blake commented 4 years ago

Ok. I am closing this issue since it's not really a cligen package issue. Hopefully testament can be made more robust.

kaushalmodi commented 4 years ago

Well, I can punch the 0.9.46 release very soon. I was going to as soon as I heard back from @kaushalmodi this morning.

I am good with the release. The HEAD of this repo is working fine for me.