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

Removing libseccomp installations and disabling CGO #2063

Merged

Conversation

amitschendel
Copy link
Contributor

[Title: Remove libseccomp and CGO usage]

Removed all installations of the package from the code.

How to use

[ describe what reviewers need to do in order to validate this PR ]

Testing done

[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]

Copy link
Member

@eiffel-fl eiffel-fl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi.

An external contribution which removes an action in your CI: I say YES!
I have some comments but they are minor ones, I will run the CI to see if everything builds correctly.

Best regards.

docs/devel/CONTRIBUTING.md Outdated Show resolved Hide resolved
gadget-container/Makefile Outdated Show resolved Hide resolved
Copy link
Member

@eiffel-fl eiffel-fl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is OK from the CI point of view and the code addresses the problem well! Thank you!

Can you please squash your 3 commits in one, as they share the same semantic?

Signed-off-by: Amit Schendel <amits@armosec.io>
Copy link
Member

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit. Already LGTM.

@eiffel-fl now that we don't have CGO anymore, are these libraries still needed?

# We need a cross compiler and libraries for TARGETARCH due to CGO.
RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \
dpkg --add-architecture ${TARGETARCH} && \
apt-get update && \
apt-get install -y gcc make ca-certificates git libelf-dev:${TARGETARCH} \
pkg-config:${TARGETARCH} && \
if [ "${TARGETARCH}" != "${BUILDARCH}" ]; then \
if [ ${TARGETARCH} = 'arm64' ]; then \
apt-get install -y gcc-aarch64-linux-gnu; \
elif [ ${TARGETARCH} = 'amd64' ]; then \
apt-get install -y gcc-x86-64-linux-gnu; \
else \
>&2 echo "${TARGETARCH} is not supported"; \
exit 1; \
fi \
fi

@@ -108,7 +108,7 @@ registry.

For running unit tests, the following additional requirements need to be installed and configured on your system:
- gcc compiler
- `pkg-config` and `libseccomp-dev` libraries
- `pkg-config` helper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `pkg-config` helper
- `pkg-config`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above contains "gcc compiler", so I guess having "pkg-config helper" is OK.
Otherwise, we can just remove both "compiler" and "helper".

@eiffel-fl
Copy link
Member

@eiffel-fl now that we don't have CGO anymore, are these libraries still needed?

We should not need them, particularly as removing libelf-dev was already done here:
eb9b769

I will focus on libelf-dev and pkgconfig in a followup PR, let's focus on libseccomp in the present.

@eiffel-fl eiffel-fl merged commit b7bb730 into inspektor-gadget:main Sep 20, 2023
47 checks passed
@eiffel-fl
Copy link
Member

Merging as if we remove pkg-config I will deal with the documentation too.
Thank you for this contribution! Appreciated!

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

Successfully merging this pull request may close these issues.

None yet

3 participants