How to enable ngx_stream_core_module in Yocto - nginx

I tried to enable ngx_stream_core_module by adding following code in nginx.inc
do_configure () {
--with-stream=dynamic
}
FILES_${PN} += "${PN}/*"
SYSROOT_DIRS += "${PN}/"
but compiling error happens,
nginx: Files/directories were installed but not shipped in any package:
/usr/modules/ngx_stream_module.so
and I am sure ngx_stream_module.so is generated in nginx/1.12.2-r0/package/usr/modules/.
Can anyone give me some ideas?

In FILES_${PN} you should reference the installation path of the installed files and the files themselves (the latter can be substituted by a wildcard) within a package. As follows:
FILES_${PN} += "/usr/modules/*"
Check out https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-FILES
Furthermore, you should point out to the YP version you're using, as well as the meta-layer that contains your nginx recipe.
PD: It is a bad practice to modify the *.inc or the *.bb of a recipe from a third party layer, write a *.bbappend on your own layer instead.

Related

How to disable specific plugins for generated source code in sbt? [duplicate]

I generate code with the scalaxb-sbt plugin that, when compiled, generates a good number of warning messages. Is there any way to hide compilation warnings for generated code or by package?
The silencer compiler plugin allows to suppress compiler warnings. It supports filtering out files by path. This will filter out all generated files from warnings:
scalacOptions += "-P:silencer:pathFilters=src_managed"
For Scala 2.12.13+ or 2.13.2+
Recent versions of the Scala compiler integrate the silencer plugin, see configurable warnings.
So now you don't need any plugin, just add the following line to build.sbt:
ThisBuild / scalacOptions += "-Wconf:src=src_managed/.*:silent"
Using this option will suppress warnings for generated code that lives under a directory called src_managed anywhere in your source tree.
This solved my problem with code generated by zio-grpc, where the compiler emitted warnings like parameter value evidence$3 in method live is never used (adding this info only for better searchability).
In your sbt console you could try the following:
set logLevel in compile := Level.Error or eventually set logLevel in sourceGenerators := Level.Error
and experiment with different settings. Once you are happy you could apply this setting in your build.sbt.
More detailed information can be found in the sbt documentation: http://www.scala-sbt.org/release/docs/Howto/logging.html
I found that I needed to do set logLevel in Compile := Level.Error in my sbt console session in order for this to work. This is with a capital C in Compile. This is with sbt version 0.13.11. This is also to turn all warnings off, though.
Put the code in a subproject, and set scalacOptions differently in that project? Whether this will work depends on whether the support even exists in scalac for suppressing the particular kind of warning you are getting. See for example https://issues.scala-lang.org/browse/SI-1781 . What kind of warnings are you needing to suppress exactly? Certain warnings like unchecked warnings can be suppressed with e.g. #unchecked without having to do the subproject thing.

QT: No rule to make target 'res/resources.qrc'

I've switched versions of QT (from 5.10.1 to 5.12.2) to get a more recent version of Mingw32 (from GCC/G++ 5.3 -> 7.3). The reasoning behind this is that have multiple products using the same library and using an old version of gcc is less than ideal. We've never had any issues with build before, but now I get the following error:
":-1: error: No rule to make target 'res/resources.qrc', needed by 'release/qrc_resources.cpp'. Stop."
Oddly enough, it does not stop the build from generating a completely functioning executable.
So far I've tried:
Cleaning the directory and building again
Deleting the build directory and building again
Not selecting shadow build option
Forcing Qmake (Build -> Run Qmake)
Creating a new .pro.user file
Deleting the whole repo, cloning it again, rebuilding the dependencies (we have a library which it relies on) and rebuilding QT
Adding the .qrc file to the includes (I know this was silly, but I was at my wits end)
Checking for deleted files (None that I can see)
Checking file names for inconsistencies(They seem ok)
Here is my qrc file
<RCC>
<qresource prefix="/">
<file>images/cnctbtn_connected.png</file>
<file>images/cnctbtn_connecting.png</file>
<file>images/cnctbtn_disconnected.png</file>
<file>images/configbtn.png</file>
<file>images/flash.png</file>
<file>images/logbtn.png</file>
<file>images/streambtn_start.png</file>
<file>images/streambtn_stop.png</file>
<file>images/d_logo_outlined.ico</file>
<file>images/d_logo_small.png</file>
<file>images/d_logo_small_outlined.png</file>
</qresource>
</RCC>
The list of resources which are located in the images folder
cnctbtn_connected.png
cnctbtn_connecting.png
cnctbtn_disconnected.png
configbtn.png
d_logo_small.png
d_logo_small_outlined.png
flash.png
logbtn.png
streambtn_start.png
streambtn_stop.png
d_logo_outlined.ico
The qrc_resource_File.cpp also looks ok. I see the bytes of the images in it, their names and assorted namespace declarations and functions in that name space.
The one thing I'm unsure of is why the images folder has it's on name in the resource name list.
Note: I've removed the bytes in this array, for my eyes and yours.
static const unsigned char qt_resource_name[] = {
// images
// cnctbtn_disconnected.png
// cnctbtn_connected.png
// cnctbtn_connecting.png
// streambtn_start.png
// d_logo_outlined.ico
// d_logo_small.png
// streambtn_stop.png
// d_logo_small_outlined.png
};
Ideally there would be no build error, which I don't really understand since I can see and use the executable produced. If you need any other information, don't hesitate to ask!

Problems with libraries in premake

I have experienced certain problems when using libraries in premake4 scripts.
1) When creating a shared library (.dll) on Windows 10 using a premake4 script, it creates the dll fine, but it also creates a static library of small size (2K).
In my case, I was creating a shared library named MathLib.dll using a premake4 script. It did that correctly, but it also created a file named libMathLib.a of size 2K. (It may be empty.)
I don't see why there was a need for the Makefile generated by premake4 to create libMathLib.a, when in fact the objective was to create a .dll file. I think this may be a premake4 bug and I have raised it on the premake4 Issue tracker on github.
The premake4 lua script is as follows:
-- Dir : Files > C > SW > Applications > Samples >
-- premakeSamples > premake-sharedlib-create
--#!lua
-- A solution contains projects,
-- and defines the available configurations
solution "MathLib"
configurations { "Debug", "Release" }
-- A project defines one build target
project "MathLib"
kind "SharedLib"
language "C++"
files { "**.h", "**.cpp" }
includedirs {"../../../ProgramLibraries/Headers/"}
-- Create target library in Files > C > SW >
-- Applications > ProgramLibraries
targetdir "../../../ProgramLibraries/"
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
-- Register the "runmakefile" action.
newaction
{
trigger = "runmakefile",
description = "run the generated makefile to create the executable using the default ('debug' config)",
execute = function()
os.execute("make")
end
}
-- Register the "runmakefilerelease" action.
newaction
{
trigger = "runmakefilerelease",
description = "run the generated makefile to create the executable using the 'release' config)",
execute = function()
os.execute("make config=release")
end
}
2) The above problem is more serious than it sounds. Supposing I had already created a genuine static library named libMathLib.a in the Libraries dir, using a separate premake4 script. Subsequently, if I also create a shared library named MathLib.dll in the same directory as the static library, a dummy static library (possibly empty) would be created and replace the earlier genuine static library.
3) -- EDIT -- : I had reported this point (use of a static library) as a problem, but it has started working now. I don't know the reason, but the only difference, as far as I am aware, is that I had shut down and restarted my PC (and therefore my MSYS session on Windows 10). Therefore I am deleting this point.
How can I solve the above 2 problems?
That's the import library. You can turn it off with Premake's NoImportLib flag.
flags { "NoImportLib" }

Clang with Xcode 4 error: invalide option nodistribute

I have been trying to get clang's analysis tool working, but I am not sure how to overcome a particular error when I run it. I have installed X-Code 4.0 and iOS 5 the output I get is:
Generating class dependency graph.
Launching /Users//Desktop/HomeWork2/tools/AnalysisTool.app/Contents/Resources/llvm/utils/scan-build with arguments: (
"-o",
"/Users/<homedir>/Development/myApp/Static analysis/results",
"-v",
"--status-bugs",
"-checker-cfref",
"-warn-dead-stores",
"-warn-objc-methodsigs",
"-warn-objc-missing-dealloc",
"-warn-objc-unused-ivars",
"-analysistool-checker-access-control",
"-analysistool-checker-coersions",
"-analysistool-checker-cyclomatic-complexity",
"-analysistool-checker-conditional-logical-complexity",
"-analysistool-checker-conditional-nesting-depth",
"-analysistool-checker-loop-nesting-depth",
"-analysistool-checker-dealloc-safety",
"-analysistool-checker-declaration-conventions",
"-analysistool-checker-discouraged-method-calls",
"-analysistool-checker-error-handling",
"-analysistool-checker-extra-parentheses",
"-analysistool-checker-finalize",
"-analysistool-checker-format-strings",
"-analysistool-checker-kvo",
"-analysistool-checker-memory-management",
"-analysistool-checker-naming-conventions",
"-analysistool-checker-shadow",
"-analysistool-checker-unused-ivars",
"--use-cc=/Developer/usr/bin/llvm-gcc-4.2",
"--use-c++=/Developer/usr/bin/llvm-g++-4.2",
"-generate-class-dependency-graph",
xcodebuild,
"CONFIGURATION_BUILD_DIR=/Users/<homedir>/Development/myApp/Static analysis/build",
"CONFIGURATION_TEMP_DIR=/Users/<homedir>/Development/myApp/Static analysis/build",
"-configuration",
Debug,
clean,
build
).
scan-build: Emitting reports for this run to '/Users//Development/AMMO_SVN_Projects/MobXpo/branches/MobXpo_v12/Static analysis/results/2011-06-30-8'.
scan-build: 'clang-cc' executable not found in '/Users//Desktop/SWEN_646/HW2/tools/AnalysisTool.app/Contents/Resources/llvm/utils/libexec'.
scan-build: Using 'clang-cc' from path.
xcodebuild: error: invalid option '-nodistribute'
Usage: xcodebuild [-project ] [[-target ]...|-alltargets] [-configuration ] [-arch ]... [-sdk [|]] [=]... []...
xcodebuild -workspace -scheme [-configuration ] [-arch ]... [-sdk [|]] [=]... []...
xcodebuild -version [-sdk [|] [] ]
xcodebuild -list [[-project ]|[-workspace ]]
xcodebuild -showsdks
Options:
-usage print full usage
-verbose provide additional status output
-project NAME build the project NAME
-target NAME build the target NAME
-alltargets build all targets
-workspace NAME build the workspace NAME
-scheme NAME build the scheme NAME
-configuration NAME use the build configuration NAME for building each target
-xcconfig PATH apply the build settings defined in the file at PATH as overrides
-arch ARCH build each target for the architecture ARCH; this will override architectures defined in the project
-sdk SDK use SDK as the name or path of the base SDK when building the project
-parallelizeTargets build independent targets in parallel
-jobs NUMBER specify the maximum number of concurrent build operations
-showsdks display a compact list of the installed SDKs
-list lists the targets and configurations in a project, or the schemes in a workspace
-find BINARY display the full path to BINARY in the provided SDK
-version display the version of Xcode; with -sdk will display info about one or all installed SDKs
I have researched the internet but I have found nothing to help my specific problem. I think what i need to do is edit the clang tool to not include the "nodistribute" option, but im not sure if there is another way or where to get the source code to do so. Thanks in advance for any help.
I found a way around this after a lot of looking for an answer I decided to see if I could modify the line of code that was including the -nodistribute option. So I used grep to find the line of code in the .app bundle and then opened it in vi. I added a comment # to the line and bingo, off to the races.
The file, relative to the app bundle root is found at: ./Resources/llvm/utils/scan-build

Version information on Xserver modules

I am trying to find a tool that will extract the module version information (a part of the module record) fron an Xserver module. For example, in the Xorg logs I can see the following information for the librecord module in my Xorg.0.log file...
[ 39.892] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 39.905] (II) Module record: vendor="X.Org Foundation"
[ 39.905] compiled for 1.9.0, module version = 1.13.0
[ 39.905] Module class: X.Org Server Extension
[ 39.905] ABI class: X.Org Server Extension, version 4.0
Is there a tools that would allow me to easily extract the aforementioned information. Sometimes you can use modinfo on the module and that will have version information, but that does not always work. The only consistent way I know of now is to parse the xorg log file. Thanks.
Yes, there is and you can also try to write a small one.
http://gitorious.org/xdriverprobe
The problem is that xdriverprobe won't compile on newer servers since I didn't update it to the newest ABIs. Also, xdriverprobe is only used for video drivers, but it can be adapted to be used on other modules. The main source code file (xdriverprobe.c) has less than 500 lines, so you can easily learn by reading it.
It works in Ubuntu 11.10... ./xdriverprobe -o moduledata gives the information you want.
Look at its source code. It does:
dlopen() the module
find a symbol called modulenameModuleData (if your module is called modulename)
that symbol is a XF86ModuleData* See /usr/include/xorg/xf86Module.h
check its member named vers
Spend a few hours and you'll be able to write a very tiny code that does what you want.
More information: http://www.xfree86.org/current/DESIGN17.html#65 (very old document, but most of what's written there is still true today). If you're not happy with that document, you have to read the Xorg source code.
Happy hacking!

Resources