Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatpak zed and vscode report slint::include_modules!(); rust-analyzer: failed to load file UNRESOLVED_ENV_VAR #5793

Closed
xiaguangbo opened this issue Aug 8, 2024 · 8 comments

Comments

@xiaguangbo
Copy link

err form slint::include_modules!();
only flatpak platform have this question. if install form .deb``.rpm``.tar.gz will normal.

@xiaguangbo xiaguangbo changed the title flatpak zed and vscode report rust-analyzer: failed to load file UNRESOLVED_ENV_VAR flatpak zed and vscode report slint::include_modules!(); rust-analyzer: failed to load file UNRESOLVED_ENV_VAR Aug 8, 2024
@ogoffart
Copy link
Member

ogoffart commented Aug 8, 2024

thanks for filing a bug report, but i'm going to need more info. What error are you seeing exactly.

@xiaguangbo
Copy link
Author

@ogoffart
screenshot-2024-08-08-07-19-28

@xiaguangbo
Copy link
Author

cargo build is can work, only editer software show err.

@ogoffart
Copy link
Member

ogoffart commented Aug 8, 2024

the include_modules uses an environment variable which is set through the slint-build crate that must be set in the build.rs. Do you call slint_build::compile in your build.rs. Maybe that is failing. There is perhaps logs from rust analyzer somewhere.

@xiaguangbo
Copy link
Author

@ogoffart
I don't know why it's right again.
this my build.rs:

fn main() {
    embuild::espidf::sysenv::output();

    slint_build::compile_with_config(
        "ui/appwindow.slint",
        slint_build::CompilerConfiguration::new()
            .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer),
    )
    .unwrap();
}

@ogoffart
Copy link
Member

ogoffart commented Aug 8, 2024

right, so this should export the env variable used by the include_modules macro. run-analyzer should have run the build script. It is possible that it fails though. Maybe rust-analyzer has a log with the result of the build script.

@xiaguangbo
Copy link
Author

xiaguangbo commented Aug 8, 2024

@ogoffart
thanks!

@Enyium
Copy link
Contributor

Enyium commented Aug 28, 2024

Running the VS Code command palette command "Developer: Reload Window" fixed this for me.

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

No branches or pull requests

3 participants