-
Notifications
You must be signed in to change notification settings - Fork 165
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
refactor libsinsp sub-components #14
Conversation
d0b5298
to
1ff71fd
Compare
d31504c
to
85800dc
Compare
This commit assumes those sub-components will be ported back to draios/sysdig Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Note about `CHISELS_INSTALLATION_DIR`: Only the library consumer uses it, so we can safely move it away. Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
85800dc
to
e73587d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Not approving yet because I want to know your thoughts about a separate chisel library and I'm afraid poiana will spoil the fun.
if(WITH_CHISEL) | ||
list(APPEND SINSP_SOURCES | ||
../chisel/chisel_api.cpp | ||
../chisel/chisel_fields_info.cpp | ||
../chisel/chisel_utils.cpp | ||
../chisel/chisel.cpp | ||
../chisel/lua_parser_api.cpp | ||
../chisel/lua_parser.cpp) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a separate libsinspchisel.a
? We'd lose one build-time variable for libsinsp, at least
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short answer
it could be, but it's outside the scope of this PR :)
Long answer
The main goal of this PR is to reduce the external dependencies by moving out those sub-components (which should not part of libsinsp
by default). When doing that, I've realized there are a lot of further improvements that can be done, but the set of modifications required just to move them away was already too big. In particular, I have noticed they are tightly coupled with libsinsp
internals, most of the implementation relies on friend classes, unfortunately. So I decided to keep things simple and reduce the scope of this PR as minimal as possible (that's XXL size anyways). Basically, you should think about this PR as a baby step.
For those reasons, I really think that we should first review the implementation and then make libsinspchisel.a
a thing, eventually.
LGTM label has been added. Git tree hash: 57d6db1212541bed93e5c611eb054c4a735b91f3
|
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is important this goes in before any further work on the CMakeFiles for various reasons:
- it removes things not belonging to this repo conceptually (but rather belonging to draios/sysdig)
- it isolates chisels source code
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnosek, leodido The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
See: - falcosecurity/libs#14 - #1747 Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area build
/area libsinsp
What this PR does / why we need it:
This PR aims to refactor 2 libsinp sub-components in the following way:
ncurses
dependencyuserspace/chisel
) and its inclusion is controlled by a cmake optionWITH_CHISEL
(disabled by default)N.B.:
Those sub-components rely on several extension points that were implemented by using the
friend class
mechanism. The extension points are untouched, refactoring them is outside the scope of this PR.Special notes for your reviewer:
We will need to introduce a new CI job to build the libraries with
-DWITH_CHISEL=True
Does this PR introduce a user-facing change?: