Skip to content

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Jul 15, 2025

This PR properly sets the environment variables that cargo sets when it cargo runs your app.

This fixes the bevy use case where they rely on CARGO_MANIFEST_DIR being set to locate the asset folder.

To capture the environment, we simply extract the env vars prefixed with CARGO_ from the RUSTCWRAPPER. Previously, we weren't wrapping cargo, so implementing this would've been super annoying, but now that we do, it was a quite easy fix.

Note that dioxus itself relies on CARGO_MANIFEST_DIR not being set in some cases and I haven't tested those yet.

The only case we rely on it is as a fallback when DIOXUS_CLI_ENABLED=false

@jkelleyrtp jkelleyrtp requested a review from a team as a code owner July 15, 2025 19:52
@jkelleyrtp jkelleyrtp merged commit 57dba19 into main Jul 15, 2025
37 of 38 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/expose-cargo-manifest-dir branch July 15, 2025 21:27
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.

1 participant