Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: dotnet/android#5044 (comment)
Context: https://docs.microsoft.com/visualstudio/msbuild/exec-task

An env var can break the build such as running the following powershell:

> $env:FOO="`nFoo.cs(123,1) error: oh dear!"

A \n new line in the string is required to hit an issue.

This results in a confusing build error:

(_BuildJava target) ->
    EXEC : Foo.cs(123,1) error : oh dear!

gradlew -d emits every environment variable, and if there is a line
that looks like an MSBuild error it will emit the error. We can set
IgnoreStandardErrorWarningFormat="true" to disable this behavior.

This could commonly happen on CI systems, if a commit message contains
an error message.

In the case of Azure DevOps, %BUILD_SOURCEVERSIONMESSAGE% will
contain the full commit message.

I also fixed the _CleanJava target that was not running at all.
java-source-utils.csproj now properly cleans now.

Context: dotnet/android#5044 (comment)
Context: https://docs.microsoft.com/visualstudio/msbuild/exec-task

An env var can break the build such as running the following powershell:

    > $env:FOO="`nFoo.cs(123,1) error: oh dear!"

A `\n` new line in the string is required to hit an issue.

This results in a confusing build error:

    (_BuildJava target) ->
        EXEC : Foo.cs(123,1) error : oh dear!

`gradlew -d` emits every environment variable, and if there is a line
that looks like an MSBuild error it will emit the error. We can set
`IgnoreStandardErrorWarningFormat="true"` to disable this behavior.

This could commonly happen on CI systems, if a commit message contains
an error message.

In the case of Azure DevOps, `%BUILD_SOURCEVERSIONMESSAGE%` will
contain the full commit message.

I also fixed the `_CleanJava` target that was not running at all.
`java-source-utils.csproj` now properly cleans now.
@jonpryor jonpryor merged commit a98c1ae into dotnet:master Sep 8, 2020
@jonathanpeppers jonathanpeppers deleted the gradle-env-vars branch September 8, 2020 17:38
@jpobst jpobst added this to the 11.1 (16.9 / 8.9) milestone Sep 22, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants