-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change how output is presented #619
Comments
Perfect! That's exactly what we need. If you had time to finish it that'd be great. The code looks minimal. A change like this I expect will require all kinds of testing and tweaking to ensure it works on all platforms (Windows) and that you can turn it off to redirect the output to a file, and so on. But I would recommend to simply get it merged into master, and then we'll fix all bugs as we go. |
Since a lot of the messages are still set up for it from previous runs at this (#502 and #505 in particular) note that a lot of the messages are set up with and prefixes (and others) to be used with M_attr, which is a small module that was designed to just be included into fpm(1) to allow for color mode, and that a (probably) simple one that should probably done first is to add the verbose mode into the backend model, as there were concerns about it just being provided as a global state type. M_attr was designed to add color in a manner that can be turned of except when writing to a tty device and to allow for extensions and customization without changing the code, but as a simplified version of M_escape that could just be added as file in the fpm distribution, although I suppose there is nothing wrong with using it as a dependency. The model that made most sense to me was that the command output for each command is written to a file in build and then copied back only if verbose mode is on or if an error occurs by default; but can be examined with new options at any time after the build without rebuilding. You can see how it was used in the quiet mode, as well as with help text in the referenced PRs and issues from the last two times; and the github repository explains some of the reasons to use this approach for color rather than directly using the escape sequences. |
PS; although their is an ncurses library for WIndow, i was playing with a plugin that used ncurses that displayed the source files like the output in a tree(1) output like at the beginning of the video from @LKedward ward where the file names changed color as they were done and you could click on them to see their messages or edit them (via the environment variable EDITOR) that was promising, but without a nice interface from the plugin to the backend it was way too kludgy but at some point (maybe using an entirely different GUI tool) maybe a mini-IDE would be nice; but my general impression was that those so inclined to use an IDE already were using a full-blown one and just wanted interfaces into their favorite one. I would probably restart if I try that again, but you can get an idea of how it worked by looking at fixedform in M_ncurses |
@urbanjost if you are interested, we created this library: https://github.com/jupyter-xeus/cpp-terminal/ which implements ncurses like functionality and it works on Windows. It also implements a multiline editing "widget" (that works on all platforms), that LFortran uses. |
Thanks. I will give that a try. What I was picturing was a scroll-able window that looks like the output of the tree(1) command that would be colored according to whether built with no warnings, with warnings, or with errors and you could click on the names to edit, see the build log of the routine, or run if an executable, sort of like a graphical windows commander plugin; but just have not had the time to pursue it. |
Reopening for some outstanding tasks:
|
Currently fpm's output is very verbose and it's hard to see what is going on. A bunch of commands (typically compiler invocations) are printed to stdout. Instead, let's do something like Rust's Cargo does:
Or the Julia's Pkg:
Note that Julia's Pkg prints all kinds of nice progress markers that all disappear when it is done, so the above output only captures the final result. I recommend you try the above commands yourself to see what I mean.
The final output of Cargo seems cleaner and it seems it contains all the information you need to know, which is which package got built and which version. We can also print which Fortran compiler was used (I am not sure).
P.S I thought I already opened up an issue for exactly this, but I can't find it, so I opened a new one.
The text was updated successfully, but these errors were encountered: