android aosp unrecognized module type "hidl_package_root" - android-emulator

I am trying to build the AOSP automotive car emulator, I am receiving the following error
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
TARGET_PRODUCT=aosp_car_x86_64
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=x86_64
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=x86_64
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-18.6.0-x86_64-10.14.5
HOST_BUILD_TYPE=release
BUILD_ID=PD2A.190115.032
OUT_DIR=out
============================================
ninja: no work to do.
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
error: frameworks/hardware/interfaces/Android.bp:1:1: unrecognized module type "hidl_package_root"
error: hardware/nxp/nfc/extns/intf/nxpnfc/1.0/Android.bp:3:1: unrecognized module type "hidl_package_root"
error: hardware/nxp/nfc/extns/intf/nxpnfc/1.0/Android.bp:8:1: unrecognized module type "hidl_interface"
error: frameworks/hardware/interfaces/displayservice/1.0/Android.bp:3:1: unrecognized module type "hidl_interface"
error: frameworks/hardware/interfaces/schedulerservice/1.0/Android.bp:3:1: unrecognized module type "hidl_interface"
error: frameworks/hardware/interfaces/vr/composer/1.0/Android.bp:3:1: unrecognized module type "hidl_interface"
error: hardware/nxp/secure_element/extns/intf/nxpese/1.0/Android.bp:3:1: unrecognized module type "hidl_package_root"
error: hardware/nxp/secure_element/extns/intf/nxpese/1.0/Android.bp:8:1: unrecognized module type "hidl_interface"
error: frameworks/hardware/interfaces/sensorservice/1.0/Android.bp:3:1: unrecognized module type "hidl_interface"
error: hardware/google/interfaces/Android.bp:4:1: unrecognized module type "hidl_package_root"
error: hardware/interfaces/Android.bp:1:1: unrecognized module type "hidl_package_root"
ninja: build stopped: subcommand failed.
14:09:59 soong bootstrap failed with: exit status 1
#### failed to build some targets (17 seconds) ####
I have am executing the command make -j32 after which I am receiving this error. I have created a separate disk image as mentioned in the documentation to build the environment for aosp. I am using the Mac Mojave OS.

I encountered the same problem building AOSP, in my case for the Pixel 2 XL with build number PQ3A.190801.002.
I started from scratch, doing the same as before, but more carefully this time. It worked. I didn't take the time to confirm what exactly went wrong, but I strongly suspect I accidentally downloaded the wrong proprietary drivers from here. Since this is also not a common issue at all, it might be the same cause for you

Related

Where can I find the use-package dependecy in Emacs?

The package is not an internal command of Lisp, but you must install it, so I install things such as straight.el, but where can I find the following?
Error (use-package): Failed to parse package multiple-cursors: use-package: Unrecognized keyword: :general
Error (use-package): Cannot load centaur-tabs
Error (use-package): Failed to parse package company: use-package: Unrecognized keyword: :ghook
Error (use-package): Failed to parse package company-box: use-package: Unrecognized keyword: :ghook
Error (use-package): Failed to parse package yasnippet: use-package: Unrecognized keyword: :ghook
Error (use-package): Failed to parse package magit: use-package: Unrecognized keyword: :general
Error (use-package): Failed to parse package git-commit: use-package: Unrecognized keyword: :ghook
Yes, I tried to search for packages ghook and general, but I was unable to find these.
I found a general solution: :ghook and :general are part of this package:
https://github.com/noctuid/general.el

How to build Swift project on NixOS?

