Skip to content

Build regression after upgrading MySQL version on Windows #2231

@peace-maker

Description

@peace-maker

Help us help you

  • I have checked that my issue doesn't exist yet.
  • I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: Microsoft Windows Server 2022 10.0.20348
  • Game/AppID (with version if applicable):
  • Current SourceMod version:
  • Current SourceMod snapshot:
  • Current Metamod: Source snapshot:

Description

#2192 broke building the mysql extension on Windows - but only after some time? Probably Github Actions caching the old MySQL version?
The release notes for MySQL 5.5.55 state under Compilation Notes:

Windows builds now use the default runtime libraries (builds use the /MD flag). (Bug #25611609)

Which was the reason 5.5.54 was selected on Windows. We compile statically using /MT which links the libcmt.lib common runtime statically. The mysqlclient links the dynamic .dll now too which causes a conflict and would require the dynamic library to be available in the library path when loading the mysql extension.

This causes builds to fail to link in CI. The build servers don't use the checkout-deps.sh script and thus are still on the old mysql version 5.5.54.

Problematic Code (or Steps to Reproduce)

Build sourcemod on Windows and grab dependencies using the `tools/checkout-deps.sh` script.

Logs

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

LINK : warning LNK4286: symbol 'exit' defined in 'libucrt.lib(exit.obj)' is imported by 'mysqlclient.lib(str_alloc.obj)'

...


mysqlclient.lib(my_init.obj) : error LNK2001: unresolved external symbol __imp_getenv

mysqlclient.lib(handshake_client.obj) : error LNK2001: unresolved external symbol __imp_getenv

...

https://github.com/alliedmodders/sourcemod/actions/runs/12089683390/job/33715394830

Metadata

Metadata

Assignees

No one assigned

    Labels

    Buggeneral bugs; can be anything

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions