How can I get Shake to print errors only once? - shake-build-system

If I ever have an error during a build, I see it twice
# ghc (for _build/lib/WCLoan.o)
# ghc (for _build/lib/WCLoan.o)
[2 of 2] Compiling WCLoan ( src/WCLoan.hs, _build/lib/WCLoan.o )
src/WCLoan.hs:18:1: error:
Parse error: module header, import declaration
or top-level declaration expected.
|
18 | imAnError
| ^^^^^^^^^
Error when running Shake build system:
* _build/lib/WCLoan.o
user error (Development.Shake.cmd, system command failed
Command: ghc -this-unit-id wcloan-0.0.1 src/WCLoan.hs -outputdir_build/lib -isrc:app:test -dynamic-too -O2 -j12 -fPIC -Werror -Wall -package-name wcloan-0.0.1 '-package base
-4.12.0.0' '-package calc-0.0.1' '-package vector-0.12.0.3'
Exit code: 1
Stderr:
src/WCLoan.hs:18:1: error:
Parse error: module header, import declaration
or top-level declaration expected.
|
18 | imAnError
| ^^^^^^^^^
)
I see that the error occurs during build, then is also shown under the line
Error when running Shake build system:
Is there anything I can do to have it show only once?

The error messages are coming from two distinct locations:
The first one is being printed by a command that Shake runs and writes to stderr with an error message. When you do cmd ... Shake defaults to EchoStderr True (print out the stderr stream to the console), but you can pass EchoStderr False to not echo the stderr.
The second is an exception being bubbled up by Haskell, as a ShakeException, which then gets printed out at the end, and includes the stderr. When you do cmd ... Shake defaults to WithStderr True to include the stderr in the exception, and you can pass WithStderr False to not include the stderr in the exception.
However, because of the way Shake works, you may find that the error message comes out quite a long way before the end of the full Shake command. Therefore, I recommend leaving WithStderr as it is, if you do want to see stderr only once.

Related

How do I fix the package testing error Julia?

When I test the NTFk package with command Pkg.test("NTFK"). I'm getting the below error.
ERROR: LoadError: Some tests did not pass: 1 passed, 1 failed, 0
errored, 0 broken. in expression starting at
C:\Users\lff19.julia\packages\NTFk\bvyOe\test\runtests.jl:17 ERROR:
Package NTFk errored during testing
For Test.jl, the package scans for ~/PACKAGENAME/test/runtests.jl
A "passed" test is self-explanitory.
A "failed" test means a test resulted in an unexpected value.
An "errored" test means the test was not able to be executed, it errored instead.
A "broken" test refers to a known failing test. Setting the test to "broken" means it will ignore the "fail" status.
So, the 1 failing test is just a single fail in the project's runtest.jl file. It is not a problem with your Pkg.test("NTFK") command, it is a problem within the source code. It should be relatively simple to figure out which test fails from the error/ your console's output.
Realistically, it should be the developer's responsibility to fix the testcase. Although, you could just as well "dev" the package( ] dev PACKAGENAME), effectively making yourself the maintainer for your local package, and going into the runtests.jl and fixing it yourself. Note that "dev"ing a package will move it to ~/.julia/dev .

AFL "(odd, check syntax!) "

I am trying to fuzz pngquant using AFL and noticed that I am seeing the odd, check syntax! warning. A previous answer says that AFL is probably not reading the input file I specified. I am able to invoke pngquant by providing the png file located in the same input sample directory I used while fuzzing with AFL.
The AFL command I executed is:
afl-fuzz -i ./in-filtered -o ./out -x ./dictionary/png.dict -- pngquant ##
The AFL documentation mentions that the odd, check syntax! warning may pop up when AFL is not able to find new paths.
Additionally, I notice that the warning pops up as soon as AFL begins using the havoc fuzzing strategy, the images below show that the cycle counts start incrementing as soon as the fuzzer begins using havoc.
This is because of incorrect usage of pngquant.
When using pngquant, it produces an output file with your results, when you do it twice you will encounter an error:
➜ pngquant git:(master) ✗ ./pngquant ./test/img/metadata.png
➜ pngquant git:(master) ✗ ./pngquant ./test/img/metadata.png
error: './test/img/metadata-fs8.png' exists; not overwriting
AFL has no chance to explore the target, since it gets blocked every time.
After a quick look, the easiest fix is like this:
afl-fuzz -i ./in -o ./out -- ./pngquant -f -- ##
This forces pngquant to overwrite the resultfile and therefore enables afl-fuzz. However, be aware that this produces a lot of IO. So try to circumvent this using /dev/null or similar tricks.
Happy fuzzing!

What may be the reason why I get "Test ignored." message while running any test class in Apex?

Tests ignored: 14, passed: 0
Whenever I run any test class I get this type of messages:
Test ignored.
Test method AccountAddressHelperTest.testInvalidBillingCountry was
never reported as completed. Trigger.AllOppLineItemTriggers: line 188,
column 31: Method does not exist or incorrect signature: void
updateMISROnOpportunity(Map<Id,OpportunityLineItem>,
Map<Id,OpportunityLineItem>) from the type OppLineItemHelper
You have compilation failures. What happens if you hit Setup -> Classes -> Compile all?
You or your colleague edited something, probably in file OppLineItemHelper. Or some other file this file reuses. And now not everything compiles, dependencies aren't met. So best thing SF can do is skip these tests.
You can edit like that in sandboxes, SF will not always block you. But compile errors will prevent deployment to prod even before any tests are run

Compiling perl >5.10 on AIX version 5.3

I've been compiling OpenSSL (and thus Perl >5.10, as it is a dependency) on multiple platforms. I've managed to get 1.1.0b compiled on every single platform except AIX, which I can't even compile Perl. I've tried several versions and looked at the documentation Perl provides online. From what I can tell, it suggests version 5.12.2.
When I attempt to compile version 5.12.2,
I take the following from the documentation, and fill in a few local system variables, such as using XLC rv7.
export OBJECT_MODE=64
./Configure \
-d \
-Dcc=/usr/vac/bin/xlc_r7 \
-Duseshrplib \
-Duse64bitall \
-Dprefix=`pwd`/../PERL
Then I attempt to make as prompted, and get the following error:
/usr/vac/bin/xlc_r7 -q64 -o miniperl -brtl -bdynamic -L/usr/local/lib -b64 gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o miniperlmain.o opmini.o perlmini.o -lbind -lnsl -ldl -lld -lm -lcrypt -lc
LIBPATH=.../perl-5.12.2 ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
LIBPATH=.../perl-5.12.2 ./miniperl -Ilib autodoc.pl
/usr/bin/ln -s perl5122delta.pod pod/perldelta.pod
LIBPATH=.../perl-5.12.2 ./miniperl -Ilib -Icpan/Cwd -Icpan/Cwd/lib pod/perlmodlib.PL -q
readdir(./../../../../..): Bad file number at lib/FindBin.pm line 116
stat(/pod/): No such file or directory at lib/FindBin.pm line 197
stat(/pod/): No such file or directory at lib/FindBin.pm line 200
Use of chdir('') or chdir(undef) as chdir() is deprecated at pod/perlmodlib.PL line 9.
No such file or directory at pod/perlmodlib.PL line 19.
make: The error code from the last command is 2.
Taking a look at pod/perlmodlib.PL, we see the following:
# MANIFEST itself is Unix style filenames, so we have to assume that Unix style
# filenames will work.
open (MANIFEST, "../MANIFEST") or die $!;
In my desperation I tried to hack it up and avoid writing to the manifest, but then I get this issue:
Creating Makefile.PL in cpan/Archive-Extract for Archive::Extract
Running Makefile.PL in cpan/Archive-Extract
../../miniperl Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none PERL_CORE=1 LIBPERL_A=libperl.a
readdir(./../../../../../../..): No such file or directory at ../../lib/File/Find.pm line 610
Use of chdir('') or chdir(undef) as chdir() is deprecated at ../../lib/File/Find.pm line 773.
readdir(./../../..): No such file or directory at ../../cpan/Cwd/lib/File/Spec/Unix.pm line 483
Could not open 'lib/Archive/Extract.pm': No such file or directory at ../../cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm line 2588.
512 from cpan/Archive-Extract's Makefile.PL at make_ext.pl line 390.
Warning: No Makefile!
make: Cannot find a rule to create target config from dependencies.
Stop.
make config PERL_CORE=1 LIBPERL_A=libperl.a failed, continuing anyway...
Making all in cpan/Archive-Extract
make all PERL_CORE=1 LIBPERL_A=libperl.a
make: Cannot find a rule to create target all from dependencies.
Stop.
Unsuccessful make(cpan/Archive-Extract): code=512 at make_ext.pl line 449.
make: The error code from the last command is 2.
The frequency of errors makes me feel like perhaps I don't have something configured right...
My next thought was to try the most updated version, which at the time of writing is 5.24. Using the same configuration and attempting to make I get the following issue:
Can't locate strict.pm in #INC (you may need to install the strict module) (#INC contains: /cpan/AutoLoader/lib /dist/Carp/lib /dist/PathTools /dist/PathTools/lib /cpan/ExtUtils-Install/lib /cpan/ExtUtils-MakeMaker/lib /cpan/ExtUtils-Manifest/lib /cpan/File-Path/lib /ext/re /dist/Term-ReadLine/lib /dist/Exporter/lib /ext/File-Find/lib /cpan/Text-Tabs/lib /dist/constant/lib /cpan/version/lib /lib .) at autodoc.pl line 25.
BEGIN failed--compilation aborted at autodoc.pl line 25.
make: The error code from the last command is 2.
Which I know from other compilations means I need to edit the PERL5LIB variable.
If I keep adding all the modules to the path:
export PERL5LIB=`pwd`/dist/Exporter/lib:$PERL5LIB
export PERL5LIB=`pwd`/cpan/Text-Tabs/lib:$PERL5LIB
export PERL5LIB=`pwd`/ext/re:$PERL5LIB
export PERL5LIB=`pwd`/dist/constant/lib:$PERL5LIB
export PERL5LIB=`pwd`/cpan/ExtUtils-MakeMaker/lib:$PERL5LIB
export PERL5LIB=`pwd`/dist/Carp/lib:$PERL5LIB
export PERL5LIB=`pwd`/cpan/File-Path/lib:$PERL5LIB
export PERL5LIB=`pwd`/dist/PathTools:$PERL5LIB
export PERL5LIB=`pwd`/dist/PathTools/lib:$PERL5LIB
export PERL5LIB=`pwd`/ext/File-Find/lib:$PERL5LIB
Even so, I'll still get an error for a module that isn't even present in the 5.24.0 source!
Can't locate ExtUtils/MakeMaker/version/vpp.pm in #INC (you may need to install the ExtUtils::MakeMaker::version::vpp module) (#INC contains: <removed from post>) at (eval 2) line 2.
BEGIN failed--compilation aborted at (eval 2) line 2.
Compilation failed in require at .../perl-5.24.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm line 10.
BEGIN failed--compilation aborted at .../perl-5.24.0/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm line 10.
Compilation failed in require at Makefile.PL line 7.
BEGIN failed--compilation aborted at Makefile.PL line 7.
Unsuccessful Makefile.PL(cpan/Archive-Tar): code=512 at make_ext.pl line 517.
make: The error code from the last command is 2.
I have MakeMaker, but the 5.24 version does not contain vpp.pm! Again, in desperation I attempted to put it in there from a different source, and I get this error:
LIBPATH=.../perl-5.24.0 ./miniperl -Ilib make_ext.pl cpan/Archive-Tar/pm_to_blib MAKE="make" LIBPERL_A=libperl.a
readdir(./../../../../../../..): No such file or directory at .../perl-5.24.0/ext/File-Find/lib/File/Find.pm line 142.
Can't cd to : No such file or directory
Unsuccessful Makefile.PL(cpan/Archive-Tar): code=512 at make_ext.pl line 517.
make: The error code from the last command is 2.
All of this makes me feel like perhaps I'm not configuring something right... Can anyone with some experience help me out with some cut and dry installation instructions for Perl on AIX? I'd be super grateful. Thanks!
Below is some information about my system:
> prtconf
System Model: IBM,8231-E1D
Machine Serial Number: Not Available
Processor Type: Not Available
Processor Implementation Mode: POWER 7
Processor Version: PV_7_Compat
Number Of Processors: 0
Processor Clock Speed: Not Available
CPU Type: 64-bit
Kernel Type: 64-bit
Memory Size: 10240 MB
Good Memory Size: Not Available
Platform Firmware level: Not Available
Firmware Version: IBM,AL770_092
Console Login: disable
Auto Restart: true
Full Core: false
I pull down and compile openssh and openssl frequently. I use gcc and no real magic that I can recall.
Here is my script to build it. I don't know which perl is native to AIX but it seems to work for me.
https://github.com/pedz/aix-build-scripts/blob/master/build-scripts/build-openssl

What is the make: *** [test] Error 10 signify?

I run a program using Makefile and it is giving me a strange error, although successfully executed. make: *** [test] Error 10
Here is my Makefile code
30
31 test:
32 # echo
33 # echo "Testing Electric Fence."
34 # echo "After the last test, it should print that the test has PASSED."
35 ./eftest
36 ./tstheap 3072
37 # echo
38 # echo "Starting test for time-interval-measurement."
39 export EF_ERRTRACK_START=3; export EF_ERRTRACK_END=5; ./time-interval-measurement-test
40 # echo
41 # echo "Electric Fence confidence test PASSED."
42 # echo
On execution:
Time interval measurement test: PASSED
make: *** [test] Error 10
-bash-3.2# make test
To workaround that (in case you cannot modify the (return/exit) behaviour of your binaries) use
./exec || /bin/true
.
[foo] Error NN’
These errors are not really make errors at all. They mean that a program that make invoked as part of a recipe returned a non-0 error code (‘Error NN’), which make interprets as failure, or it exited in some other abnormal fashion (with a signal of some type). See Errors In Recipes.
If no ** * is attached to the message, then the subprocess failed but the rule in the makefile was prefixed with the - special character, so make ignored the error.
http://www.gnu.org/s/hello/manual/make/Error-Messages.html
So one of your commands is returning a non-zero error code.
One of your command exits with error. Not echo, the other ones. Check them.

Resources