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

Custom environment variables for meson configuration #9

Closed
MathiasMagnus opened this issue Sep 9, 2019 · 7 comments · Fixed by #215
Closed

Custom environment variables for meson configuration #9

MathiasMagnus opened this issue Sep 9, 2019 · 7 comments · Fixed by #215

Comments

@MathiasMagnus
Copy link

Meson requires PKG_CONFIG_PATH to find some dependencies, and even though I setup my PS profile to include this var, I cannot set it as the default shell, as it breaks many Linux tooling. Currently I can't seem to find a way to tell the extension to include extra env vars during the configuration step.

@PikalaxALT
Copy link

Any progress on this?

@tristan957
Copy link
Contributor

This would probably be a pretty small PR if someone wanted to pick this up. I agree this would be a good nice to have.

@xclaesse
Copy link
Member

Note that in the case of PKG_CONFIG_PATH you can instead add pkg_config_path=/foo configure option.

@ptomato
Copy link
Contributor

ptomato commented Dec 10, 2023

I'd like to second this! My use case is a VSCodium session SSH'd into a Fedora Toolbox container. I'd like to be able to set the DISPLAY and DBUS_SESSION_BUS_ADDRESS environment variables when running Meson tests.

(For actually running the build product, you can set these environment variables in launch.json, but running tests doesn't take its environment variables from there. Also, I might expect it to respect the environment variables in the setting terminal.integrated.env.linux.)

I'd love to contribute this feature myself, if someone could give me a pointer on where to start. (I'm new to VSCode/VSCodium in general.) Would it be as simple as adding a configuration object to the exec() call in

await exec(extensionConfiguration("mesonPath"), ["test", "-C", buildDir, "--print-errorlog", test.id]);
?

@tristan957
Copy link
Contributor

Hello Mr. gjs :)

If you look at that exec() function, it is using child_process.execFile behind the scenes. We just wrap it into a promise. You can see that there is an env variable located there. We don't spawn the process in an integrated terminal, so that setting would not work for us.

@ptomato
Copy link
Contributor

ptomato commented Dec 15, 2023

Thanks very much! 😄

What would be a good place for the setting to live at, then? I'm not too familiar yet with VSCode so I don't really have a sense of this. Would it be a setting specific to the vscode-meson extension?

@tristan957
Copy link
Contributor

It should go in the package.json file. Should be fairly obvious where to put it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants