wazuh / wazuh-packages

Wazuh - Tools for packages creation
https://wazuh.com
GNU General Public License v2.0
104 stars 94 forks source link

Implement debug symbol generation during the build process for macOS #2886

Closed ncvicchi closed 5 months ago

ncvicchi commented 6 months ago

Description

Related issue
#21734

Currently, maxOS packages generated do not include debug symbols, which can hinder debugging efforts when issues arise. This issue aims to implement the necessary steps to generate packages with debug symbols for macOS packages.

Proposed Solution

  1. Update Packaging Scripts:
    • Modify the scripts responsible for generating macOS installer packages to incorporate the inclusion of debug symbols.
    • Implement any necessary logic to ensure that debug symbols are correctly packaged and included.

Research guidelines

Research on how we are currently compiling for macOS should be done. A good understanding of the compiling process (which is different on macOS than on Linux) will be necessary. A fast search indicated that for macOS debug symbols are always created separated from the binary, and then must be joined by using the dsymutil tool to bring them together. This might simplify this issue if found to be true.

Definition of Done

Leoquicenoz commented 6 months ago

The ETA is delayed as work was being done on this issue.

Leoquicenoz commented 6 months ago

Update

I'm investigating the possibility of generating a .pkg file with the files containing the debug symbols, apparently it is a complicated task, so we are also analyzing the possibility of putting the .dSYM files generated in the compilation in a compressed package, what I am investigating is once I have them in the compressed file, how the user could install them if necessary.

Leoquicenoz commented 5 months ago

Update

The changes made in the Makefile in which the debug symbols were separated from the binaries in macOS are moved to the macos/package_files/build.sh file.

ec2-user@ip-172-31-33-149 macos % ls repository/wazuh/src/symbols 
agent-auth.dSYM            host-deny.dSYM             libdbsync.dylib.dSYM       libsysinfo.dylib.dSYM      npf.dSYM                   wazuh-agentd.dSYM          wazuh-slack.dSYM
default-firewall-drop.dSYM ip-customblock.dSYM        libfimdb.dylib.dSYM        libwazuhext.dylib.dSYM     pf.dSYM                    wazuh-execd.dSYM
disable-account.dSYM       ipfw.dSYM                  librsync.dylib.dSYM        libwazuhshared.dylib.dSYM  restart-wazuh.dSYM         wazuh-logcollector.dSYM
firewalld-drop.dSYM        kaspersky.dSYM             libsyscollector.dylib.dSYM manage_agents.dSYM         route-null.dSYM            wazuh-modulesd.dSYM 
ncvicchi commented 5 months ago

Since a migration from packages repository to wazuh repository is being performed, this issue is being discarded