#tauri dependency features does not match the allowlist defined

1 messages · Page 1 of 1 (latest)

kindred flume
#

So for my app I have different features activated depending on whether the app is being built on Windows or Linux/MacOS. The problem is that Tauri really doesn't like me doing this.

It's quite a simple use case that worked fine around Tauri 1.2 but no longer - I want the reqwest-native-tls-vendored on Linux/MacOS only and the updater features on Windows only.

To set this, I have the configs in the image attached as well as this:

[target.'cfg(not(any(windows, target_os = "macos")))'.dependencies.tauri]
version = "1.5.0"
features = ["devtools", "dialog", "reqwest-client", "shell-open", "reqwest-native-tls-vendored"]
 
[target.'cfg(any(windows, target_os = "macos"))'.dependencies.tauri]
version = "1.5.0"
features = ["devtools", "dialog", "reqwest-client", "shell-open", "updater"]

But the problem is that I only specify updater as being active in tauri.windows.conf.json - because that's the only time I want it. But Tauri doesn't like that.

I get the error message The ``tauri`` dependency features on the ``Cargo.toml`` file does not match the allowlist defined under ``tauri.conf.json``. and it REFUSES to build.

When I DO run cargo tauri dev like it tells me to, it adds the reqwest-native-tls-vendored to Windows and removes the updater feature from Windows.

What changed in Tauri? Why can't I specify different features for different platforms anymore? It's annoying, I can't update to new versions of Tauri.

mild lava
#

Can you open a github issue about this instead?

#

Also, what happens if you swap the lines around? I wonder if the manifest rewriter cares about the order 🤔

#

And lastly for now, as a workaround you may wanna try cargo's workspace inheritance for the tauri dependency. Changing just the version field to use the workspace version should be enough.
This will disable the rewrite logic.