alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
278 stars 49 forks source link

`alr test` puts escape sequences in reports #831

Open jquorning opened 3 years ago

jquorning commented 3 years ago

alr --no-tty --no-color test --full puts escape sequences in junit (xml) reports and individual crate test logs <crate>/alire/alr_test_<time>.log.

I guess there should be no escape sequences in the files no matter what.

mosteo commented 3 years ago

Thanks for the report, Jesper. IIRC alr test is invoking child alr processes, it will be a matter of putting these flags always there.

mgrojo commented 3 years ago

Ideally, it should work like ls --color=auto, which disables colors when the output is not a terminal. I miss that in general, for example, when running alr build inside emacs or when redirecting to a file.

Fabien-Chouteau commented 3 years ago

Ideally, it should work like ls --color=auto, which disables colors when the output is not a terminal. I miss that in general, for example, when running alr build inside emacs or when redirecting to a file.

It should already work that way...

mgrojo commented 3 years ago

There are other kinds of changes, but not that:

image

Alr version: 1.1.0-rc2 Alire Library version: 1.1.0-rc2 alr status is (outside) (0 releases indexed) (loaded in 0.070s) config folder is /home/mgr/.config/alire source folder is /home/mgr/.config/alire/alire interaction flags are: force:FALSE not-interactive:FALSE alr root is empty alr root detection has settled on path: /home/mgr alr is finding 0 GPR project files alr session state is [OUTSIDE] alr compiled on [2021-09-02 08:41:34] with GNAT version [Community 2021 (20210519-103)] platform fingerprint: Linux Bits_64 Ubuntu platform properties: UBUNTU LINUX NATIVE SYSTEM BITS_64 community index required branch: devel-1.1

mosteo commented 3 years ago

I also thought this was automatically detected. We may have regressed on this.

jquorning commented 3 years ago
$ alr search term >color.txt
$ cat color.txt

Shows plain text with 1.1.0-rc1 compiled 2021-08-18 on my machine.

mgrojo commented 3 years ago

Tested with these AppImages:

alr-1.0.0-rc1.AppImage 
alr-1.0.1.AppImage 
alr-1.1.0-rc1.AppImage
alr-1.1.0-rc2.AppImage
alr-1.1.0-rc3-x86_64.AppImage

Everyone works as expected (no color when redirected) except for the latest two: alr-1.1.0-rc2.AppImage and alr-1.1.0-rc3-x86_64.AppImage

mosteo commented 3 years ago

Thanks for the reports, people.

Fabien-Chouteau commented 3 years ago

Everyone works as expected (no color when redirected) except for the latest two: alr-1.1.0-rc2.AppImage and alr-1.1.0-rc3-x86_64.AppImage

So obviously an issue with the CLIC refactoring. I am having a look.

Fabien-Chouteau commented 3 years ago

I found the issue: https://github.com/alire-project/clic/pull/13

Now @mosteo the question is: how do we use that fix in alr 1.1.0 now that all those breaking changes are merged in CLIC main? Looks like we have to do a branch in CLIC.

mosteo commented 3 years ago

Afraid so :S Let's hope not for long.