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

fix(lambda-go): path with space breaks go build #28554

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-go-alpha/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class Bundling implements cdk.BundlingOptions {
const goBuildCommand: string = [
'go', 'build',
hasVendor ? '-mod=vendor': '',
'-o', `${pathJoin(outputDir, 'bootstrap')}`,
'-o', `"${pathJoin(outputDir, 'bootstrap')}"`,
`${this.props.goBuildFlags ? this.props.goBuildFlags.join(' ') : ''}`,
`${this.relativeEntryPath.replace(/\\/g, '/')}`,
].filter(c => !!c).join(' ');
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-lambda-go-alpha/test/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test('bundling', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap ./cmd/api',
'go build -o "/asset-output/bootstrap" ./cmd/api',
].join(' && '),
],
}),
Expand Down Expand Up @@ -81,7 +81,7 @@ test('bundling with file as entry', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap ./main.go',
'go build -o "/asset-output/bootstrap" ./main.go',
].join(' && '),
],
}),
Expand All @@ -102,7 +102,7 @@ test('bundling with file in subdirectory as entry', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap ./cmd/api/main.go',
'go build -o "/asset-output/bootstrap" ./cmd/api/main.go',
].join(' && '),
],
}),
Expand All @@ -123,7 +123,7 @@ test('bundling with file other than main.go in subdirectory as entry', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap ./cmd/api/api.go',
'go build -o "/asset-output/bootstrap" ./cmd/api/api.go',
].join(' && '),
],
}),
Expand Down Expand Up @@ -265,7 +265,7 @@ test('Go build flags can be passed', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap -ldflags "-s -w" ./cmd/api',
'go build -o "/asset-output/bootstrap" -ldflags "-s -w" ./cmd/api',
].join(' && '),
],
}),
Expand Down Expand Up @@ -297,7 +297,7 @@ test('AssetHashType can be specified', () => {
command: [
'bash', '-c',
[
'go build -o /asset-output/bootstrap ./cmd/api',
'go build -o "/asset-output/bootstrap" ./cmd/api',
].join(' && '),
],
}),
Expand Down
Loading