Commit Graph
154 Commits
Author SHA1 Message Date
Oliver Hamlet 81388873da Add bits for cross-compiling to Windows using MinGW
Some tests have been updated because UTF-8 is used as the native
path encoding with MinGW/Wine, unlike MSVC/Windows.

Some of the tests fail:

- 4 Rust tests fail because long paths are not enabled and so the
  paths used when creating symlinks and junction paths are too
  long. I've tested them with x86_64-pc-windows-gnu and
  x86_64-pc-windows-gnullvm, and both see the same behaviour. The
  tests pass when the MinGW-built executable is run on Windows, so
  this is a Wine limitation.
- 12 C++ tests fail because directory symlink creation is not
  implemented. They fail whether the MinGW-built executable is run
  in Wine or on Windows, so this is a MinGW limitation.
- 1 C++ filesystem test fails because long paths are not enabled.

The failing tests are skipped at runtime when built with MinGW,
aside from the one test for long paths being enabled, which expects
them to be disabled when built with MinGW.

If long paths are enabled, e.g. by running

wine reg add HKLM\\System\\CurrentControlSet\\Control\\Filesystem /v LongPathsEnabled /t REG_DWORD /d 1 /f

then many more tests fail because the C++ tests create long paths
when that Registry value is set, but it doesn't seem to actually
enable long path support in Wine, so various filesystem operations
fail.
2026-02-03 08:52:23 +00:00
Oliver Hamlet 7910670675 Refactor max path component length constant 2026-01-31 15:29:33 +00:00
Oliver Hamlet 832690957a Require loot-condition-interpreter v6
It includes new functionality that is required for the metadata syntax v0.29.

Add a couple of tests that rely on that new functionality so that the
dependency is backed by tests that fail if it's not met.
2026-01-27 20:09:28 +00:00
Oliver Hamlet f606f169a5 Add condition field to plugin cleaning data metadata 2026-01-21 17:55:14 +00:00
Oliver Hamlet 55510729ca Add some tests for regex syntax support
Some functionality is only supported because the regex is built with the
Unicode flag instead of the UnicodeSets flag, but that's done for
backwards compatibility as the latter disallows some syntax that may be
in use.
2026-01-18 21:33:23 +00:00
Oliver Hamlet d14486433f Add line breaks to first two levels of metadata list output
Aside from the known bash tags list, since they're all short strings.
2026-01-14 19:02:40 +00:00
Oliver Hamlet b7363b0a29 Replace WriteMode with MetadataWriteOptions
This is a breaking API change, but the addition of any future options won't be.
2026-01-03 13:26:52 +00:00
Oliver Hamlet dae06e1f10 Add option for anchoring scalar files
As they're relatively simple strings, the indirection introduced by using an alias may harm readability more than the alias helps to prevent typos, shorten the metadata doc and make repetition more obvious.
2026-01-02 19:58:50 +00:00
Oliver Hamlet e8deace7a4 Emit anchors in a "common" YAML key
To match how they're organised in the masterlists. The order of the anchor types matters: contents and conditions go before messages and files because the latter can contain the former, so writing the former first ensures that all anchors are written at the same level of indentation.
2026-01-02 19:58:47 +00:00
Oliver Hamlet da00052245 Add support for emitting YAML with anchors and aliases
Support is currently limited to aliasing:

- Condition and constraint strings
- File values
- Message values
- MessageContent arrays (including single-value arrays that are
  serialised as strings)

An anchor is written if the same value appears more than once in the
metadata document being written, and if an anchor for that value has not
already been written. If a value has already been written with an
anchor, later appearances of that value will be written as aliases of
that anchor.

Anchors are named according to the type of data they're for, followed by
an incrementing number, e.g. file1, message1, contents1, condition1.

This behaviour is configurable within libloot, the configuration options
will be exposed externally once the functionality is more settled.
2026-01-02 19:49:05 +00:00
Oliver Hamlet 72dde58e43 Preserve plugin metadata insertion order 2026-01-02 18:40:27 +00:00
Oliver Hamlet 74628bda7c Compare regex strings case-insensitively in remove_plugin_metadata() 2026-01-02 18:02:18 +00:00
Oliver Hamlet 12a0407b4c Add the ability to remove regex plugin metadata 2026-01-02 16:45:31 +00:00
Oliver Hamlet 96b2ed2373 Add include_user_metadata parameter to Database::general_messages()
The C++ wrapper defaults it to true, so the behaviour hasn't changed for
existing callers that don't pass a value for the evaluateConditions
parameter, i.e. that call GetGeneralMessages().

Since the new parameter comes before evaluateConditions,
existing GetGeneralMessages(true) and GetGeneralMessages(false) calls
need to be replaced with GetGeneralMessages(true, true) and
GetGeneralMessages(true, false) to retain their existing behaviour. The
parameter order was chosen to match that of GetPluginMetadata(), at the
cost of this backwards incompatibility.
2026-01-02 16:41:43 +00:00
Oliver Hamlet f582a513bc Add Database::set_user_general_messages() 2026-01-02 16:41:42 +00:00
Oliver Hamlet 1d123c8b21 Add Database::user_general_messages() 2026-01-02 16:41:42 +00:00
Oliver Hamlet 744586fe96 Add include_user_metadata parameter to Database::known_bash_tags()
The C++ wrapper defaults it to true, so the behaviour hasn't changed for
existing callers.
2026-01-02 16:41:07 +00:00
Oliver Hamlet db97a0786a Add Database::set_user_known_bash_tags() 2026-01-02 15:30:40 +00:00
Oliver Hamlet 2fe107d66b Add Database::user_known_bash_tags() 2026-01-02 15:30:24 +00:00
Oliver Hamlet e72a0de8c7 Avoid functions stabilised in Rust v1.91.0
The Flatpak build environment used by LOOT provides an older version of the Rust toolchain.
2026-01-02 14:44:22 +00:00
Oliver Hamlet 46c3ddc884 Decouple clearing condition cache from evaluating general messages 2026-01-02 10:15:39 +00:00
Oliver Hamlet 3890c3a095 Improve some doc comments 2025-12-30 15:19:42 +00:00
Oliver Hamlet 4bfa4c9539 Don't error if metadata list contains duplicate known Bash Tags
It's harmless to have duplicates, and the list is not documented to contain unique elements.
2025-12-30 15:06:11 +00:00
Oliver Hamlet 9b81824851 Fix writing metadata files in current working directory 2025-12-29 10:22:12 +00:00
Oliver Hamlet caa860b2df Rename YAML emitter functions for clarity 2025-12-28 16:04:31 +00:00