'How to set an env variable that lasts until the building finishes?

How to set an env variable using config.toml or Cargo.toml that lasts for the end of the building time.

Setting it in config.toml doesn't help because I want to use some combined values as follows.

[env]
VAR="${pwd}/d --g ${pwd}/aaa"

Note that I can't use build.rs too because I want the env var to be set until the building finishes.


I think rust devs shoulld add some more thing like build.rs but execut it before building the dependencies.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source