Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Mar 20, 2021

This issue was attempted to fix in #13698 by escaping ) but it turned
out to be an incomplete fix, because it fixed the breaking tests then
but broke other ones instead depending on their syntax. This PR tries to
fix it correctly by using enabledelayedexpansion feature of batch
files. We can enable delayed expansion of variables within a batch file
by

@setlocal enabledelayedexpansion

And if you use variables not by the usual syntax %VAR% but !VAR!, it
is expanded in a delayed manner, after all parentheses for ifs and
elses are expanded.

This issue was attempted to fix in emscripten-core#13698 by escaping `)` but it turned
out to be an incomplete fix, because it fixed the breaking tests then
but broke other ones instead depending on their syntax. This PR tries to
fix it correctly by using `enabledelayedexpansion` feature of batch
files. We can enable delayed expansion of variables within a batch file
by
```
@SETLOCAL enabledelayedexpansion
```
And if you use variables not by the usual syntax `%VAR%` but `!VAR!`, it
is expanded in a delayed manner, after all parentheses for `if`s and
`else`s are expanded.
@aheejin aheejin requested a review from sbc100 March 20, 2021 09:17
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! thanks for figuring this out.

@aheejin aheejin merged commit 533d712 into emscripten-core:main Mar 22, 2021
@aheejin aheejin deleted the windows_paren_fix2 branch March 22, 2021 18:39
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
sbc100 added a commit that referenced this pull request May 22, 2021
Using $* inside the if/else blocks here was confusing the bat file
processor making it impossible to support commands that contains braces
and exclamation points.

There was an attempted fix made in #13723 which seemed hopefull but it
prevented the exclamation point.  Hopefully this will fix both cases.

Thanks to Mysoft on discord for the suggestion.

Fixes: #14063
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.

2 participants