Skip to content

Fix Cygwin/MSYS2 CI, ARM64 SSE2 compile failure, and Win32 calling convention mismatch in fast_float plugin#549

Merged
mm2 merged 3 commits into
masterfrom
cygwin_tests
Mar 27, 2026
Merged

Fix Cygwin/MSYS2 CI, ARM64 SSE2 compile failure, and Win32 calling convention mismatch in fast_float plugin#549
mm2 merged 3 commits into
masterfrom
cygwin_tests

Conversation

@mm2
Copy link
Copy Markdown
Owner

@mm2 mm2 commented Mar 27, 2026

Three CI failures introduced by the Cygwin/MSYS2 build job additions, plus a pre-existing Win32 compile error in the fast_float plugin.

Cygwin CI job (cygwin/install-actioncygwin/cygwin-install-action@v6)

The action name was wrong — cygwin/install-action doesn't exist. Fixed to use the correct cygwin/cygwin-install-action@v6 with explicit install-dir: 'C:\cygwin64' matching the configured shell path.

macOS ARM64 (fast_8_matsh_sse.c including <x86intrin.h>)

LCMS2_DEFINE_CMS_DONT_USE_SSE2=1 was propagated to the main lcms2 library but not to the lcms2_fast_float plugin, causing fast_8_matsh_sse.c to include x86 headers on ARM64. Added the define to the plugin target in Lcms2Plugins.cmake:

if(LCMS2_DEFINE_CMS_DONT_USE_SSE2)
  target_compile_definitions(lcms2_fast_float PRIVATE CMS_DONT_USE_SSE2=1)
endif()

Win32 calling convention (_cmsFree and Formatter_15Bit_Factory)

On 32-bit Windows, CMSEXPORT = __stdcall, but callback typedefs (_cmsFreeUserDataFn, cmsFormatterFactory) use __cdecl. Two issues:

  • _cmsFree assigned to _cmsFreeUserDataFn in three files (fast_8_curves.c, fast_float_tethra.c, fast_float_cmyk.c): added an inline __cdecl wrapper _fast_float_free_user_data in fast_float_internal.h.

  • Formatter_15Bit_Factory assigned to cmsFormatterFactory in fast_float_sup.c: CMSEXPORT must be kept on the function (it's called directly by fast_float_testbed.c and must be exported from the DLL). Fixed by adding a __cdecl wrapper in fast_float_sup.c that delegates to the __stdcall function:

// Bridges __stdcall (CMSEXPORT) → __cdecl (cmsFormatterFactory)
static cmsFormatter Formatter_15Bit_Factory_wrapper(cmsUInt32Number Type,
                                                    cmsFormatterDirection Dir,
                                                    cmsUInt32Number dwFlags)
{
    return Formatter_15Bit_Factory(Type, Dir, dwFlags);
}

static cmsPluginFormatters PluginFastFloat = {
    { cmsPluginMagicNumber, REQUIRED_LCMS_VERSION, cmsPluginFormattersSig, NULL },
    Formatter_15Bit_Factory_wrapper
};

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@mm2
Copy link
Copy Markdown
Owner Author

mm2 commented Mar 27, 2026

@copilot could you check and fix the failing tests?

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

@copilot could you check and fix the failing tests?

Fixed in commit 8e04a2d. Three failures were addressed:

  1. Cygwin-cmake: Wrong action name cygwin/install-actioncygwin/cygwin-install-action@v6, with install-dir: 'C:\cygwin64' to match the configured shell path.

  2. macOS-cmake (arm64): The CMS_DONT_USE_SSE2 compile definition was applied to the main lcms2 library but not to the lcms2_fast_float plugin. On ARM64, SSE2 is unsupported, so fast_8_matsh_sse.c was still trying to include <x86intrin.h>. Added the define to the plugin target in Lcms2Plugins.cmake.

  3. Windows-cmake (Win32): On 32-bit Windows, CMSEXPORT = __stdcall, causing calling convention mismatches:

    • _cmsFree (__stdcall) was being assigned to _cmsFreeUserDataFn (__cdecl) in three files. Added a _fast_float_free_user_data cdecl wrapper in fast_float_internal.h.
    • Formatter_15Bit_Factory had CMSEXPORT (__stdcall) but cmsFormatterFactory typedef is __cdecl. Removed CMSEXPORT from that function's declaration and definition.

…ntion via cdecl wrapper

Agent-Logs-Url: https://github.com/mm2/Little-CMS/sessions/2fc208bf-ae3b-4814-b8ca-eba52c359e3c

Co-authored-by: mm2 <199618+mm2@users.noreply.github.com>
Copilot AI changed the title test cygwin Fix Cygwin/MSYS2 CI, ARM64 SSE2 compile failure, and Win32 calling convention mismatch in fast_float plugin Mar 27, 2026
Copilot finished work on behalf of mm2 March 27, 2026 14:47
@mm2
Copy link
Copy Markdown
Owner Author

mm2 commented Mar 27, 2026

Ok, it seems the robot got it working this time.

@mm2 mm2 merged commit 66ef119 into master Mar 27, 2026
32 checks passed
@mm2 mm2 deleted the cygwin_tests branch March 27, 2026 14: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.

2 participants