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

No package 'libseccomp' found error during runc build #1032

Closed
lizhuqi opened this issue Sep 9, 2016 · 7 comments
Closed

No package 'libseccomp' found error during runc build #1032

lizhuqi opened this issue Sep 9, 2016 · 7 comments

Comments

@lizhuqi
Copy link

lizhuqi commented Sep 9, 2016

Following the steps from the release note:

$ # create a 'github.com/opencontainers' in your GOPATH/src
$ cd github.com/opencontainers
$ git clone https://github.com/opencontainers/runc
$ cd runc
$ make
$ sudo make install

It failed in make step with following errors:

$ make
go build -i -ldflags "-X main.gitCommit="99c683a84fcfb0675883dc98eaa8c0bc3311e436" -X main.version=1.0.0-rc1" -tags "seccomp" -o runc .
# pkg-config --cflags libseccomp libseccomp
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
make: *** [all] Error 2
@cyphar
Copy link
Member

cyphar commented Sep 10, 2016

Does your distribution include the pkg-config information for libseccomp? If not, please get them to do so. If you built libseccomp from scratch, install the libseccomp.pc file available in the source tree.

@lizhuqi
Copy link
Author

lizhuqi commented Sep 12, 2016

Hi Aleksa, thanks for reply! I've just run sudo apt-get install libseccomp2 to install the libseccomp2, can you tell me how to include the pkg-config information for libseccomp?

@cyphar
Copy link
Member

cyphar commented Sep 13, 2016

You should install pkg-config in your distribution. Though, the error makes me think that you do have pkg-config installed.

@lizhuqi
Copy link
Author

lizhuqi commented Sep 13, 2016

I've already installed the latest version of pkg-config. However, still it is saying No pacakge 'libseccomp' found. I am using "sudo apt-get install libseccomp2" to install the libseccomp. Is there any extra command I need to run to set up libseccomp?

Build error as below:
go build -i -ldflags "-X main.gitCommit="f516b5d0821f90515d38e79c4f5d4d221dc0c331" -X main.version=1.0.0-rc1" -tags "seccomp" -o runc .

pkg-config --cflags libseccomp libseccomp

Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing libseccomp.pc' to the PKG_CONFIG_PATH environment variable No package 'libseccomp' found Package libseccomp was not found in the pkg-config search path. Perhaps you should add the directory containinglibseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
make: *** [all] Error 2

@lizhuqi
Copy link
Author

lizhuqi commented Sep 14, 2016

Close this issue as I just build it with make BUILDTAGS=""

@rhdojun
Copy link

rhdojun commented Aug 4, 2020

You can click through with the other pull request from @resouer of course, but for people who just come here from google:

libseccomp is not enough. You need either libseccomp-devel or libseccomp-dev, depending on your OS.

mc256 added a commit to mc256/containerd that referenced this issue Oct 1, 2020
I got these error when I try to build contaienrd.

```
go build "-mod=vendor" "-buildmode=pie"  -tags "seccomp selinux apparmor" -ldflags "-X main.gitCommit="a220b9c6cc100f71ddc67152a12fc04622313dca" -X main.version=1.0.0-rc92+dev " -o runc .
# pkg-config --cflags  -- libseccomp libseccomp
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
```

Solved this problem by installing one extra dependency `libseccomp-dev`. 

I am using Ubuntu 20.04 and everything works well! 

See also: opencontainers/runc#1032
mc256 added a commit to mc256/containerd that referenced this issue Oct 1, 2020
I got these errors when I try to build containerd:

```
go build "-mod=vendor" "-buildmode=pie"  -tags "seccomp selinux apparmor" -ldflags "-X main.gitCommit="a220b9c6cc100f71ddc67152a12fc04622313dca" -X main.version=1.0.0-rc92+dev " -o runc .
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
Package libseccomp was not found in the pkg-config search path.
Perhaps you should add the directory containing `libseccomp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libseccomp' found
pkg-config: exit status 1
```

Solved this problem by installing one extra dependency `libseccomp-dev`. I am using Ubuntu 20.04 and everything works well!

See also: opencontainers/runc#1032

Signed-off-by: Jun Lin Chen <webmaster@mc256.com>
@profnandaa
Copy link

Just posting this here in case someone ends up here from search.
Be aware when you skip this with BUILDTAGS="". You might end up with such a thing when running docker for instance:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: seccomp: config provided but seccomp not supported: unknown.
ERRO[0000] error waiting for container:

The right fix is to install both seccomp2 and seccomp-dev, in the case of Ubuntu.

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

4 participants