Run genhtml in WSL - flutter

I've been trying to use WSL to generate html reports for the code coverage of my flutter project, but this happens when I run genhtml coverage/lcov.info -o coverage/html:
Reading data file coverage/lcov.info
Resolved relative source file path "lib\blocs\bloc1\bloc1.dart" with CWD to "/mnt/c/Users/User/flutter_project/lib\blocs\bloc1\bloc1.dart".
Found 284 entries.
Found common filename prefix "/mnt/c/Users/User/flutter_project"
Writing .css and .png files.
Generating output.
Processing file flutter_project/lib\otherDir\other_file.dart
genhtml: ERROR: cannot read /mnt/c/Users/User/flutter_project/lib\otherDir\other_file.dart
I can understand that this has possibly to do with the paths, but I'm not sure on how to fix it. Any tips?

I ran into the same problem when attempting to use lcov through WSL, and I have figured out the issue.
The lcov file generated by flutter test --coverage on Windows has back slashes \ for paths instead of forward slashes /.
Simply replacing all back slashes in your lcov.info file with forward slashes before running genhtml, should resolve the issue.

I don't know if this could be useful in that environment.
I had the same problem, and to solve it I created this script. I hope this helps you!
https://github.com/jorgesarabia/flutter_coverage
Please let me know if this solves your problem!

I tried this!!
Instead of cd'ing into coverage/ then running genhtml lcov.info -o anything
Just run the whole command from the root of project, So the new command will look something like this:-
genhtml coverage/lcov.info -o anything
P.S. I was trying to run a coverage file generated by Flutter test.

Related

How to define rule file in debian packaging of a project which have a make file to build from source?

I'm new to stackoverflow so correct me if I made any mistake in providing the details.
So I'm trying to make a deb file for Apache-Age, and going by the documentation, if we try to install AGE from source then we can simply do it by :
make install
I have setup the basic directory structure by dh_make and have made the control file with proper dependencies, then comes the rule file.
So I went through 2 different extensions of postgreSQL :
postgresql-q3c
Postgis
And tried to replicate the same for apache-age, and tried to build by following commands
dpkg-buildpackage -rfakeroot -b
dpkg-buildpackage -nc -i
the build was giving some errors and warning but a deb file was generated.
The deb file installed properly but age-extension was not installed in PostgreSQL.
It's probably because the age was not building properly from source using make command as specified in the rule file.
Is there any good resource or how to make rule file ?
I tried following this answer, but got stuck here.
I found a PDF but didn't understand the build process.
This might be a naive way but it works for me:
Clone the repo and cd to it
Run the dh_make_pgxs command to make the debian build directory structure.
The you need to make changes to pgversion, control/control.in, changelog, copyright and rule files.
If you are just trying to use the make file to build the package then the rule file can be as simple as:
#!/usr/bin/make -f
%:
dh $#
Then simply run the build command as before.

How to Build an RPM from Source in One Line without Spec Files etc?

I've been reading about building RPMs, and the process is quite complex. Is there any program/software that works like this:
Download tar.gz file. Extract to directory
cd into directory
Run
RPM file is output into the directory
Does any such program exist? It seems as if it should. After all, when I run make, make install etc, I don't need to specify spec files, provide locations for where the software has to be installed. So why should I have to do all that for creating RPMs?
I've tried using checkinstall, but I keep getting errors like "Directory not found: /root/rpmbuild/BUILDROOT/hello-2.10-1.x86_64/usr"
So is there an easier way?
No. There is no easier way.
Sometimes upstream provide 'make rpm' target. Sometime checkinstall works. But often you have to create the spec file manually.
BTW that error from checkinstall reveals two things:
you are running that command as root. That is very very unwise.
you should create few build directories. Run command rpmdev-setuptree it will create them for you.

Build libraries in external folder of AOSP source code

I noticed that a simple
$ . build/envsetup.sh
$ lunch
$ aosp_hammerhead-eng
$ make -j16
Would not build also the external libraries in the ./external folder.
How am I supposed to build source code in such folder?
In particular, I am modifying source code in the libselinux in ./external/selinux/libselinux/src/
Thanks!
I found out that, by using the mm command, it is possible to build all of the modules in the current directory.
So, if you are in ./external/selinux/libselinux/ you can build all code inside such directory just by typing the command mm.
I also found that the same code I was modifying inside the ./external/selinux/libselinux/ is also located in ./external/libselinux/. However, this directory is linked to the make -j16 command.

ttf2ufm: command not found

I'm trying to install a font for use with TCPDF. To do so, I need to run the included command line utility ttf2ufm. (Included with TCPDF in fonts/utils/ttf2ufm) When I run it though, I get the error -bash: ttf2ufm: command not found. I'm probably just overlooking something simple, but I've searched and can't find what I'm missing here.
Should mention I'm using Debian Lenny.
Perhaps you do not know how commands are executed in bash.
If the program is not in the path, you need to specify the path to get it to run.
If you are in the right directory.
.../fonts/utils/ $ ./ttf2ufm ....
Note the ./ in front of it, that gives the file a path, in the present working directory, or the full path will work, or any other relative path. Just using ttf2ufm on its own will not, as the current directory is not usually part of the executable path.
Additionally, the program will need its executable bit set.

Error while launching external scanner

Error launching external sccanner info generator(gcc -E -P -v -dD C:/Documents/Workspace)
Do any one know what is the problem this is for the windows . I downloaded the exact C version without java support but still it is showing this error .
Thanks
Might be a path problem.
Try copying the gcc.exe to c:\Windows as a test. It won't work from there stand-alone, but you should at least see some difference that will help you determine if your problem is indeed a PATH one.