I'm trying to build a simple Swift project on NixOS. Here are the steps to reproduce:
git clone https://github.com/PerfectlySoft/PerfectTemplate.git
cd PerfectTemplate
touch shell.nix
Add shell.nix with following contents:
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "swift-env";
buildInputs = [
openssl
stdenv
binutils
cmake
pkgconfig
curl
glibc
icu
libblocksruntime
libbsd
libedit
libuuid
libxml2
ncurses
sqlite
swig
];
}
Running nix-shell --pure shell.nix and from there swift build, gives me:
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: unrecognized command line option ‘-target’
gcc: error: x86_64-unknown-linux: No such file or directory
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: unrecognized command line option ‘-fblocks’
gcc: error: unrecognized command line option ‘-target’
gcc: error: unrecognized command line option ‘-fmodule-name=PerfectCZlib’
gcc: error: unrecognized command line option ‘-fmodules’; did you mean ‘-fmudflap’?
gcc: error: unrecognized command line option ‘-fmodules-cache-path=/home/dmi3y/Dev/Swift/PerfectTemplate/.build/x86_64-unknown-linux/debug/ModuleCache’
gcc: error: unrecognized command line option ‘-fblocks’
I'd appreciate any help with this as I'm pretty much new to nix-shell and NixOS.
EDIT:
I changed my shell.nix to this:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
name = "swift-env";
buildInputs = with pkgs; [
openssl
clang
swift
];
shellHook = ''
CC=clang
'';
}
However, when I run nix-shell followed by swift build, I'm now getting:
[1/25] Compiling PerfectCZlib zutil.c
[2/25] Compiling PerfectCZlib uncompr.c
[3/25] Compiling PerfectCZlib inftrees.c
[4/25] Compiling PerfectCZlib inflate.c
[5/25] Compiling PerfectCZlib trees.c
[6/25] Compiling PerfectCZlib inffast.c
[7/25] Compiling PerfectCZlib infback.c
[8/25] Compiling PerfectCZlib gzwrite.c
/nix/store/iz6k7x3l14ykr56crz3dizas1rrkcyzr-clang-wrapper-7.1.0/resource-root/include/module.modulemap:24:8: error: redefinition of module '_Builtin_intrinsics'
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^
1 warning and 3 errors generated.
1 warning and 3 errors generated.
Full log can be found here.
This is now looks like a missing library dependency or a version conflict.
For the record, here's additional information about my setup that might shed more light:
$ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-19.09
$ nix-shell --run 'swift -version'
Swift version 5.0.2 (swift-5.0.2-RELEASE)
Target: x86_64-unknown-linux-gnub
After searching the web I found a Jira issue for Swift compiler and this specific comment. I decided to exclude clang from dependencies and only include swift, since this combination seem to be conflicting:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
name = "swift-env";
buildInputs = with pkgs; [
openssl
swift
];
shellHook = ''
CC=clang
'';
}
And that worked! I was finally able to build the project!
Since your using the --pure option, nothing from your previous environment will be imported into the shell. This includes the swift binary itself. So first I would add swift to the buildInputs.
The error your getting indicates that gcc doesn't even understand the command line options being passed. I don't know anything about Swift, but after seeing that I assumed that it needs a different compiler. Sure enough, after a quick search it looks like it is llvm based. You will thus need to also add clang to your build inputs. In addition, you'll need to use mkShell instead of mkDerivation to setup the proper environment.
The former is a wrapper to the latter that is specifically designed to set up a nix-shell, and ensures the environment is handled correctly. You'll need to pass in the shellHook attribute to override the default c compiler to clang using the CC envvar. The shellHook is a way of running arbitrary commands at the start of the shell.
As a final note, the nix-shell command searches for shell.nix by default so you don't have to pass it as an argument. If shell.nix does not exist, then it will try default.nix. If neither exist, then you'll have to explicitly specify the nix expressions location.
TLDR
to put it all together:
# a more idiomatic way to import nixpkgs, overridable from the cmdline
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
name = "swift-env";
buildInputs = with pkgs; [
# your other inputs
clang
swift
];
shellHook = ''
CC=clang
'';
}
Just to be sure my logic was correct I downloaded the repo and gave it go. Everything compiles and runs successfully.

SYSTEMD_SERVICE_swupdate value swupdate.service does not exist

I am trying to build swupdate image by running bitbake swupdate-image but getting following errors,
ERROR: swupdate-2019.04-r0 do_package: SYSTEMD_SERVICE_swupdate value swupdate.service does not exist
ERROR: swupdate-2019.04-r0 do_package:
ERROR: swupdate-2019.04-r0 do_package: Function failed: systemd_populate_packages
ERROR: Logfile of failure stored in: /home/panther2/warrior/build/tmp/work/corei7-64-poky-linux/swupdate/2019.04-r0/temp/log.do_package.22017
ERROR: Task (/home/panther2/warrior/sources/meta-swupdate/recipes-support/swupdate/swupdate_2019.04.bb:do_package) failed with exit code '1'
I am building for warrior yocto branch. Error indicates that swupdate.service does not exist but swupdate.service does exist under meta-swupdate/recipes-support/swupdate/swupdate. Any help is really appreciated. Thanks for your time.
swupdate-image is a rescue system - it generates a Ramdisk. Care was taken about footprint - it runs then with SystemV and not with systemd. If you want to buid swupdate-image with systemd as init, add your own swupdate-image.bbappend and rearrange the list of packages.

libwebsockets libuv error: ‘m’ may be used uninitialized in this function

