Skip to content

Conversation

@ilammy
Copy link
Owner

@ilammy ilammy commented May 8, 2021

As noted in the comment, repeated invocations of this action might have caused environment variables to overflow. This cute hack avoid this, allowing to reconfigure environment.

Resolves: #8 (comment)

ilammy added 3 commits May 8, 2021 17:44
As noted in the comment, repeated invocations of this action might have
caused environment variables to overflow. This cute hack avoid this,
allowing to reconfigure environment.
While this approach mostly works, I still have reservations so let's
leave some cautionary notes.
Well, let's build our "Hello, world!" four times, for four different
architectures, because why not.
@ilammy ilammy merged commit 08b850b into master May 8, 2021
@ilammy ilammy deleted the repeated-invocation branch May 8, 2021 08:54
Copy link
Contributor

@pzhlkj6612 pzhlkj6612 left a comment

Choose a reason for hiding this comment

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

Hi. I have a question about this PR.

Comment on lines -143 to +158
const old_value = old_env_vars[name]
let [name, new_value] = string.split('=')
let old_value = old_env_vars[name]
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi. The variable old_value will not be changed in each loop, why not keep on using const ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

No real reason. I just like pretty columns.

let [name, new_value] = ...
let old_value = ...

looks a bit neater than

let [name, new_value] = ...
const old_value = ...

Strictly speaking name also is unchanged so this could have been something like

const [name, new_value] = ...
const old_value = ...

let exported_value
if (isPathVariable(name)) {
    exported_value = filterPathValue(new_value)
} else {
    exported_value = new_value
}

or maybe even

const exported_value = maybeFilterPathValue(name, new_value)

where maybeFilterPathValue() inspects name and does filtering if necessary.

But this code isn't really that huge so there is no point in trying to enforce some “correct” code style.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Thank you.

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.

Random failure with error "Command failed: cmd.exe /q /c C:\Users\runneradmin\msvc-dev-cmd.bat"

3 participants