diff --git a/userspace/engine/falco_utils.cpp b/userspace/engine/falco_utils.cpp index 3804b094..926e2f93 100644 --- a/userspace/engine/falco_utils.cpp +++ b/userspace/engine/falco_utils.cpp @@ -22,7 +22,7 @@ limitations under the License. #include #include -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) #include #endif #include @@ -119,7 +119,7 @@ uint64_t parse_prometheus_interval(std::string interval_str) return interval; } -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) std::string calculate_file_sha256sum(const std::string& filename) { std::ifstream file(filename, std::ios::binary); diff --git a/userspace/engine/falco_utils.h b/userspace/engine/falco_utils.h index 7b08a89a..35a6a928 100644 --- a/userspace/engine/falco_utils.h +++ b/userspace/engine/falco_utils.h @@ -27,7 +27,7 @@ namespace falco::utils { uint64_t parse_prometheus_interval(std::string interval_str); -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) std::string calculate_file_sha256sum(const std::string& filename); #endif diff --git a/userspace/falco/app/actions/load_rules_files.cpp b/userspace/falco/app/actions/load_rules_files.cpp index 902ac3b5..21c28b76 100644 --- a/userspace/falco/app/actions/load_rules_files.cpp +++ b/userspace/falco/app/actions/load_rules_files.cpp @@ -84,7 +84,7 @@ falco::app::run_result falco::app::actions::load_rules_files(falco::app::state& { falco_logger::log(falco_logger::level::WARNING,res->as_string(true, rc) + "\n"); } -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) s.config->m_loaded_rules_filenames_sha256sum.push_back(falco::utils::calculate_file_sha256sum(filename)); #endif } diff --git a/userspace/falco/configuration.cpp b/userspace/falco/configuration.cpp index 3bc34722..b4f0dc76 100644 --- a/userspace/falco/configuration.cpp +++ b/userspace/falco/configuration.cpp @@ -161,7 +161,7 @@ void falco_configuration::merge_configs_files(const std::string& config_name, st } } -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) for(auto &filename : m_loaded_configs_filenames) { m_loaded_configs_filenames_sha256sum.push_back(falco::utils::calculate_file_sha256sum(filename)); diff --git a/userspace/falco/falco_metrics.cpp b/userspace/falco/falco_metrics.cpp index e5348f39..54cc7e1f 100644 --- a/userspace/falco/falco_metrics.cpp +++ b/userspace/falco/falco_metrics.cpp @@ -84,7 +84,7 @@ std::string falco_metrics::to_text(const falco::app::state& state) prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus("kernel_release", "falcosecurity", "falco", {{"kernel_release", agent_info->uname_r}}); prometheus_text += prometheus_metrics_converter.convert_metric_to_text_prometheus("hostname", "falcosecurity", "evt", {{"hostname", machine_info->hostname}}); -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) auto it_filename = state.config.get()->m_loaded_rules_filenames.begin(); auto it_sha256 = state.config.get()->m_loaded_rules_filenames_sha256sum.begin(); while (it_filename != state.config.get()->m_loaded_rules_filenames.end() && it_sha256 != state.config.get()->m_loaded_rules_filenames_sha256sum.end()) diff --git a/userspace/falco/stats_writer.cpp b/userspace/falco/stats_writer.cpp index 0bb37a2b..9117a68a 100644 --- a/userspace/falco/stats_writer.cpp +++ b/userspace/falco/stats_writer.cpp @@ -330,7 +330,7 @@ void stats_writer::collector::get_metrics_output_fields_wrapper( output_fields["falco.host_num_cpus"] = machine_info->num_cpus; output_fields["falco.outputs_queue_num_drops"] = m_writer->m_outputs->get_outputs_queue_num_drops(); -#if defined(__linux__) +#if defined(__linux__) and !defined(MINIMAL_BUILD) and !defined(__EMSCRIPTEN__) auto it_filename = m_writer->m_config->m_loaded_rules_filenames.begin(); auto it_sha256 = m_writer->m_config->m_loaded_rules_filenames_sha256sum.begin(); while (it_filename != m_writer->m_config->m_loaded_rules_filenames.end() && it_sha256 != m_writer->m_config->m_loaded_rules_filenames_sha256sum.end())