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

Build error trying to build falco 0.40.0 with MINIMAL_BUILD and USE_JEMALLOC #3474

Closed
Quarky9 opened this issue Jan 29, 2025 · 4 comments · Fixed by #3478
Closed

Build error trying to build falco 0.40.0 with MINIMAL_BUILD and USE_JEMALLOC #3474

Quarky9 opened this issue Jan 29, 2025 · 4 comments · Fixed by #3478
Labels
Milestone

Comments

@Quarky9
Copy link

Quarky9 commented Jan 29, 2025

Build error trying to build falco on Alpine 3.21 since release 0.40.0 with settings:

-DMINIMAL_BUILD=On
-DUSE_JEMALLOC=On

/home/alpine/kubezero/falco/src/falco-0.40.0/userspace/falco/stats_writer.cpp: In member function 'void stats_writer::collector::get_metrics_output_fields_additional(nlohmann::json_abi_v3_11_3::json&, double)':
/home/alpine/kubezero/falco/src/falco-0.40.0/userspace/falco/stats_writer.cpp:465:54: error: 'using std::__shared_ptr_access<stats_writer, __gnu_cxx::_S_atomic, false, false>::element_type = class stats_writer' {aka 'class stats_writer'} has no member named 'm_output_rule_metrics_converter'
  465 |                                            m_writer->m_output_rule_metrics_converter) {
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/alpine/kubezero/falco/src/falco-0.40.0/userspace/falco/stats_writer.cpp:466:59: error: 'using std::__shared_ptr_access<stats_writer, __gnu_cxx::_S_atomic, false, false>::element_type = class stats_writer' {aka 'class stats_writer'} has no member named 'm_output_rule_metrics_converter'
  466 |                                                 m_writer->m_output_rule_metrics_converter
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [userspace/falco/CMakeFiles/falco_application.dir/build.make:653: userspace/falco/CMakeFiles/falco_application.dir/stats_writer.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:2928: userspace/falco/CMakeFiles/falco_application.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2990: userspace/falco/CMakeFiles/falco.dir/rule] Error 2
make: *** [Makefile:1061: falco] Error 2

most likely due to m_output_rule_metrics_converter being exluded during MINIMAL builds ?

#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__)
	std::unique_ptr<libs::metrics::libs_metrics_collector> m_libs_metrics_collector;
	std::unique_ptr<libs::metrics::output_rule_metrics_converter> m_output_rule_metrics_converter;
#endif

See: https://github.com/falcosecurity/falco/blob/master/userspace/falco/stats_writer.h#L153

@FedeDP
Copy link
Contributor

FedeDP commented Jan 31, 2025

Hi! Thanks for opening this issue! Would you mind opening a PR to fix it? :)
/milestone 0.41.0

@poiana poiana added this to the 0.41.0 milestone Jan 31, 2025
@Quarky9
Copy link
Author

Quarky9 commented Jan 31, 2025

Would love to but my C++ skillz are not up to par I am afraid 😳,
nor do I know the reasoning behind the exclusion for MINIMAL builds etc.

My guess would be to also disable Jemalloc related stats for minimal builds ?

( btw. I got it to compile disabling Jemalloc for now )

@FedeDP
Copy link
Contributor

FedeDP commented Jan 31, 2025

No problem :) Will fix it asap! Thanks for reporting!

@FedeDP
Copy link
Contributor

FedeDP commented Jan 31, 2025

Opened #3478 to fix this one ;) care to test?

(Of course i already tested it 😆 )

[ 90%] Building CXX object userspace/falco/CMakeFiles/falco_application.dir/stats_writer.cpp.o
[ 90%] Linking CXX static library libfalco_application.a
[ 98%] Built target falco_application
[ 98%] Building CXX object userspace/falco/CMakeFiles/falco.dir/falco.cpp.o
[100%] Linking CXX executable falco
[100%] Built target falco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants