Skip to content

Commit

Permalink
Zig build
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Sep 17, 2023
1 parent 9e7b43f commit 52f2f68
Show file tree
Hide file tree
Showing 19 changed files with 807 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/img/zig-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,27 @@
"mainFileBreakpointLine": 12,
"successDebugMessage": "Hello Torizon!"
}
},
{
"img": "zig-console.png",
"folder": "zigConsole",
"description": "Zig Console Application",
"runtime": "no-libc",
"language": "Zig",
"debugSSHPort": "2320",
"multiContainer": true,
"support": "Community",
"tests" : {
"debuggers": {
"local": ["Local AMD64"],
"arm": ["Torizon ARMv7"],
"arm64": ["Torizon ARMv8"]
},
"debuggerConsole": "cppdbg",
"mainFile": "src/main.zig",
"mainFileBreakpointLine": 9,
"successDebugMessage": "info(toradex): Hello Torizon!"
}
}
]
}
8 changes: 8 additions & 0 deletions zigConsole/.conf/deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages": [
"openssh-client",
"sshpass",
"zig",
"zls"
]
}
27 changes: 27 additions & 0 deletions zigConsole/.conf/id_rsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAqpUaOa6i/TaSKwpdsHzLfGK95dDcFYpmYH5hUj0cBhVEVdl8
JAG0MEDcZsjQHiBlfUiHmyU2iOWBoKUytpMnzYF6ggdZBv5hBMv3RcTlnNijxzxg
KvbjTm3LqAY8uu4SF9I8oDXVOn7xwZYgiC7s3XRGOP6TowSVEHsLB+cehWs4Y5io
3BngOlcOYZtVrh+i3A7xSHWP7n2IetJEo5C425oaOCZXUJT2egau6ODmvBItZjpG
mNdwVwrEI2H3o+LLI9t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AfJS6at
Y2xc8hkpY9k5sF6L3F0K9IhrMnYj6GzfAiJgs1gk29rCzQAWjLUi/v/zIQLHvuMy
Xwo3iUUCgYEAo/27Qkb5nOdL8sJwFggDrdB1pPrxXN20KmYCJF1P9wPDhnj1fJ7+
0Z/56XYzPA2rQx0vf5idvoGQ3KZS7QkOClLtcyevH3b38fnmAqv+dPLRHmrSd+3G
BspdMlr3rwZK8RKwXjDzLYpwSvjmf7PTGTPO3C7WTzg+m0U9RbSJKi4=
-----END RSA PRIVATE KEY-----
1 change: 1 addition & 0 deletions zigConsole/.conf/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqlRo5rqL9NpIrCl2wfMt8Yr3l0NwVimZgfmFSPRwGFURV2XwkAbQwQNxmyNAeIGV9SIebJTaI5YGgpTK2kyfNgXqCB1kG/mEEy/dFxOWc2KPHPGAq9uNObcuoBjy67hIX0jygNdU6fvHBliCILuzddEY4/pOjBJUQewsH5x6FazhjmKjcGeA6Vw5hm1WuH6LcDvFIdY/ufYh60kSjkLjbmho4JldQlPZ6Bq7o4Oa8Ei1mOkaY13BXCsQjYfej4ssj22J41/IVxQU80NFduS7VXSZdT1WNntYWKFlehvXVc0ISRjsGDdKnNOe1JGf2FkPuLfENT0xInP3SuefnogPX
6 changes: 6 additions & 0 deletions zigConsole/.conf/update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"source": ".vscode/launch.json",
"target": ".vscode/launch.json"
}
]
1 change: 1 addition & 0 deletions zigConsole/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
credentials.zip
1 change: 1 addition & 0 deletions zigConsole/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zig-*/
5 changes: 5 additions & 0 deletions zigConsole/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ziglang.vscode-zig",
]
}
211 changes: 211 additions & 0 deletions zigConsole/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Local AMD64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/zig-deploy/x86_64-linux-gnu/debug/bin/__change__",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "build-debug-amd64-local"
},
{
"name": "Torizon riscv64",
"type": "cppdbg",
"request": "launch",
"program": "~/app/__change__",
"args": [],
"stopAtEntry": false,
"cwd": "~/app",
"environment": [],
"externalConsole": false,
"sourceFileMap": {
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "ssh",
"pipeArgs": [
"-T",
"-q",
"-p",
"${config:torizon_debug_ssh_port}",
"-i",
"${workspaceFolder}/.conf/id_rsa", // ssh key path
"-o",
"StrictHostKeyChecking=no",
"-o",
"UserKnownHostsFile /dev/null",
"${config:torizon_run_as}@${config:torizon_ip}" // user@device
]
},
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "deploy-torizon-riscv64"
},
{
"name": "Torizon AMD64",
"type": "cppdbg",
"request": "launch",
"program": "~/app/__change__",
"args": [],
"stopAtEntry": false,
"cwd": "~/app",
"environment": [],
"externalConsole": false,
"sourceFileMap": {
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "ssh",
"pipeArgs": [
"-T",
"-q",
"-p",
"${config:torizon_debug_ssh_port}",
"-i",
"${workspaceFolder}/.conf/id_rsa", // ssh key path
"-o",
"StrictHostKeyChecking=no",
"-o",
"UserKnownHostsFile /dev/null",
"${config:torizon_run_as}@${config:torizon_ip}" // user@device
]
},
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "deploy-torizon-amd64"
},
{
"name": "Torizon ARMv7",
"type": "cppdbg",
"request": "launch",
"program": "~/app/__change__",
"args": [],
"stopAtEntry": false,
"cwd": "~/app",
"environment": [],
"externalConsole": false,
"sourceFileMap": {
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "ssh",
"pipeArgs": [
"-T",
"-q",
"-p",
"${config:torizon_debug_ssh_port}",
"-i",
"${workspaceFolder}/.conf/id_rsa", // ssh key path
"-o",
"StrictHostKeyChecking=no",
"-o",
"UserKnownHostsFile /dev/null",
"${config:torizon_run_as}@${config:torizon_ip}" // user@device
]
},
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "deploy-torizon-arm"
},
{
"name": "Torizon ARMv8",
"type": "cppdbg",
"request": "launch",
"program": "~/app/__change__",
"args": [],
"stopAtEntry": false,
"cwd": "~/app",
"environment": [],
"externalConsole": false,
"sourceFileMap": {
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "ssh",
"pipeArgs": [
"-T",
"-q",
"-p",
"${config:torizon_debug_ssh_port}",
"-i",
"${workspaceFolder}/.conf/id_rsa", // ssh key path
"-o",
"StrictHostKeyChecking=no",
"-o",
"UserKnownHostsFile /dev/null",
"${config:torizon_run_as}@${config:torizon_ip}" // user@device
]
},
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "deploy-torizon-arm64"
},
]
}
18 changes: 18 additions & 0 deletions zigConsole/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"torizon_psswd": "",
"torizon_login": "",
"torizon_ip": "",
"host_ip": "",
"torizon_workspace": "${workspaceFolder}",
"torizon_debug_port": "",
"torizon_debug_ssh_port": "2320",
"torizon_debug_port2": "",
"torizon_debug_port3": "",
"torizon_gpu": "",
"torizon_arch": "",
"wait_sync": "1",
"torizon_run_as": "torizon",
"torizon_app_root": "/home/torizon",
"tcb.packageName": "__change__",
"tcb.version": "early-access"
}
Loading

0 comments on commit 52f2f68

Please sign in to comment.