Repository navigation
GDExt: Allow specifying inclusion/exclusion tags - #121575
Conversation
|
Thanks! This is something we've talked about a number of times, and I think we should do it, but I'm unsure about some of the details in this PR:
So, I think there's things to discuss around how we want to expose this to users |
Ah, indeed, I messed up, I originally called it
Well, the problem is that right now the GDExtension assume you always need to export. One might argue that we should implement both filters (include/exclude) like in the export presets, but is there a use case for it?
The problem I see is that, you in fact, want to be warned by default if the library is missing most of the times. That is almost always the case so you don't create a broken export by mistake (e.g. you are exporting for an arch you forgot to compile the extension for). On the other end, the extension creator is expected to know which tags should always be excluded (e.g. web, or template, or editor, ecc). And should be able to provide custom feature tags for exclusion (e.g. I know this has been discussed multiple times, it's just been quite a few years and we still don't have a solution. I think at this point we should just be implementing something that works for the known cases (notably webrtc and git plugin) instead of trying to guess what could be needed in the future 🤷 |
Okay, I've been thinking about this a bit more. If we want to make it more flexible, covering more potential cases, we could, implement this as If the If the We also probably want to make full match of the tags, e.g.: WDYT? |
The main use-case for the include filters that has been discussed is GDExtensions that only work on iOS or Android (because they depend on platform features that only exist on those platforms). But, yeah, I don't know of any use case for using both at once, only using one at a time, so your proposal makes sense to me.
That sounds goods to me! However, I'm wondering if we want to do this as an array, rather than a string? Like: I think I'd slightly favor the array version over the string version |
f86d951 to
b088c00
Compare
|
@dsnopek I ended up calling the options In practice:
So you can for example do: This is hopefully flexible enough. |
b0a572f to
b122d96
Compare
|
This was brought up in the GDExtension meeting. I haven't followed the whole backstory, but in my opinion this feature seems useful (if niché) and should be added. I would personally choose a different syntax. There's nothing wrong with explicit inclusion/exclusion tags, so I'd be OK with those as-is. The one I'd prefer though would re-use / extend our current binary matching system. [libraries]
macos.single.debug = "./macos/libEXTENSION-NAME.macos.template_debug.dylib"
ios = noneThe files are read top to bottom, so you could make a whitelist like this: [libraries]
macos.single.debug = "./macos/libEXTENSION-NAME.macos.template_debug.dylib"
; Exclude all remaining combinations
; Would be easier if we added a wildcard, but this works:
debug = none
release = noneBut yea, like I said. Wouldn't die on that hill. |
|
Tested on macOS I'm using the godot-firebase-ios plugin in a game I'm working on, and its maintainer got the review request and asked if I could take a look. I pulled the macOS editor from this PR's CI artifacts (version string I created two copies of the plugin's demo project from upstream main, identical except that I added demo-a (no tags): demo-b (include_tags = ["ios"]): One required step was to open each project in the editor first, or both runs return a false negative. I've tested on Mac so far, still need Windows and Linux, but let me know if this was the right approach and I'll replicate it across the other platforms. Also, happy to test again if the syntax changes. |
This is useful for extensions that can be skipped when exporting for specific platforms or targets like the WebRTC extension (which on Web is part of core).
|
@Ivorforce the gdextension is a ConfigFile, so we can't add I had a branch doing something similar, but it was getting a bit messy by the way that section is parsed. This is because that section is parsed trying find "best matching tags" on a common minimum set of tags (notably platform + arch(s)). I think it's doable, just a bit complex for what we need. |
dsnopek
left a comment
There was a problem hiding this comment.
Thanks! This looks good to me :-)
|
Thanks! |
The tag filter (godotengine/godot#121575) merged 2026-08-11, four days after 4.8-dev3 was built, so no downloadable Godot build reads include_tags yet. Saying "Godot 4.8" sent a reporter to 4.8-dev3 expecting silence (issue #366). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
GDExt: Allow specifying inclusion/exclusion tags
The Godot setup guide said only Windows and Linux editors log "No GDExtension library found for current OS and architecture". The release zip ships an iOS-only `.gdextension` (`include_tags = ["ios"]`, one `ios.arm64` library, no `bin/macos`), so a macOS editor takes the same path — reported on #366. The section now covers all three desktops, names 4.8-dev4 as the first Godot build that reads `include_tags` and skips the extension silently (its loader is 331 commits past the godotengine/godot#121575 merge; 4.7 and 4.8-dev3 print the error at loader line 369), and corrects why the file must be restored before an iOS export: the plugin's own export hook embeds the frameworks, and the `.gdextension` is what lets Godot discover and load the extension. The anchor id is unchanged because #366 links to it. No recording: the change is one prose section. Rendered text checked in the dev server at `/docs/setup/godot#gdextension-non-apple-editor`. Checks: docs prettier, typecheck + build, audit:docs, audit:release-state, git diff --check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Expanded macOS damaged-framework guidance to cover release ZIP archives containing macOS frameworks. - Updated GDExtension troubleshooting for Windows, Linux, and macOS editors. - Clarified Android and iOS behavior, including that the release extension is iOS-only. - Documented `include_tags = ["ios"]` support in Godot 4.8-dev4 and later. - Broadened filename workaround guidance to non-iOS development while noting that macOS-capable packages are exempt. - Scoped the desktop editor warning to Godot 4.8-dev3 and earlier. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
What problem(s) does this PR solve?
webrtc.gdextensionwhen exporting on Web webrtc-native#182 .Additional information
This is useful for extensions that can be skipped on specific platforms like the WebRTC extension (which on Web is part of core), so users don't have to manually add the exclusion for specific export presets..
See also: godotengine/webrtc-native#194