Kitties tutorial part 1 build is failing with unresolved import for sc_client_api RemoteBackend, anyone faced this issue? - rust

I just followed the tutorial, I am at the first
cargo build --release
This is the error I am getting, any idea why this would happen?
error[E0432]: unresolved import `sc_client_api::RemoteBackend`
--> node/src/service.rs:4:39
|
4 | use sc_client_api::{ExecutorProvider, RemoteBackend};
| ^^^^^^^^^^^^^
| |
| no `RemoteBackend` in the root
| help: a similar name exists in the module: `StateBackend`

I solved this by removing RemoteBackend from the import at node/src/service.rs.
Just change the line (for me it was Line 4) at node/src/service.rs from
use sc_client_api::{ExecutorProvider, RemoteBackend};
to
use sc_client_api::ExecutorProvider;
While working with the tutorial cargo build --release resulted in the following error message:
error[E0432]: unresolved import `sc_client_api::RemoteBackend`
--> node/src/service.rs:4:39
|
4 | use sc_client_api::{ExecutorProvider, RemoteBackend};
| ^^^^^^^^^^^^^
| |
| no `RemoteBackend` in the root
| help: a similar name exists in the module: `StateBackend`
The help message provided some clue as to what was happening. Checking the node/src/service.rs file, I found that RemoteBackend was never referenced anywhere else in the file. So I simply removed it from the imports, and the build process was completed successfully.

Related

Unable to compile X11 with bitbake

I've added
DISTRO_FEATURES_append = " x11"
to my local.conf as I will need access to Xrandr (which depends on X11). As soon as I add x11 to the DISTRO_FEATURES, I keep getting the following when invoking bitbake:
| checking for GLAMOR... yes
| checking for GBM... no
| configure: error: Glamor for Xorg requires gbm >= 10.2.0
| NOTE: The following config.log files may provide further information.
| NOTE: /home/yocto/rzg_vlp_v3.0.0/build/tmp/work/aarch64-poky-linux/xserver-xorg/2_1.20.8-r0/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/yocto/rzg_vlp_v3.0.0/build/tmp/work/aarch64-poky-linux/xserver-xorg/2_1.20.8-r0/temp/run.do_configure.143696' failed with exit code 1
ERROR: Task (/home/yocto/rzg_vlp_v3.0.0/build/../poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.20.8.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4840 tasks of which 4796 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/yocto/rzg_vlp_v3.0.0/build/../poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.20.8.bb:do_configure
libgbm on openembedded.org appears to be at version 10.0 only: https://layers.openembedded.org/layerindex/recipe/131409/
How can I get this resolved?
One way to fix it is to change the xserver-xorg's PACKAGECONFIG and remove the need for GBM.
Looking at the poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc, GBM is only mentioned in this line:
PACKAGECONFIG[glamor] = "--enable-glamor,--disable-glamor,libepoxy virtual/libgbm,libegl"
Sadly, just removing the virtual/libgbm is not enough and you also need to disable glamor completely while keeping the libepoxy package.
So I suggest you create a xserver-xorg_1.20.8.bbappend file which the following content:
PACKAGECONFIG[glamor] = "--disable-glamor,--disable-glamor,libepoxy,libegl"
I know it is a hack. But it fixes your issue

unresolved import `crate::sys` on rust project building

I am working on the Solana contract with rust language.
When I execute cargo build, it returns ok result.
But when I execute cargo +bpf build --target bpfel-unknown-unknown --release, it returns below the error console.
error[E0432]: unresolved import `crate::sys`
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.2/src/sockaddr.rs:5:12
|
5 | use crate::sys::{
| ^^^
| |
| unresolved import
| help: a similar path exists: `crate::socket::io::sys`
error[E0432]: unresolved imports `crate::sys`, `crate::sys`
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.2/src/socket.rs:21:12
|
21 | use crate::sys::{self, c_int, getsockopt, setsockopt, Bool};
| ^^^ ^^^^ no `sys` in the root
| |
| unresolved import
| help: a similar path exists: `crate::socket::io::sys`
...
Please let me know if you faced this kinda issue before.
On-chain programs are limited in what resources they can access. For example, you can't access the internet or filesystem. Your program seems to be relying on some of these forbidden packages.
Here's more info from the documentation about using rand, which is also not allowed: https://docs.solana.com/developing/on-chain-programs/developing-rust#depending-on-rand

nginx audio track for hls module installation

I started to configure a setup with nginx audio track module and I encountered a few problems.
First of all, I started from the official documentation.
I followed the requirements and installed ffmpeg.
As far as I can see, the available libs are:
/usr/lib/x86_64-linux-gnu/libavformat.so.58
/usr/lib/x86_64-linux-gnu/libavutil.so.56
/usr/lib/x86_64-linux-gnu/libavcodec.so.58
When I run make install the following output is generated:
/root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.c: In function ‘ngx_http_aac_extract_audio’:
/root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.c:156:5: error: ‘av_register_all’ is deprecated [-Werror=deprecated-declarations]
156 | av_register_all();
| ^~~~~~~~~~~~~~~
In file included from /root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.h:6,
from /root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.c:1:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:2050:6: note: declared here
2050 | void av_register_all(void);
| ^~~~~~~~~~~~~~~
/root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.c:210:5: error: ‘avcodec_copy_context’ is deprecated [-Werror=deprecated-declarations]
210 | avcodec_copy_context(output_audio_stream->codec, input_audio_stream->codec);
| ^~~~~~~~~~~~~~~~~~~~
In file included from /root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.h:5,
from /root/dev/nginx-audio-track-for-hls-module/ngx_http_aac_module.c:1:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4235:5: note: declared here
4235 | int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
This is only a short sample, there are many with the same error message.

Error on installing RISCV toolchain on Ubuntu 20.10

I am trying to install riscv-toolchain on ubuntu 20.10. I got the error while .buidl.sh executes
Configuring project riscv-isa-sim
Building project riscv-isa-sim
./fesvr/dtm.cc: In member function ‘uint32_t dtm_t::get_xlen()’:
../fesvr/dtm.cc:488:16: error: ‘runtime_error’ is not a member of ‘std’
488 | throw std::runtime_error("FESVR DTM Does not support 128-bit");
| ^~~~~~~~~~~~~
../fesvr/dtm.cc:505:14: error: ‘runtime_error’ is not a member of ‘std’
505 | throw std::runtime_error("FESVR DTM can't determine XLEN. Aborting");
| ^~~~~~~~~~~~~
../fesvr/dtm.cc:506:1: warning: control reaches end of non-void function [-Wreturn-type]
506 | }
| ^
std::runtime_error is defined in stdexcept. normally you are missing #include <stdexcept>. However normally, this modification was done in the riscv-isa-sim 7 months ago. you are probably not using the last version.

Is it possible that aws-sdk/dynamoose causes an SQLite syntax error on DynamoDB local?

Context:
Problem found while upgrading from Nodejs 6 to 12 and with that the project's dependencies.
Using dynamoose 2.3
Containerized application using docker-compose: backend and dynamodb instance only
Docker file for dynamodb:
FROM openjdk:latest
\# Bundle dynamodb
COPY . .
EXPOSE 8000
CMD [ "java", "-jar", "DynamoDBLocal.jar" ]
Problem: when lifting up the containers, after the backend initializes the dynamodb instance throws the errors below, causing any subsequent query or call to stall and return on timeout on the backend's side.
Error:
dynamodb_1 | Sep 03, 2020 8:14:36 AM com.almworks.sqlite4java.Internal log
dynamodb_1 | WARNING: [sqlite] SQLiteDBAccess$10#b6f156c: job exception
dynamodb_1 | com.almworks.sqlite4java.SQLiteException: [1] DB[1] prepare() DROP INDEX Foobar*HVI; [near "*": syntax error]
dynamodb_1 | at com.almworks.sqlite4java.SQLiteConnection.throwResult(SQLiteConnection.java:1436)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteConnection.prepare(SQLiteConnection.java:580)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteConnection.prepare(SQLiteConnection.java:635)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteConnection.prepare(SQLiteConnection.java:622)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.AmazonDynamoDBOfflineSQLiteJob.getPreparedStatement(AmazonDynamoDBOfflineSQLiteJob.java:138)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.SQLiteDBAccess$10.dropGSISQLiteIndex(SQLiteDBAccess.java:1221)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.SQLiteDBAccess$10.dropIndices(SQLiteDBAccess.java:1169)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.SQLiteDBAccess$10.doWork(SQLiteDBAccess.java:1155)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.SQLiteDBAccess$10.doWork(SQLiteDBAccess.java:1152)
dynamodb_1 | at com.amazonaws.services.dynamodbv2.local.shared.access.sqlite.AmazonDynamoDBOfflineSQLiteJob.job(AmazonDynamoDBOfflineSQLiteJob.java:97)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteJob.execute(SQLiteJob.java:372)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteQueue.executeJob(SQLiteQueue.java:534)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:667)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
dynamodb_1 | at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
dynamodb_1 | at java.base/java.lang.Thread.run(Thread.java:832)
I suspect this is happening when creating the tables through Dynamoose's model() which under the hood calls aws' DynamoDB createTable method.
I'm currently just analysing the upgrade to nodejs 12 and dynamoose 2.3. In local I would prefer to have it run to test other parts of the project, so I don't mind updating indexes and recreating tables, but wish to know where this syntax error is coming from to fix it and carry on.
Question: Is it possible that the aws-sdk or dynamoose cause a DynamoDB local instance to attempt to drop an index with an SQLite syntax error?
The problem is that Dynamoose 0.8.7 used to support Schemas with attributes that were both hashkey and had an index marked as global. When jumping to the latest version, some breaking changes made it add characters like '*' to their queries and thus making SQLite complain.
Example:
const FoobarSchema = new dynamoose.Schema({
foo: {
type: String,
hashkey: true,
index: {
global:true
}
}
});
const Foobar = dynamoose.model('Foobar', FoobarSchema, Options); // Blow up
I'm new to the project and DynamoDb. I don't understand what was the reasoning behind having those two conditions together and whether it should be supported or not. I'll dig deeper into this when I have the chance and update this.
Deleting the "shared-local-instance.db" file in my "docker/dynamodb" folder resolved the issue for me (the file is generated again on docker-compose up and everything runs fine)

Resources