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

method not found in ScmpFilterContext #486

Open
Wangyiwei-So opened this issue Feb 19, 2024 · 11 comments
Open

method not found in ScmpFilterContext #486

Wangyiwei-So opened this issue Feb 19, 2024 · 11 comments

Comments

@Wangyiwei-So
Copy link

I try to compile runwasi in ubuntu:
I tried ubuntu:23.10 container:

uname -a
Linux 004aed56de46 6.7.0-arch3-1 #1 SMP PREEMPT_DYNAMIC Sat, 13 Jan 2024 14:37:14 +0000 x86_64 x86_64 x86_64 GNU/Linux

and a ubuntu:20 machine

uname -a
Linux test 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I installed dependencies

apt-get install -y build-essential
apt-get install -y protobuf-compiler
apt-get install -y libseccomp-dev

and got this message

make build FEATURES=wasmedge
error[E0599]: no method named `get_notify_fd` found for struct `ScmpFilterContext` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libcontainer-0.3.0/src/seccomp/mod.rs:270:17
    |
270 |             ctx.get_notify_fd()
    |                 ^^^^^^^^^^^^^ method not found in `ScmpFilterContext`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `libcontainer` (lib) due to previous error
@utam0k
Copy link
Member

utam0k commented Feb 19, 2024

May I ask you to make sure that you installed libseccomp-dev 2.5+.

@Wangyiwei-So
Copy link
Author

May I ask you to make sure that you installed libseccomp-dev 2.5+.

thank you for your reply!

yes, 2.5.4 has been installed

apt-get install -y libseccomp-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libseccomp-dev is already the newest version (2.5.4-1ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

@jprendes
Copy link
Collaborator

jprendes commented Feb 20, 2024

Hi @Wangyiwei-So ,

Could you do cargo clean -p libseccomp -p libseccomp-sys and then try building again?

If you've tried building without installing libseccomp-dev, then the libseccomp and libseccomp-sys dependencies are build with partial support. If you don't run cargo clean ..., those dependencies will not be rebuilt with full support, even when you run make build ... just build ... again.

@Wangyiwei-So
Copy link
Author

Thank you! @jprendes
I tried the method you mentioned, but still...

$ cargo clean -p libseccomp -p libseccomp-sys
$ make build FEATURES=wasmedge
/bin/sh: 1: sudo: not found
cargo build --target=x86_64-unknown-linux-gnu --target-dir=./target/ -p containerd-shim-wasm --no-default-features --features generate_bindings 
   Compiling libseccomp-sys v0.2.1
   Compiling libseccomp v0.3.0
   Compiling libcontainer v0.3.0
error[E0599]: no method named `get_notify_fd` found for struct `ScmpFilterContext` in the current scope
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libcontainer-0.3.0/src/seccomp/mod.rs:270:17
    |
270 |             ctx.get_notify_fd()
    |                 ^^^^^^^^^^^^^ method not found in `ScmpFilterContext`

For more information about this error, try `rustc --explain E0599`.

@jsturtevant
Copy link
Contributor

@Wangyiwei-So Where did you get the FEATURES=wasmedge I don't believe we use the FEATURES env anywhere. Are you trying to build just wasmedge? If so can you try make build-wasmedge

For deps, did you run scripts/setup-linux.sh? It has a few other deps than just the three listed above

@utam0k
Copy link
Member

utam0k commented Feb 25, 2024

Just be sure to use the latest runwasi code.

Compiling libcontainer v0.3.0

@Wangyiwei-So
Copy link
Author

@jsturtevant @utam0k thank you both very much, i tried two methods, but report same error. do you have builder image?

@utam0k
Copy link
Member

utam0k commented Mar 2, 2024

What's a builder image? Dockerfile?

@Wangyiwei-So
Copy link
Author

@utam0k yes. sorry i use google translator

@jprendes
Copy link
Collaborator

jprendes commented Mar 2, 2024

@Wangyiwei-So , you could run the makefile with CARGO=cross, that will run the build inside a Dockerfile.

make CARGO=cross build-wasmedge

You will need to install cross-rs with

cargo install cross --git https://github.com/cross-rs/cross

@Mossaka
Copy link
Member

Mossaka commented Apr 8, 2024

Related to this issue, youki/libcontainer starts to implement their own seccomp crate which may resolve this issue.

containers/youki#2724

@Mossaka Mossaka mentioned this issue Apr 19, 2024
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