Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The built fnn binary command cannot be used #376

Open
guomaoqiu opened this issue Dec 6, 2024 · 13 comments
Open

The built fnn binary command cannot be used #376

guomaoqiu opened this issue Dec 6, 2024 · 13 comments

Comments

@guomaoqiu
Copy link

guomaoqiu commented Dec 6, 2024

build step warning:

# cargo build
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................
..........................................................

   Compiling fnn v0.1.0 (/tmp/cc/fiber)
warning: unexpected `cfg` condition name: `release`
  --> src/rpc/mod.rs:36:15
   |
36 |     #[cfg(not(release))]
   |               ^^^^^^^
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(release)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(release)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `release`
  --> src/rpc/mod.rs:59:11
   |
59 |     #[cfg(release)]
   |           ^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(release)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(release)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: field `0` is never read
    --> src/fiber/channel.rs:2848:21
     |
2848 |     PendingShutdown(ShuttingDownFlags),
     |     --------------- ^^^^^^^^^^^^^^^^^
     |     |
     |     field in this variant
     |
     = note: `CommitmentSignedFlags` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
     = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
     |
2848 |     PendingShutdown(()),
     |                     ~~

warning: methods `expensive` and `can_resume` are never used
   --> src/store/migration.rs:159:8
    |
146 | pub trait Migration: Send + Sync {
    |           --------- methods in this trait
...
159 |     fn expensive(&self) -> bool {
    |        ^^^^^^^^^
...
171 |     fn can_resume(&self) -> bool {
    |        ^^^^^^^^^^

warning: `fnn` (lib) generated 4 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 51.68s

version:

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# uname -a
Linux ip-10-10-10-10 5.19.0-1028-aws #29~22.04.1-Ubuntu SMP Tue Jun 20 19:12:11 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# cargo --version
cargo 1.81.0 (2dbb1af80 2024-08-20)
root@ip-10-10-10-10:/tmp/cc/fiber/tmp# rustc --version
rustc 1.81.0 (eeb90cda1 2024-09-04)

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# apt install libsnappy-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libsnappy-dev is already the newest version (1.1.8-1build3).
The following packages were automatically installed and are no longer required:
  libssh2-1 libstd-rust-1.75 libstd-rust-dev rustc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.

start error :

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# ./fnn -c testnet-fnn/node1/config.yml -d testnet-fnn/node1
Error: Exit because Not implemented: Unsupported compression method for this build: Snappy

How can I solve this error?

In addition, can you provide a docker version to save users from compiling by themselves?

@contrun
Copy link
Collaborator

contrun commented Dec 6, 2024

I think you have to install libsnappy1v5. libsnappy-dev only contains the files like header files for development. Can you run apt install libsnappy1v5 and see if that works?

@guomaoqiu
Copy link
Author

guomaoqiu commented Dec 6, 2024

I think you have to install libsnappy1v5. libsnappy-dev only contains the files like header files for development. Can you run apt install libsnappy1v5 and see if that works?

Thanks for your reply,

It says it has been installed:

root@ip-10-10-10-10:/tmp/cc/fiber# apt-get install libsnappy1v5 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libsnappy1v5 is already the newest version (1.1.8-1build3).
The following packages were automatically installed and are no longer required:
  libssh2-1 libstd-rust-1.75 libstd-rust-dev rustc
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
root@ip-10-10-10-10:/tmp/cc/fiber#

image

@quake
Copy link
Member

quake commented Dec 6, 2024 via email

@chenyukang
Copy link
Collaborator

It's weird, we are using lz4 for compression, not snappy.
https://github.com/nervosnetwork/fiber/blob/main/Cargo.toml#L33

@chenyukang
Copy link
Collaborator

seems you changed rust-toolchain.toml from 1.76.0 to 1.83.0 ,
we haven't tested for new rust version.

do you mind to have a try without change rust version in rust-toolchain.toml?
I'm not sure about the root cause of failure fro snappy, I used a Linux to build fiber, seems it did not require snappy.

@guomaoqiu
Copy link
Author

Please try to recompile after lib installation

On Fri, Dec 6, 2024, 23:53 NoardGuo @.> wrote: I think you have to install libsnappy1v5. libsnappy-dev only contains the files like header files for development. Can you run apt install libsnappy1v5 and see if that works? Thanks for your reply, It says it has been installed: @.:/tmp/cc/fiber# apt-get install libsnappy1v5 -y Reading package lists... Done Building dependency tree... Done Reading state information... Done libsnappy1v5 is already the newest version (1.1.8-1build3). The following packages were automatically installed and are no longer required: libssh2-1 libstd-rust-1.75 libstd-rust-dev rustc Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded. @.:/tmp/cc/fiber# — Reply to this email directly, view it on GitHub <#376 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACGHVEJXV3PLWKZN7ZY7D2EG3ANAVCNFSM6AAAAABTETXRJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRTGQZDKNJRGA . You are receiving this because you are subscribed to this thread.Message ID: @.>

The above result is the result of installing lib

@guomaoqiu
Copy link
Author

guomaoqiu commented Dec 7, 2024

seems you changed rust-toolchain.toml from 1.76.0 to 1.83.0 , we haven't tested for new rust version.

do you mind to have a try without change rust version in rust-toolchain.toml? I'm not sure about the root cause of failure fro snappy, I used a Linux to build fiber, seems it did not require snappy.

I changed the version number to 1.83.0, but it still doesn't work.

@guomaoqiu
Copy link
Author

What operating system do you use for compilation? Can you package and provide a complete compilation environment docker container for us to use?

For example, after I get the code, I mount it into the docker container for compilation.

The advantage of doing this is that it will not cause various problems for different compilation environments for each person, and a unified compilation environment will be used.

@chenyukang
Copy link
Collaborator

seems you changed rust-toolchain.toml from 1.76.0 to 1.83.0 , we haven't tested for new rust version.
do you mind to have a try without change rust version in rust-toolchain.toml? I'm not sure about the root cause of failure fro snappy, I used a Linux to build fiber, seems it did not require snappy.

I changed the version number to 1.83.0, but it still doesn't work.

I mean you should not change version to 1.83.0, just don't change rust-toolchain.toml, we are using 1.76.0, we haven't tested on new rust version.

@chenyukang
Copy link
Collaborator

I notice you are run with this command line:

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# ./fnn -c testnet-fnn/node1/config.yml -d testnet-fnn/node1

How the directory testnet-fnn/node1 comes from? I guess you're using old db file generated by old version of fiber.

After this commit, we will not include 'snappy' as compression method: d41348e#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L33

Please follow this instruction to start from a new database directory: https://github.com/nervosnetwork/fiber?tab=readme-ov-file#build-and-run-a-testnet-node

@Flouse
Copy link
Contributor

Flouse commented Dec 8, 2024

can you provide a docker version

Maybe the built image provided by this repo might help.
You could have https://github.com/Flouse/ckb-fiber-docker a try.

export FIBER_IMAGE=ghcr.io/flouse/ckb-fiber:fiber-commit-d72a274c30d89b50f668e3b04b594195102f387e-ckb-cli-v1.12.0

docker run --rm ${FIBER_IMAGE} ckb-cli --version
# Output: ckb-cli 1.12.0 (278c7be 2024-09-20)

docker run --rm ${FIBER_IMAGE}
# Ouptut: fnn 0.1.0

# Usage
docker run --rm ${FIBER_IMAGE} fnn --help

@guomaoqiu
Copy link
Author

I notice you are run with this command line:

root@ip-10-10-10-10:/tmp/cc/fiber/tmp# ./fnn -c testnet-fnn/node1/config.yml -d testnet-fnn/node1

How the directory testnet-fnn/node1 comes from? I guess you're using old db file generated by old version of fiber.

After this commit, we will not include 'snappy' as compression method: d41348e#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L33

Please follow this instruction to start from a new database directory: https://github.com/nervosnetwork/fiber?tab=readme-ov-file#build-and-run-a-testnet-node

I tried it, and after I cleared the data directory again, it ran normally. But I would like to ask, after cleaning the saved data, will restarting fnn affect the previous use?
image

@guomaoqiu
Copy link
Author

can you provide a docker version

Maybe the built image provided by this repo might help. You could have https://github.com/Flouse/ckb-fiber-docker a try.

export FIBER_IMAGE=ghcr.io/flouse/ckb-fiber:fiber-commit-d72a274c30d89b50f668e3b04b594195102f387e-ckb-cli-v1.12.0

docker run --rm ${FIBER_IMAGE} ckb-cli --version
# Output: ckb-cli 1.12.0 (278c7be 2024-09-20)

docker run --rm ${FIBER_IMAGE}
# Ouptut: fnn 0.1.0

# Usage
docker run --rm ${FIBER_IMAGE} fnn --help

Thank you very much. It is more convenient to deploy through the method you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants