Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda-go-alpha: go build breaks with spaces in path #28555

Closed
longtv2222 opened this issue Jan 3, 2024 · 1 comment · Fixed by #28554
Closed

lambda-go-alpha: go build breaks with spaces in path #28555

longtv2222 opened this issue Jan 3, 2024 · 1 comment · Fixed by #28554
Labels
@aws-cdk/aws-lambda-go bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@longtv2222
Copy link
Contributor

longtv2222 commented Jan 3, 2024

Describe the bug

Path with space breaks go build

Expected Behavior

go build completes sucessfully

Current Behavior

go build is failing

Stack trace:

> cdk synth

C:\Users\Long Viet Ta\git\work\cdk-test\lambda function
Bundling asset cdk-route-53-test-stack/GoFunction/Code/Stage...
go build -o C:\Users\Long Viet Ta\git\work\cdk-test\cdk.out\bundling-temp-b9e04c81c84f386d3b5ad1bd760e90d6db81a132ee3efa8c7bdbc23e0dce2635\bootstrap ./
package Viet is not in std (C:\Program Files\Go\src\Viet)
package Ta/git/work/cdk-test/cdk.out/bundling-temp-b9e04c81c84f386d3b5ad1bd760e90d6db81a132ee3efa8c7bdbc23e0dce2635/bootstrap is not in std (C:\Program Files\Go\src\Ta\git\work\cdk-test\cdk.out\bundling-temp-b9e04c81c84f386d3b5ad1bd760e90d6db81a132ee3efa8c7bdbc23e0dce2635\bootstrap)

Reproduction Steps

import * as cdk from "aws-cdk-lib";
import { GoFunction } from "@aws-cdk/aws-lambda-go-alpha";
import { Construct } from "constructs"
import * as path from "path";

export class CdkTestStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const entry = path.join(__dirname, "..", "lambda function")
    console.log(entry) // Outputting: C:\Users\My Name\git\work\cdk-test\lambda
    new GoFunction(this, "GoFunction", {
      entry
    });
  }
}

Possible Solution

Quoting go build output, currently, it looks like:

go build -o C:\Users\Long Viet Ta\git\work\cdk-test\cdk.out\bundling-temp-b9e04c81c84f386d3b5ad1bd760e90d6db81a132ee3efa8c7bdbc23e0dce2635\bootstrap ./

The fix add quotes to output, which looks like:

go build -o "C:\Users\Long Viet Ta\git\work\cdk-test\cdk.out\bundling-temp-b9e04c81c84f386d3b5ad1bd760e90d6db81a132ee3efa8c7bdbc23e0dce2635\bootstrap" ./

PR: #28554

Additional Information/Context

No response

CDK CLI Version

2.110.1

Framework Version

No response

Node.js Version

18.17.1

OS

Window

Language

TypeScript

Language Version

5.2.2

Other information

No response

@longtv2222 longtv2222 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 3, 2024
@longtv2222 longtv2222 changed the title aws-lambda-go-alpha: go build breaks with spaces in path lambda-go-alpha: go build breaks with spaces in path Jan 3, 2024
@mergify mergify bot closed this as completed in #28554 Jan 3, 2024
mergify bot pushed a commit that referenced this issue Jan 3, 2024
Output path with space breaks go build

Solution: quoting `go build` output path

Closes #28555

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

github-actions bot commented Jan 3, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

paulhcsun pushed a commit to paulhcsun/aws-cdk that referenced this issue Jan 5, 2024
Output path with space breaks go build

Solution: quoting `go build` output path

Closes aws#28555

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-go bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant