Closed HugoGranstrom closed 2 years ago
nim r
and the args you want (you might need to dump the json first)-f
is a good default argumentlocally you should be able to have full control on how to compile a single file using directly nim r and the args you want
This is exactly what I want to avoid actually, because of reproducibility. The other day we got an error on the CI but we had problems replicating it locally. If we could have seen the debug error messages directly in the CI it would have saved us much time.
in general I think we should have the possibility to reset build default arguments (either with a new command or with a special option) and pass new ones. ideally you might want to have a mechanism where override/customize arguments for each specific file/folder you build.
Agreed! Some simple files probably take more time to compile with release
than they take to run with debug
, so using debug could probably speed up things if done for those files.
incidentally looking at the default list of arguments I am wondering if -f is a good default argument
That does indeed sound very wasteful of time, I can't remember the rationale for introducing it in the first case 🤔 Feels like it had something to do with CI somehow 🤣
one option would be to remove all default arguments and pass all additional arguments received (so that we do not have to think of an option name to reset default arguments). In particular to reproduce current build one would call nbook build -d:release -f --verbosity:0 --hints:off
.
That does sound like a good solution to me :) Then it's very obvious which flags are passed as well, now you have to dig in the nimiBook source code to find them
fixed in #50
As it is now nimiBook will always run the files in
-d:release
mode (https://github.com/pietroppeter/nimibook/blob/81733b417ebb4dd5a9d72f59e007084b5ca015b5/src/nimibook/publishers.nim#L8), but it also means that if a program fails to run we don't get any useful stacktraces or debugging information. This is especially cumbersome in a CI where it just tells you that it has failed, but not what have failed. So having the option to build in debug-mode would be very useful. My current workaround is changing the linked line manually on my local installation, but that's not a feasible solution.Proposed solutions:
buildDebug
cmd argument to the CLI. (in addition toinit
,build
,clean
etc)-d:debug
, then the files it compiles should also be compiled with-d:debug
.Any thoughts on this?