Latest version overwrites more environment than necessary
See original GitHub issueVersion 1.7 only set environment variables that matched certain patterns. Version 1.8 sets all variables set by vcvarsall
. This caused a failure on my application because the earlier code wouldn’t set the PLATFORM variable, but the new code does (it would set it in a case-insensitive system, since “Platform” was one of the extracted variables).
I’m not sure that the new way is worse, but I’m leaving this here in case someone else is scratching their head trying to figure out what’s up.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Upgrade or update a solution - Power Apps - Microsoft Learn
An update must have a higher major, minor, build, or revision number than the parent solution. For example, for a base solution version...
Read more >What's Wrong With The Docker :latest Tag? - vsupalov.com
Latest is Easily Overwritten By Default Latest is however the default value, which makes it both vulnerable to human mistakes and concurrent usage...
Read more >Deployment safety - GitLab Documentation
Deployment jobs are a specific kind of CI/CD job. They can be more sensitive than other jobs in a pipeline, and might need...
Read more >Managing application versions - AWS Elastic Beanstalk
Elastic Beanstalk creates an application version whenever you upload source code. This usually occurs when you create an environment or upload and deploy ......
Read more >How do I tell Maven to use the latest version of a dependency?
If a dependency on that artifact is required, you have the following ... Declare the version as LATEST (will resolve to 2.0.0) (removed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@abellgithub, uhh… Yeah, I have not foreseen such issue. I’m sorry for breaking your build. I believe you can work around this issue for now by using the 1.7 version, right?
@pzhlkj6612, on Windows environment variables are case-insensitive. So if the build already defines
PLATFORM
for its own unrelated purpose then msvc-dev-cmd would overwrite that value when it tries to setPlatform
becausevcvarsall.bat
wants that. And this will make the build upset.Well, I guess what could be useful is to have a way to give users some control over what variables this action may or may not overwrite and set. For example, like this:
or like this:
(with variable names matched case-insensitively).
That way if one needs only some variables, they can ask only for them. If one already uses some variables and would not want MSVC to overwrite them, they could achieve that too.
@pzhlkj6612, thanks for your analysis.
It slipped my mind that
Platform
was in the original list of exported variables. So it’s just pure luck thatPLATFORM
did not get overwritten in v1.7 – if I had not forgotten about case-insensitivity of the variables and coded it ‘correctly’ then it would have still been overwritten. What a weird quirk.There’s nothing to be sorry for. That’s how people learn. And you point out things that other people miss.
By the way, would you be interested in cooking a patch that lets the users to include/exclude certain variables? I think it wouldn’t hurt to have this feature, just in case. And it could be a nice exercise to implement.