The --msbuild-parameters flag is performing incorrectly when spawned by child_process #1922
Labels
bug
This issue is a bug.
module/lambda-client-lib
p2
This is a standard priority issue
s
Effort estimation: small
Describe the bug
This is a duplicate of aws/aws-extensions-for-dotnet-cli#358, I just thought this might be a better place for the issue. Feel free to close either of these to avoid duplicates.
I am executing the following command via a JS Github Action:
I need the ability to pass multiple arguments via msbuild-parameters flag and thus I've encapsulated them into double quotes as requested by the help manual. Both --no-restore and --no-build here are appended as a single command-line argument and are not parsed by dotnet correctly, instead being set on MSBuild call and failing the execution.
A minimal example looks like this:
https://github.com/Levelleor/test-net-lambda-tool/blob/main/.github/workflows/ci.yaml
Here is an unsuccessful execution:
https://github.com/Levelleor/test-net-lambda-tool/actions/runs/12511014146/job/34902532872#step:5:30
It tries to run this command:
/usr/share/dotnet/dotnet lambda package --output-package package.zip --msbuild-parameters "--no-restore --no-build"
But fails with this error:
Regression Issue
Expected Behavior
I expect this to be called:
Current Behavior
I get this result instead:
.NET isn't parsing --no-restore and --no-build because it didn't recognize them and thus it passed these down to msbuild it seems like.
Reproduction Steps
Try invoking the lambda tool via JS while setting multiple msbuild parameters.
A minimal example looks like this:
https://github.com/Levelleor/test-net-lambda-tool/blob/main/.github/workflows/ci.yaml
Here is an unsuccessful execution:
https://github.com/Levelleor/test-net-lambda-tool/actions/runs/12511014146/job/34902532872#step:5:30
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Package Id Version Commands
amazon.lambda.tools 5.12.3 dotnet-lambda
Targeted .NET Platform
.NET 8
Operating System and version
RHEL9
The text was updated successfully, but these errors were encountered: