Skip to content

Conversation

TomasTurina
Copy link
Member

@TomasTurina TomasTurina commented Mar 26, 2025

Description

This PR adds several improvements to the Windows scaffolding, as reported by #692. These changes also significantly reduce the MSI and installation size.

Proposed Changes

  • Fix UT location so they are not included in the MSI.
    • data_provider and dbsync cmake improvements.
  • Improve some UT, run them on the correct OSs.
  • Link vcpkg dependencies statically.
    • Several changes/improvements in Windows scaffolding and package sizes.
  • Remove some unused target links.
  • Suppress some inoffensive macOS compilation warnings.

Results and Evidence

Linux:

# ldd wazuh-agent
        linux-vdso.so.1 (0x0000e8cf367a7000)
        libsystemd.so.0 => /lib/aarch64-linux-gnu/libsystemd.so.0 (0x0000e8cf35500000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000e8cf35450000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000e8cf35290000)
        /lib/ld-linux-aarch64.so.1 (0x0000e8cf3676a000)
        libcap.so.2 => /lib/aarch64-linux-gnu/libcap.so.2 (0x0000e8cf36740000)
        libgcrypt.so.20 => /lib/aarch64-linux-gnu/libgcrypt.so.20 (0x0000e8cf35180000)
        liblz4.so.1 => /lib/aarch64-linux-gnu/liblz4.so.1 (0x0000e8cf36700000)
        liblzma.so.5 => /lib/aarch64-linux-gnu/liblzma.so.5 (0x0000e8cf35130000)
        libzstd.so.1 => /lib/aarch64-linux-gnu/libzstd.so.1 (0x0000e8cf35070000)
        libgpg-error.so.0 => /lib/aarch64-linux-gnu/libgpg-error.so.0 (0x0000e8cf35020000)

macOS:

% otool -L wazuh-agent 
wazuh-agent:
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61439.60.117)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3208.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3208.0.0)
        /System/Library/Frameworks/OSLog.framework/Versions/A/OSLog (compatibility version 1.0.0, current version 1612.60.27)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libcharset.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.105.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Windows

>dumpbin /dependents wazuh-agent.exe
Microsoft (R) COFF/PE Dumper Version 14.40.33811.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file wazuh-agent.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    bcrypt.dll
    CRYPT32.dll
    IPHLPAPI.DLL
    WS2_32.dll
    KERNEL32.dll
    USER32.dll
    SHELL32.dll
    ole32.dll
    ADVAPI32.dll
    wevtapi.dll

image

Old sizes:

  • MSI : 47.4 MB
  • Install size: 62.0 MB

New sizes:

  • MSI: 38.8 MB
  • Install size: 47.9 MB

Artifacts Affected

  • MSI

Configuration Changes

N/A

Documentation Updates

N/A

Tests Introduced

N/A

Review Checklist

  • Code changes reviewed
  • Relevant evidence provided
  • Tests cover the new functionality
  • Configuration changes documented
  • Developer documentation reflects the changes
  • Meets requirements and/or definition of done
  • No unresolved dependencies with other issues

@TomasTurina TomasTurina self-assigned this Mar 26, 2025
@TomasTurina TomasTurina linked an issue Mar 26, 2025 that may be closed by this pull request
@TomasTurina TomasTurina force-pushed the fix/692-improve-windows-scaffolding branch 4 times, most recently from f4fb70c to 437a970 Compare March 27, 2025 14:26
@TomasTurina TomasTurina changed the title Fix/692 improve windows scaffolding Improve windows scaffolding Mar 27, 2025
@TomasTurina TomasTurina force-pushed the fix/692-improve-windows-scaffolding branch 2 times, most recently from 26fc6bb to d21cb5f Compare March 27, 2025 18:15
@TomasTurina TomasTurina marked this pull request as ready for review March 27, 2025 19:06
@TomasTurina TomasTurina force-pushed the fix/692-improve-windows-scaffolding branch from edfd9b7 to b9de00a Compare March 27, 2025 20:21
@TomasTurina TomasTurina force-pushed the fix/692-improve-windows-scaffolding branch from b9de00a to 9531f09 Compare March 27, 2025 20:47
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

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

LGTM!

@jr0me jr0me force-pushed the fix/692-improve-windows-scaffolding branch from f438189 to 7cf9405 Compare March 27, 2025 21:22
@TomasTurina TomasTurina force-pushed the fix/692-improve-windows-scaffolding branch from 7cf9405 to 2600708 Compare March 28, 2025 15:49
@TomasTurina TomasTurina merged commit 404aad7 into main Mar 28, 2025
6 checks passed
@TomasTurina TomasTurina deleted the fix/692-improve-windows-scaffolding branch March 28, 2025 18:57
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.

Review Windows agent scaffolding

4 participants