Play 2.2 google closure compiler opiton nonStandardJsDocs - playframework-2.2

How to specify nonStandardJsDocs at Build.scala to turn off the warning of js compile warnings from google compiler?
I tried this
closureCompilerOptions += "nonStandardJsDocs=OFF"
or this
closureCompilerOptions ++= Seq("--jscomp_off", "nonStandardJsDocs"),
but it doesn't work.
Here is the error when I run play dist:
com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /myfolder/modules/web-front/app/assets/js/vendor/ng-tags-input/ng-tags-input.js:374: WARNING - Parse error. illegal use of unknown JSDoc tag "ngdoc"; ignoring it
* #ngdoc directive
^

You can use the --extra_annotation_name arg to suppress warnings for Angular annotations.
The following works (tried in compiler version v20140814):
--extra_annotation_name ngdoc --extra_annotation_name restrict

Related

undefined symbol: __afl_area_ptr when trying to compile Kisak strike

I want to fuzz the map loading feature in counter strike. The source code for csgo got leaked a while back and here is a build which you can compile https://github.com/SwagSoftware/Kisak-Strike . However, when I try to compile it using this command:
AFL_USE_ASAN=1 PERSIST=1 cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-gcc-fast -DCMAKE_CXX_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-g++-fast ..
and then when i try to run ./csgo_linux64 , it throws this error:
Failed to load the launcher(bin/linux64/launcher_client.so) (/home/cyberhacker/Asioita/Csgocompile/withjump/game/bin/linux64/libtier0_client.so: undefined symbol: __afl_area_ptr)
I am expecting it to just work as usual (same as with the regular build). It works completely fine when I try to compile it normally with this command:
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_CXX_COMPILER=/usr/bin/c++ ..
and then make -j8
I searched a bit and found this: this . In that conversation they say that this error can be cause by compiling with afl-gcc but then linking with normal gcc or ld. However this is not the cause of my problem since I have looked through the cmake log files and the binaries are being linked with afl-g++-fast so this shouldn't be a problem in my case. I read somewhere that the libraries should be statically included, not dynamic but I do not think that it is a necessity. Feel free to look at the Kisak strike source code if you want to (obviously).

Kotlin compiler error -d invalid argument

I am getting an error when I go to compile the kotlin cmd file for Windows, using their Hello, World! one, but I had to modify part of the compile command to get the -target part to be valid. I am not sure how to fix the invaled -d argument that they show to use.
The text editor is Visual Studio Code.
Compiler: Kotlin-native-windows-1.4.32.zip from JetBrains' GitHub account - https://github.com/JetBrains/kotlin/releases/tag/v1.4.32
My compiler command is kotlinc.bat helloworld.kt -target mingw_x64 -d "hello world/hello world.jar"
Output:
error: invalid argument: -d
info: use -help for more information
How can I fix this?
This is the Kotlin/Native compiler, and it supports a different set of command-line arguments.
The solution is to download the Kotlin/JVM compiler from the archive named kotlin-compiler-1.4.32.zip.
Since Kotlin 1.5-M1, the Native compiler will show a clarifying warning for this case: Native / CLI: provide a way to show difference between Jvm and Native compilers.

clang-tidy report error unknown argument when contain other compiler options

I have a project, I built it with intel compiler. I want use the clang-tidy to help detect code problems.
I am using CMake to generate compile_commands.json and I'm getting the follow error when I using clang-tidy:
$ run-clang-tidy
# output
# ...
clang-tidy-6.0 -header-filter=^/home/xuhui/temp/build/.* -p=/home/xuhui/temp/build /home/xuhui/temp/main.cpp
1 warning and 1 error generated.
Error while processing /home/xuhui/temp/main.cpp.
error: unknown argument: '-w2' [clang-diagnostic-error]
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [clang-diagnostic-unknown-warning-option]
Actually, there is a very simliar question exist: clang-tidy reporting unknown warnings
However, when I try to using the method refered above, there is no help. The warning can be suppressed but error still exist.
$ run-clang-tidy -extra-arg=-Wno-unknown-warning-option
# output
# ...
clang-tidy-6.0 -header-filter=^/home/xuhui/temp/build/.* -extra-arg=-Wno-unknown-warning-option -p=/home/xuhui/temp/build /home/xuhui/temp/main.cpp
1 error generated.
Error while processing /home/xuhui/temp/main.cpp.
error: unknown argument: '-w2' [clang-diagnostic-error]
How can I deal with the error?
-w2 options is used to control warning in intel compiler.
Although the problem occurs to me because of the intel compiler, but may be other compiler's options can also leads to the problem.
Appendix
The follow code snippets can help reproduce the problem.
// CMakeLists.txt
SET(CMAKE_CXX_COMPILER "icc")
SET(CMAKE_CXX_COMPILER "icpc")
project(test)
# leads to warning, can be settled by refer link
add_compile_options("-Wno-maybe-uninitialized")
# leads to error, can not be settled by refer link
add_compile_options("-w2")
add_executable(a.out main.cpp)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
// main.cpp
#include <iostream>
int main()
{
std::cout << "hello!" << std::endl;
return 0;
}
the above code can generate compile_commands.json like follows:
[
{
"directory": "/home/xuhui/temp/build",
"command": "/opt/intel/compilers_and_libraries_2019.0.117/linux/bin/intel64/icpc -Wno-maybe-uninitialized -w2 -o CMakeFiles/a.out.dir/main.o -c /home/xuhui/temp/main.cpp",
"file": "/home/xuhui/temp/main.cpp"
}
]
Thanks for your time.
This is not a clang-tidy error per se. Clang-diagnostic-error is basically a compiler error. Clang has made unknown arguments a hard error some time ago and it cannot be degraded to a warning. There used to be -Qunused-arguments but that doesn't work in Clang 11 AFAIK.
You will have to remove the argument before passing the compile commands to clang-tidy, I suggest CMake - remove a compile flag for a single translation unit.
#pablo285 already give the perfect answer.
He said that:
have to remove the argument before passing the compile commands to
clang-tidy
He already provide a link to demonstate how to modify CMakeLists.txt to remove argument.
Also, we can do some modification directly on compile_commands.json to remove argument.
A script to tidy code can be written as follows:
# tidy_code.sh
cd build
cmake ..
# do modification on compile_commands.json to remove argument which clang can not recognized
# replace '-w2' to ' '
sed -i 's/-w2/ /g' compile_commands.json
# using clang tidy
run-clang-tidy -checks='*' -extra-arg=-Wno-unknown-warning-option

Error building Angular Library : Cannot read property 'toString' of undefined

I have created a custom library to be used in my main angular application...
However, when I try to build the library using ng build lib-name I am getting the error:
**Cannot read property 'toString' of undefined**.
I could not find an exact solution to get rid of this error.
Any suggested actions?
Some reference information:
Angular CLI: 8.3.5
Node: 10.16.3
OS: win32 x64
Angular:
...
Package Version
#angular-devkit/architect 0.803.5
#angular-devkit/core 8.3.5
#angular-devkit/schematics 8.3.5
#schematics/angular 8.3.5
#schematics/update 0.803.5
rxjs 6.4.0
For me, I get this because I prefer inline templates and styles but I forget to include -s -t flags when using ng generate (especially in lib projects where the global inline settings in angular.json don't seem to stick?).
After I do an ng generate I delete the foo.html and foo.scss files to avoid going into a trance while alt-tabbing 20 times in 5 seconds.
Then, I change templateUrl to template: <p>foo works</p> (note: replace the single quotes from the url string with the template's tickmarks).
I then often forget to change the styleUrl['foo.scss'] to styles:[``] and then this error message pops up. This is quite a lame error message from a great tool but I thinks it has something to do with the opacity of webpack.

Intellij external tool does not output stdout logs from Sass

i'm using sass for my project, in intellij using sass plugin.
i want to be able to launch sass --watch from within intellij, to be able to get console feedback, with clickable lines.
i've setup an external tool in intellij with:
Program: D:\ruby\bin\sass.bat
Parameters: --watch $/FileRelativeDir$
Working directory: $ProjectFileDir$
it does compile my scss to css without problems but the stdout from sass are not reported in the intellij console. i only get stderr.
if i have an error, after a while, i get a bunch of lines at once.
so i'm guessing there is some kind of buffering happening.
redirecting 1>&2 does not solve the problem.
Here's what i get in logs
Sass::Compiler#on_updating_stylesheet callback is deprecated and will be removed in a future release. Use Sass::Compiler#on_updated_stylesheet instead, which is run after stylesheet compilation.
d:/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.11/vendor/fssm/lib/fssm/support.rb:40: Use RbConfig instead of obsolete and deprecated Config.
and here's what i get using the same command in a console :
Sass::Compiler#on_updating_stylesheet callback is deprecated and will be removed in a future release. Use Sass::Compiler#on_updated_stylesheet instead, which is
run after stylesheet compilation.
>>> Sass is watching for changes. Press Ctrl-C to stop.
error src/main/www/css/test.scss (Line 3690: Invalid CSS after "...'); IE6 & IE7*": expected "{", was "/")
error src/main/www/css/test.scss (Line 80: Invalid CSS after "...unimplemented *": expected "{", was "/")
d:/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.11/vendor/fssm/lib/fssm/support.rb:40: Use RbConfig instead of obsolete and deprecated Config.
(yes i have an intended error in my scss file to produce logs)
found it thanks to default ruby arguments in intellij ruby projects
you need to pass ruby the following options :
-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
and that did the trick
Program : D:\ruby\bin\ruby.exe
Parameters : -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) d:/ruby/bin/sass -g --watch $/FileRelativeDir$
Working directory : $ProjectFileDir$