I cross compiled libuv successfully and I'm trying to cross compile libwebsockets but I get the following error in make for arm with a buildroot toolchain.
Please advise.
libwebsockets
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=~/buildroot/output/host/share/buildroot/toolchainfile.cmake \
-DLWS_LIBUV_INCLUDE_DIRS=/tmp/cross/include \
-DLWS_ZLIB_LIBRARIES=/tmp/cross/lib/libuv.so
make
[ 31%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/server.c.o
[ 32%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/lws-spa.c.o
[ 33%] Building C object CMakeFiles/websockets_shared.dir/lib/event-libs/poll/poll.c.o
[ 33%] Building C object CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o
~/libwebsockets/lib/event-libs/libuv/libuv.c: In function ‘elops_destroy_context1_uv’:
~/libwebsockets/lib/event-libs/libuv/libuv.c:526:7: error: ‘m’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (m)
^
cc1: all warnings being treated as errors
CMakeFiles/websockets_shared.dir/build.make:1166: recipe for target 'CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o' failed
make[2]: *** [CMakeFiles/websockets_shared.dir/lib/event-libs/libuv/libuv.c.o] Error 1
CMakeFiles/Makefile2:363: recipe for target 'CMakeFiles/websockets_shared.dir/all' failed
make[1]: *** [CMakeFiles/websockets_shared.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
Why are you building libwebsockets manually, instead of using the libwebsockets package that we have in Buildroot ?

FIWARE- Orion Context Broker

I tried to install Orion context Broker on Ubuntu 14.04 with Alien but when I do contextBroker start it says:
contextBroker: error while loading shared libraries: libboost_thread-mt.so.5: cannot open shared object file: No such file or directory
I couldn't find where is the error then I tried to install with all the dependencies from the instructions in Git, but when I try to do the make it makes an error:
[ 26%] Building CXX object src/lib/serviceRoutines/CMakeFiles/serviceRoutines.dir/exitTreat.cpp.o
In file included from /home/sistemas/fiware-orion-develop/src/lib/serviceRoutines/exitTreat.cpp:32:0:
/home/sistemas/fiware-orion-develop/src/lib/mongoBackend/MongoGlobal.h:30:35: fatal error: mongo/client/dbclient.h: No existe el archivo o el directorio
#include "mongo/client/dbclient.h"
I have the mongo's driver installed, how can I solve this?
Finally I compile a new driver from https://github.com/mongodb/mongo-cxx-driver/releases and it continues compiling until:
*
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void recoverOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:532:40: error: ‘class mongo::OID’ has no member named ‘str’
std::string subId = idField.OID().str();
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void destroyOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:583:40: error: ‘class mongo::OID’ has no member named ‘str’
std::string subId = idField.OID().str();
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void releaseTriggeredSubscriptions(std::map<std::basic_string<char>, TriggeredSubscription*>&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: error: ‘string’ was not declared in this scope
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: note: suggested alternative:
In file included from /usr/include/c++/4.9/iosfwd:39:0,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:49,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/mongo/client/dbclient_rs.h:20,
from /usr/include/mongo/client/dbclient.h:59,
from /home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:27:
/usr/include/c++/4.9/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 1 is invalid
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 3 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 4 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: invalid type in declaration before ‘it’
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: expected ‘;’ before ‘it’
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: ‘it’ was not declared in this scope
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:94: error: expected ‘)’ before ‘;’ token
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:50: error: unused variable ‘iterator’ [-Werror=unused-variable]
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:98: error: ‘it’ was not declared in this scope
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
cc1plus: all warnings being treated as errors
make[3]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/MongoGlobal.cpp.o] Error 1
make[3]: se sale del directorio «/home/sistemas/fiware-orion/BUILD_RELEASE»
make[2]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/all] Error 2
make[2]: *** Se espera a que terminen otras tareas....
[ 88%] Building CXX object src/lib/xmlParse/CMakeFiles/xmlParse.dir/xmlRegisterProviderRequest.cpp.o
*
Is a problem in a file of Orion Context Broker?
I think that it could be a problem with de mongo's driver again but I try to install another one older and it doesn't work. I also think it can be a problem with de -mt libraries that doesn't exist in boost anymore, but nothing that I try until now works.
I've installed Orion CB using Ubuntu 14.04 LTS as host. I've also found some problems with libboost_thread-mt.so libraries. Solved this way:
Get & install packages
boost-thread-1.41.0-25.el6.x86_64.rpm
boost-system-1.41.0-25.el6.x86_64.rpm
boost-filesystem-1.41.0-25.el6.x86_64.rpm
and install them using alien. Then, the libraries were installed in “/usr/lib64” folder. To correct this (and CB is able to locate them): create a .conf file within “/etc/ld.so.conf.d/”, add a line (“/usr/lib64”) within and save it and quit and reload your configuration by calling (“sudo ldconfig”)
Hope this helps
So, here we have two questions in one. Let's start with the first one, about shared library not found:
Ask the broker where the library should be, using "ldd $(which contextBroker) | grep boost_thread).
After running this command, make sure the library is there. If it is not, but you have it elsewhere, you should be able to use the env var LD_LIBRARY_PATH to point to the directory where the library is found.
Now, for the second question, the mongo driver includes are not found. In my machine, I have them in /usr/local/include/mongo => I'm ok with the -I/usr/local/include directive to the compiler.
If you have your mongo driver installed elsewhere, you might need to add another 'include-directory' for the compilation. This would be done in the top-level CMakeLists.txt (I guess using 'include_directories' - I'm far from a cmake expert :-)).
When building, to see detailed information, compile like this:
% CPU_COUNT=1 VERBOSE=1 make install
Post the info again here unless you manage to solve your problems.