Skip to content

Commit ae3183d

Browse files
authored
Issue 69 - Add Rust extension code (#85)
* Issue 69 - Add Rust extension code - Copied in from private repo * Build rust extension by default * Fix x64 build * Another fix - set ARCH * Fix quoting * Another fix * Debugging what buildx is doing * Debugging * Fix build * More fixes * Fix docker-compose files
1 parent 9a6be11 commit ae3183d

26 files changed

+2900
-62
lines changed

.cargo/config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-unknown-linux-musl]
2+
linker = "x86_64-linux-musl-gcc"
3+
4+
[target.aarch64-unknown-linux-musl]
5+
linker = "aarch64-linux-musl-gcc"

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
target/
12
**/bin/
23
**/obj/
34
out*/

.github/workflows/build.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ jobs:
255255
build-extension:
256256
env:
257257
REGISTRY_IMAGE: public.ecr.aws/e4p3x8r3/lambda-dispatch-extension${{ github.event_name == 'pull_request' && '-dev' || '' }}
258+
ARCH: x86_64
258259

259260
permissions:
260261
contents: read
@@ -294,7 +295,9 @@ jobs:
294295
with:
295296
context: .
296297
file: ./DockerfileExtension
297-
build-args: BUILD_ARCH=linux-x64
298+
build-args: |
299+
ARCH=x86_64
300+
TARGET_PLATFORM=linux/amd64
298301
platforms: linux/amd64
299302
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
300303

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
##
44
## Get latest from `dotnet new gitignore`
55

6+
target/
7+
68
# dotenv files
79
.env
810

.rustfmt.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tab_spaces = 2

.vscode/launch.json

+29-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,34 @@
8585
"name": ".NET Core Attach",
8686
"type": "coreclr",
8787
"request": "attach"
88-
}
88+
},
89+
{
90+
"type": "lldb",
91+
"request": "launch",
92+
"name": "Debug executable 'extension'",
93+
"cargo": {
94+
"args": [
95+
"build",
96+
"--bin=extension",
97+
"--package=extension"
98+
],
99+
"filter": {
100+
"name": "extension",
101+
"kind": "bin"
102+
}
103+
},
104+
"args": [],
105+
"cwd": "${workspaceFolder}",
106+
"env": {
107+
"AWS_LAMBDA_FUNCTION_NAME": "extension",
108+
"AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "512",
109+
"AWS_LAMBDA_FUNCTION_VERSION": "$LATEST",
110+
"AWS_LAMBDA_RUNTIME_API": "http://localhost:5051",
111+
"AWS_REGION": "us-east-2",
112+
"AWS_ACCESS_KEY_ID": "test-access-key-id",
113+
"AWS_SECRET_ACCESS_KEY": "test-secret-access-key",
114+
"AWS_SESSION_TOKEN": "test-session-token"
115+
}
116+
},
89117
]
90118
}

0 commit comments

Comments
 (0)