Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldmud: various build fixes #360262

Merged
merged 3 commits into from
Mar 21, 2025
Merged

ldmud: various build fixes #360262

merged 3 commits into from
Mar 21, 2025

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Nov 30, 2024

libxcrypt-legacy

The LDMud game engine defaults to using a legacy DES hash that is (sensibly) only enabled in the libxcrypt-legacy derivation, not libxcrypt.

This commit switches LDMud to that build input instead of libxcrypt. This fixes a runtime error when calling efun::crypt() from LPC that would print a confusing error message like "crypt() is not available.".

See also #223034

libxml2 2.12+ compat

The v2.12.0 release of libxml2 changed the definition of the callback used with xmlSetStructuredErrorFunc() (ref libxml2 NEWS).

A fix is underway upstream (ldmud/ldmud#95), but the release cadence is such that we should expect to fix this locally for some time, so a local patch with a fix is applied.

mariadb-connector-c compat

The upstream configure.ac's AC_LANG_PROGRAM for mysql feature detection seems to be incompatible with the mariadb-connector-c package, resulting in support not being detected.

Digging in to the config.log we can see it's a type mismatch error from the test program .c:

configure:11661: checking for mySQL
configure:11694: gcc -c -g -O2 -fwrapv -I/usr/inet6/include -I/nix/store/ya8wpj6dqz39024v6xrv504i9kyidpil-mariadb-connector-c-3.1.21-dev/include/mysql conftest.c >&5
conftest.c: In function 'foo':
conftest.c:90:12: error: returning 'MYSQL *' {aka 'struct st_mysql *'} from a function with incompatible return type 'struct MYSQL *' [-Wincompatible-pointer-types]
90 |     return &var;
|            ^~~~

We resolves the issue locally by applying a small patch.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Nov 30, 2024
@cpu
Copy link
Contributor Author

cpu commented Dec 8, 2024

@vcunat Would you be willing to review this PR as the author of #223034? Thanks! 🙇

@vcunat
Copy link
Member

vcunat commented Feb 23, 2025

Oops. At this point, the package won't build even with this PR. Probably some change in libxml2 triggered that.

@cpu
Copy link
Contributor Author

cpu commented Feb 23, 2025

I'll take a look

cpu added 3 commits March 20, 2025 10:18
The LDMud game driver defaults to using a legacy DES hash that is
(sensibly) only enabled in the libxcrypt-legacy derivation, not
libxcrypt.

This commit switches LDMud to that build input instead of libxcrypt.
This fixes a runtime error when calling `efun::crypt()` from LPC that
would print a confusing error message like "crypt() is not available.".
A fix is underway upstream, but the release cadence is such that we
should expect to fix this locally for some time.
The upstream `configure.ac`'s `AC_LANG_PROGRAM` for mysql feature
detection seems to be incompatible with the `mariadb-connector-c`
package, resulting in support not being detected.

Digging in to the `config.log` we can see it's a type mismatch error
from the test program `.c`:

```
configure:11661: checking for mySQL
configure:11694: gcc -c -g -O2 -fwrapv -I/usr/inet6/include -I/nix/store/ya8wpj6dqz39024v6xrv504i9kyidpil-mariadb-connector-c-3.1.21-dev/include/mysql conftest.c >&5
conftest.c: In function 'foo':
conftest.c:90:12: error: returning 'MYSQL *' {aka 'struct st_mysql *'} from a function with incompatible return type 'struct MYSQL *' [-Wincompatible-pointer-types]
90 |     return &var;
|            ^~~~
```

This commit resolves the issue locally by applying a small patch.
@cpu cpu force-pushed the cpu-ldmud-libxcrypt branch from 262805e to 04704ad Compare March 20, 2025 16:21
@cpu cpu changed the title ldmud: use libxcrypt-legacy ldmud: various build fixes Mar 20, 2025
@cpu
Copy link
Contributor Author

cpu commented Mar 20, 2025

At this point, the package won't build even with this PR. Probably some change in libxml2 triggered that.

@vcunat Indeed you are correct. Thanks for flagging.

I pushed two commits (one fixing the libxml2 issue, and one fixing ldmud-full for mariadb-connector-c) and updated the PR description.

@vcunat vcunat merged commit e93e4f9 into NixOS:master Mar 21, 2025
43 checks passed
@vcunat
Copy link
Member

vcunat commented Mar 21, 2025

Fixes the build and looks OK at a glance, so why not.

@cpu cpu deleted the cpu-ldmud-libxcrypt branch March 21, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants