Skip to content

meson: restore extension_memory as feature (fixes #829)#833

Merged
mvandervoord merged 1 commit into
ThrowTheSwitch:masterfrom
adityachilka1:fix/meson-extension-memory-feature
May 22, 2026
Merged

meson: restore extension_memory as feature (fixes #829)#833
mvandervoord merged 1 commit into
ThrowTheSwitch:masterfrom
adityachilka1:fix/meson-extension-memory-feature

Conversation

@adityachilka1
Copy link
Copy Markdown

Fixes #829.

The bug

meson setup fails on current master:

meson.build:45:16: ERROR: Unknown method "enabled" in object
<[BooleanHolder] holds [bool]: False> of type BooleanHolder.

Root cause

Commit 29451d6c changed extension_memory from type: 'feature' to
type: 'boolean' - but that branch was PR #764 ("Fix: update meson options
to avoid deprecation warnings"), whose actual diff just removed quotes from
boolean values (Meson 1.1 deprecation fix). The PR branch was based on an
older master where extension_memory was still boolean. When the PR was
merged into master (commit 6502a671), the conflict resolution kept the
PR's stale boolean version instead of master's current feature version.

meson.build still calls build_memory.enabled() and build_memory.auto(),
which are feature-option methods; on a boolean option they don't exist.

The fix

Restore extension_memory to its feature type in meson_options.txt:

-option('extension_memory', type: 'boolean', value: false, description: 'Whether to enable the memory extension.')
+option('extension_memory', type: 'feature', value: 'auto', description: 'Whether to enable the memory extension. By default this is automatically enabled when extension_fixture is enabled.')

meson.build is UNCHANGED - its use of enabled() and auto() is
correct for a feature option and preserves the original "memory extension
automatically enabled when fixture is enabled" semantic.

Verification

meson setup build                        # OK (pre-fix: ERROR)
meson configure build -Dextension_memory=enabled  # OK
ninja -C build                           # builds libunity.a + memory

Dropping the fix (git stash) reproduces the original error verbatim.

No user-facing change

Users who were explicitly passing -Dextension_memory=false can now use
-Dextension_memory=disabled (feature semantic). The default ('auto')
matches the pre-breakage default, so unconfigured builds are unchanged.

(Credit to the issue reporter for diagnosing the accidental type change.)

Commit 6502a67 (merge of PR ThrowTheSwitch#764) accidentally downgraded the
`extension_memory` option from `type: 'feature'` to `type: 'boolean'`
during conflict resolution. The PR itself just removed quotes around
boolean values (the Meson 1.1 deprecation fix), but its branch was
based on an older master where extension_memory was still boolean;
the merge resolution chose that stale version over master's `feature`.

meson.build still calls `build_memory.enabled()` and `.auto()`, which
are feature-option methods; on a boolean option they raise:

    ERROR: Unknown method "enabled" in object
    <[BooleanHolder] holds [bool]: False> of type BooleanHolder.

Restore the `type: 'feature', value: 'auto'` declaration that existed
on master before the merge. No change needed in meson.build; its usage
of enabled() + auto() is correct for a feature option.

Verified:
  - `meson setup` now succeeds (pre-fix: failed with the error above)
  - `meson configure -Dextension_memory=enabled` applies cleanly
  - `ninja -C build` builds libunity.a including the memory extension
@mvandervoord mvandervoord merged commit 4fe7d60 into ThrowTheSwitch:master May 22, 2026
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.

Meson invalid method called on boolean option

3 participants