containers / youki

A container runtime written in Rust

Home Page:https://containers.github.io/youki/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build failed

bestgopher opened this issue · comments

-> root@10-252-51-190 ~/youki git:(main) 2? # just youki-release
/root/youki/scripts/build.sh -o /root/youki -r -c youki
* FEATURES: <default>
* TARGET: x86_64-unknown-linux-gnu
/root/youki/scripts/build.sh: line 60: FEATURES[@]: unbound variable
error: Recipe `youki-release` failed on line 19 with exit code 1

When I fixed this problem according to my understanding:
srcipts/build.sh#45L

FEATURES=("--features=default")

and new problems appeared:

error[E0599]: no method named `get_notify_fd` found for struct `ScmpFilterContext` in the current scope
   --> crates/libcontainer/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
warning: build failed, waiting for other jobs to finish...
error: Recipe `youki-release` failed on line 19 with exit code 101

When I fixed the dependency in crates/libcontainer/Cargo.toml

libseccomp = {git="https://github.com/libseccomp-rs/libseccomp-rs",  optional = true, branch="main" }

, and install the libseccomp(version >= 2.5.0) library. The problem solved.

Hey, Thanks a lot for reporting this!
The seccomp issue is most likely due to the seccomp library version installed on your system is older than what we require. Can you try upgrading it to latestand re-check? I'll take a look at the release build failure issue.

Hey @bestgopher , I tried running just youki-release on the current main branch, and it worked without any issues. Can you give me more details about the build error you got initially ?

Hey @bestgopher , I tried running just youki-release on the current main branch, and it worked without any issues. Can you give me more details about the build error you got initially ?

I cloned the repo and executed just youki-release, got the error

-> root@10-252-51-190 ~/youki git:(main) 2? # just youki-release
/root/youki/scripts/build.sh -o /root/youki -r -c youki
* FEATURES: <default>
* TARGET: x86_64-unknown-linux-gnu
/root/youki/scripts/build.sh: line 60: FEATURES[@]: unbound variable
error: Recipe `youki-release` failed on line 19 with exit code 1

What OS and shell are you using?
Is the bash command in you system actually running bash? Or some other shell?

@jprendes centos7.9 and zsh

-> root@10-252-51-190 ~/youki git:(main) ? # echo $SHELL
/bin/zsh
-> root@10-252-51-190 ~/youki git:(main) ? # uname -r
5.4.247-1.el7.elrepo.x86_64
-> root@10-252-51-190 ~/youki git:(main) ? # uname -a
Linux 10-252-51-190 5.4.247-1.el7.elrepo.x86_64 #1 SMP Wed Jun 14 15:18:35 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux
-> root@10-252-51-190 ~/youki git:(main) ? # cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

The first problem has been solved after I upgraded the bash version. But the second problem still exist.
image

The first problem has been solved after I upgraded the bash version. But the second problem still exist.

Can you check which seccomp library version is installed on your system? This is usually due to the version incompatibility

The first problem has been solved after I upgraded the bash version. But the second problem still exist.

Can you check which seccomp library version is installed on your system? This is usually due to the version incompatibility

I am sorry that I dont know how to get the version.

I am sorry that I dont know how to get the version.

No worries : can you run yum list installed | grep seccomp and see its o/p ?

I am sorry that I dont know how to get the version.

No worries : can you run yum list installed | grep seccomp and see its o/p ?

I installed it from source, and the version is 2.5.3. When i upgraded the libseccomp(rust crate) version, it works fine.
edit the file: crates/libcontainer/Cargo.toml

libseccomp = {git="https://github.com/libseccomp-rs/libseccomp-rs",  optional = true, branch="main" }

Hey @bestgopher , sorry I didn't get back to you on this. Changing dependency from crates.io to github should not have much difference as there don't seem to be any changes in their main branch from latest release (0.3.0). Can you try installing libseccomp from yum, and see if that works...

Hey @bestgopher , sorry I didn't get back to you on this. Changing dependency from crates.io to github should not have much difference as there don't seem to be any changes in their main branch from latest release (0.3.0). Can you try installing libseccomp from yum, and see if that works...

Hi, thank you for your reply.
The difference between v0.3.0 and main branch shown as follow:
https://github.com/libseccomp-rs/libseccomp-rs/blob/76a7530cb21ba2528ff644917a9e698280b1a735/libseccomp/src/lib.rs#L80

https://docs.rs/libseccomp/0.3.0/src/libseccomp/lib.rs.html#76

And the compile error maybe relate with the difference.
image

We're going to switch our own seccomp from libseccomp. Please watch this issue 🙏