diff --git a/README.md b/README.md index e251a964e..4a01315e2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository maintains the templates used in conjunction with the [VS Code To | ------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/cppconsole.png?raw=true) | C++ Console Application | libc | C++ | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/riscv64.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [cppConsole](./cppConsole) | | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/qt6qml.png?raw=true) | C++ Qt 6 QML Application | Qt 6 | C++ / QML | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true)  ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [cppQML](./cppQML) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/dotnetconsole.png?raw=true) | .NET 6 C# Console Application | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true)  ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [dotnetConsole](./dotnetConsole) | +| ![](assets/img/dotnetconsole.png?raw=true) | .NET 6 C# Console Application | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true)  ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [dotnetConsole](./dotnetConsole) | | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/unogtk.png?raw=true) | .NET 6 C# Uno Platform Skia.GTK | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true)  ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [dotnetUno](./dotnetUno) | | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/aspnetblazor.png?raw=true) | ASP.NET 6 Blazor Application | ASP.NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true)  ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/x8664.png?raw=true) | [aspnetBlazor](./aspnetBlazor) | | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/python3console.png?raw=true) | Python 3 Console Application | Python 3 | Python 3 | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [python3Console](./python3Console) | @@ -25,8 +25,8 @@ Partner templates are contributions that come from [Toradex partner network](htt | TEMPLATE | DESCRIPTION | RUNTIME | LANGUAGE | HW ARCH | FOLDER | | ---------------------------------------------------------------------------------------------------- | ---------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/slint-cpp.png?raw=true) | C++ Slint Application | Slint 1.0 | C++ | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [cppSlint](./cppSlint) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/slint-rust.png?raw=true) | Rust Slint Application | Slint 1.0 | Rust | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [rustSlint](./rustSlint) | +| ![](assets/img/slint-cpp.png?raw=true) | C++ Slint Application | Slint 1.0 | C++ | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [cppSlint](./cppSlint) | +| ![](assets/img/slint-rust.png?raw=true) | Rust Slint Application | Slint 1.0 | Rust | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [rustSlint](./rustSlint) | @@ -44,13 +44,14 @@ We encourage you to also contribute templates. The community supported templates | TEMPLATE | DESCRIPTION | RUNTIME | LANGUAGE | HW ARCH | FOLDER | CONTRIBUTOR | | ------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:-------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/rust-console.png?raw=true) | Rust Console Application | libc | Rust | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [rustConsole](./rustConsole) | ![](https://avatars.githubusercontent.com/u/19845403?v=4)[@skkywalker](https://www.github.com/skkywalker) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/jframe.png?raw=true) | Java Swing JFrame Application | JRE | Java | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [javaForms](./javaForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/nodejsts.png?raw=true) | Node.js TypeScript Application | Node.js | TypeScript | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [nodeJSTypeScript](./nodeJSTypeScript) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/electronjs.png?raw=true) | Node.js JavaScript Electron Application | Electron | JavaScript | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [nodeElectron](./nodeElectron) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/monowinforms.png?raw=true) | Mono 4.7 C# Windows Forms Application | .NET 4.7 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [monoCsharpForms](./monoCsharpForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/unofbdrm.png?raw=true) | .NET 6 C# Uno Platform Frame Buffer | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [dotnetUnoFrameBuffer](./dotnetUnoFrameBuffer) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/avaloniafbdrm.png?raw=true) | .NET 6 C# Avalonia Frame Buffer DRM | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [dotnetAvaloniaFrameBuffer](./dotnetAvaloniaFrameBuffer) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/avaloniagtk.png?raw=true) | .NET 6 C# Avalonia GTK MVVM | .NET 6.0 | C# | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [dotnetAvalonia](./dotnetAvalonia) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/gambasform.png?raw=true) | Gambas3 Form Project | Gambas3 | Visual Basic | ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/dev/assets/img/arm64.png?raw=true) | [gambasForms](./gambasForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | -| ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/python3console.png?raw=true) | Python 3 Pyside 2(Qt5) QML | Pyside 2 | Python 3 | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm64.png?raw=true) | [python3Pyside2QML](./python3Pyside2QML) | ![](https://avatars.githubusercontent.com/u/83607022?v=4) [@andreriesco](https://www.github.com/andreriesco) | +| ![](assets/img/rust-console.png?raw=true) | Rust Console Application | libc | Rust | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [rustConsole](./rustConsole) | ![](https://avatars.githubusercontent.com/u/19845403?v=4)[@skkywalker](https://www.github.com/skkywalker) | +| ![](assets/img/jframe.png?raw=true) | Java Swing JFrame Application | JRE | Java | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [javaForms](./javaForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/nodejsts.png?raw=true) | Node.js TypeScript Application | Node.js | TypeScript | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [nodeJSTypeScript](./nodeJSTypeScript) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/electronjs.png?raw=true) | Node.js JavaScript Electron Application | Electron | JavaScript | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [nodeElectron](./nodeElectron) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/monowinforms.png?raw=true) | Mono 4.7 C# Windows Forms Application | .NET 4.7 | C# | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [monoCsharpForms](./monoCsharpForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/unofbdrm.png?raw=true) | .NET 6 C# Uno Platform Frame Buffer | .NET 6.0 | C# | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [dotnetUnoFrameBuffer](./dotnetUnoFrameBuffer) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/avaloniafbdrm.png?raw=true) | .NET 6 C# Avalonia Frame Buffer DRM | .NET 6.0 | C# | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [dotnetAvaloniaFrameBuffer](./dotnetAvaloniaFrameBuffer) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/avaloniagtk.png?raw=true) | .NET 6 C# Avalonia GTK MVVM | .NET 6.0 | C# | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [dotnetAvalonia](./dotnetAvalonia) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](assets/img/gambasform.png?raw=true) | Gambas3 Form Project | Gambas3 | Visual Basic | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [gambasForms](./gambasForms) | ![](https://avatars.githubusercontent.com/u/2633321?v=4) [@microhobby](https://www.github.com/microhobby) | +| ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/python3console.png?raw=true) | Python 3 Pyside 2(Qt5) QML | Pyside 2 | Python 3 | ![](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [python3Pyside2QML](./python3Pyside2QML) | ![](https://avatars.githubusercontent.com/u/83607022?v=4) [@andreriesco](https://www.github.com/andreriesco) | +![](assets/img/zig-console.png?raw=true) | Zig Console Application | no-libc | Zig | ![](assets/img/arm32.png?raw=true) ![](assets/img/arm64.png?raw=true) | [zigConsole](./zigConsole) | ![](https://avatars.githubusercontent.com/u/6756180?v=4)[@kassane](https://www.github.com/kassane) | diff --git a/assets/img/zig-console.png b/assets/img/zig-console.png new file mode 100644 index 000000000..3c637500d Binary files /dev/null and b/assets/img/zig-console.png differ diff --git a/templates.json b/templates.json index a5c6b988d..26c0660e6 100644 --- a/templates.json +++ b/templates.json @@ -416,6 +416,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!" + } } ] } diff --git a/zigConsole/.conf/deps.json b/zigConsole/.conf/deps.json new file mode 100644 index 000000000..056e6750f --- /dev/null +++ b/zigConsole/.conf/deps.json @@ -0,0 +1,8 @@ +{ + "packages": [ + "openssh-client", + "sshpass", + "zig", + "zls" + ] +} diff --git a/zigConsole/.conf/id_rsa b/zigConsole/.conf/id_rsa new file mode 100644 index 000000000..af98f44ff --- /dev/null +++ b/zigConsole/.conf/id_rsa @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAqpUaOa6i/TaSKwpdsHzLfGK95dDcFYpmYH5hUj0cBhVEVdl8 +JAG0MEDcZsjQHiBlfUiHmyU2iOWBoKUytpMnzYF6ggdZBv5hBMv3RcTlnNijxzxg +KvbjTm3LqAY8uu4SF9I8oDXVOn7xwZYgiC7s3XRGOP6TowSVEHsLB+cehWs4Y5io +3BngOlcOYZtVrh+i3A7xSHWP7n2IetJEo5C425oaOCZXUJT2egau6ODmvBItZjpG +mNdwVwrEI2H3o+LLI9tieNfyFcUFPNDRXbku1V0mXU9VjZ7WFihZXob11XNCEkY7 +Bg3SpzTntSRn9hZD7i3xDU9MSJz90rnn56ID1wIDAQABAoIBACI239i7/3Mcc/rw +DFSu4z2irIYg+1PSu7AVCT4uhaVutJMnmS+7q8GV8N8o3h18z/5uAs0KjMKuje6D +1AUsxOoCU2krQh8V/K2yn3k+AfQQu+DlakCT3onHmfassZeo0rY2c/SKd6dQ+Pqk +Owg1qUrN3Jvn7ALhk2iH1XGTWNrXj44AxVVhK3zADd/688stubo+mhj1vLJvk3IJ +j/cb9UtCnWDZ6U6E4C+5tfXqzrqbtlrWnIBe0qAwYI6+f4bSQxnNa42wNUh0v0mX +tiY9wnHEmE7nCQNQ8sBeBLEJm3xmFRhABNA+iAglsjfeBIbPNpy7rXty412CmHp0 +mLG0RskCgYEA4t4Ca3EDq/scg7fiplLjhk2AtsZumkYT/N+42x4VlioKfoaivLKf +6mjWUSr+c7Aq0Ssx9GdOFU0epNGbuvymCGBhq6v27SADMJTP2Dmg83FpcV6opOUM +SBz1tnrL9j74Eo9jGdnBjgxHOl4biO+uCjCZxcLoVjsfPpGnCeNSpFUCgYEAwHzM +GfiBR9wl+7cVrtP4YQgmzyZ6YCnqkfFasVAe6cN/0if5sqQRn3Fg3YFrP9GlKkkn +EMvow56nTWUmpx4KG4yanrocEYIsA4uv4kwyFOC/YD+67SQpgTEOjD0seDJoOgpz +ekkxNjMro8RJCK+DrV17qk3/dGY4b3u2M66P03sCgYEAhHCcswJX5WeD/vUzkGtl +PfsywADZgqCUfJRSg0Bt06sZU0Hf8Q7KQnsPWnUh9IGMjW2NDSPdtpu93vQq2J8z +gkJZ4nFShp2gnxTQvWbvKg80QiXDh/fbEqItY2kOduPNyHACp42y6+0JC+7yXh+l +13cF3ihpoCWFmO5IuIIHtb0CgYEAk5acwEUEi17HWOuWmog4591iNG8iYd2B2Akh +Ktdt/HtD5JV2JX0bbg924CA9ZZ+Pbo7Mf1p5zJQ3X2Zxbq3fviPe4ll88AfJS6at +Y2xc8hkpY9k5sF6L3F0K9IhrMnYj6GzfAiJgs1gk29rCzQAWjLUi/v/zIQLHvuMy +Xwo3iUUCgYEAo/27Qkb5nOdL8sJwFggDrdB1pPrxXN20KmYCJF1P9wPDhnj1fJ7+ +0Z/56XYzPA2rQx0vf5idvoGQ3KZS7QkOClLtcyevH3b38fnmAqv+dPLRHmrSd+3G +BspdMlr3rwZK8RKwXjDzLYpwSvjmf7PTGTPO3C7WTzg+m0U9RbSJKi4= +-----END RSA PRIVATE KEY----- diff --git a/zigConsole/.conf/id_rsa.pub b/zigConsole/.conf/id_rsa.pub new file mode 100644 index 000000000..86f8fe63f --- /dev/null +++ b/zigConsole/.conf/id_rsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqlRo5rqL9NpIrCl2wfMt8Yr3l0NwVimZgfmFSPRwGFURV2XwkAbQwQNxmyNAeIGV9SIebJTaI5YGgpTK2kyfNgXqCB1kG/mEEy/dFxOWc2KPHPGAq9uNObcuoBjy67hIX0jygNdU6fvHBliCILuzddEY4/pOjBJUQewsH5x6FazhjmKjcGeA6Vw5hm1WuH6LcDvFIdY/ufYh60kSjkLjbmho4JldQlPZ6Bq7o4Oa8Ei1mOkaY13BXCsQjYfej4ssj22J41/IVxQU80NFduS7VXSZdT1WNntYWKFlehvXVc0ISRjsGDdKnNOe1JGf2FkPuLfENT0xInP3SuefnogPX \ No newline at end of file diff --git a/zigConsole/.conf/update.json b/zigConsole/.conf/update.json new file mode 100644 index 000000000..1da61ec5c --- /dev/null +++ b/zigConsole/.conf/update.json @@ -0,0 +1,6 @@ +[ + { + "source": ".vscode/launch.json", + "target": ".vscode/launch.json" + } +] diff --git a/zigConsole/.dockerignore b/zigConsole/.dockerignore new file mode 100644 index 000000000..91ac1b8f8 --- /dev/null +++ b/zigConsole/.dockerignore @@ -0,0 +1 @@ +credentials.zip diff --git a/zigConsole/.gitignore b/zigConsole/.gitignore new file mode 100644 index 000000000..f3162a29f --- /dev/null +++ b/zigConsole/.gitignore @@ -0,0 +1 @@ +zig-*/ \ No newline at end of file diff --git a/zigConsole/.vscode/extensions.json b/zigConsole/.vscode/extensions.json new file mode 100644 index 000000000..b4544feae --- /dev/null +++ b/zigConsole/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ziglang.vscode-zig", + ] +} diff --git a/zigConsole/.vscode/launch.json b/zigConsole/.vscode/launch.json new file mode 100644 index 000000000..885eac578 --- /dev/null +++ b/zigConsole/.vscode/launch.json @@ -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" + }, + ] +} diff --git a/zigConsole/.vscode/settings.json b/zigConsole/.vscode/settings.json new file mode 100644 index 000000000..950f3b456 --- /dev/null +++ b/zigConsole/.vscode/settings.json @@ -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" +} diff --git a/zigConsole/.vscode/tasks.json b/zigConsole/.vscode/tasks.json new file mode 100644 index 000000000..7931e2d0d --- /dev/null +++ b/zigConsole/.vscode/tasks.json @@ -0,0 +1,192 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build-debug-amd64", + "detail": "Builds the project for the remote amd64 target", + "command": "zig", + "type": "shell", + "args": [ + "build" + ], + "problemMatcher": [ + { + "owner": "zig", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(\\d+):(\\d+)\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "endLine": 4, + "endColumn": 5, + "severity": 6, + "message": 7 + } + } + ], + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + }, + "dependsOrder": "sequence" + }, + { + "label": "build-debug-arm64", + "detail": "Builds the project for the remote arm64 target", + "command": "DOCKER_HOST=", + "type": "shell", + "args": [ + "docker", + "run", + "--rm", + "-it", + "-v", + "${workspaceFolder}:/app", + "cross-toolchain-arm64-__container__", + "zig", + "build", + "-Dtarget", + "aarch64-linux-gnu" + ], + "problemMatcher": [ + { + "owner": "zig", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(\\d+):(\\d+)\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "endLine": 4, + "endColumn": 5, + "severity": 6, + "message": 7 + } + } + ], + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + }, + "dependsOrder": "sequence", + "dependsOn": [ + "build-container-image-sdk-arm64" + ] + }, + { + "label": "deploy-torizon-arm64", + "detail": "", + "hide": true, + "command": "scp", + "type": "process", + "args": [ + "-i", + "${workspaceFolder}/.conf/id_rsa", + "-o", + "UserKnownHostsFile=/dev/null", + "-o", + "StrictHostKeyChecking=no", + "-P", + "${config:torizon_debug_ssh_port}", + "-pr", + "${workspaceFolder}/zig-deploy/aarch64-linux-gnu/debug/bin", + "${config:torizon_run_as}@${config:torizon_ip}:~/app" + ], + "dependsOn": [ + "copy-docker-compose", + "pre-cleanup-arm64", + "build-debug-arm64", + "build-container-torizon-debug-arm64", + "push-container-torizon-debug-arm64", + "pull-container-torizon-debug-arm64", + "run-container-torizon-debug-arm64", + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + }, + { + "label": "build-debug-arm", + "detail": "Builds the project for the remote arm target", + "command": "DOCKER_HOST=", + "type": "shell", + "args": [ + "docker", + "run", + "--rm", + "-it", + "-v", + "${workspaceFolder}:/app", + "cross-toolchain-arm-__container__", + "zig", + "build", + "-Dtarget", + "arm-linux-gnu" + ], + "problemMatcher": [ + { + "owner": "zig", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(\\d+):(\\d+)\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "endLine": 4, + "endColumn": 5, + "severity": 6, + "message": 7 + } + } + ], + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + }, + "dependsOrder": "sequence", + "dependsOn": [ + "build-container-image-sdk-arm" + ] + }, + { + "label": "deploy-torizon-arm", + "detail": "", + "hide": true, + "command": "scp", + "type": "process", + "args": [ + "-i", + "${workspaceFolder}/.conf/id_rsa", + "-o", + "UserKnownHostsFile=/dev/null", + "-o", + "StrictHostKeyChecking=no", + "-P", + "${config:torizon_debug_ssh_port}", + "-pr", + "${workspaceFolder}/zig-deploy/arm-linux-gnu/debug/bin", + "${config:torizon_run_as}@${config:torizon_ip}:~/app" + ], + "dependsOn": [ + "copy-docker-compose", + "pre-cleanup-arm", + "build-debug-arm", + "build-container-torizon-debug-arm", + "push-container-torizon-debug-arm", + "pull-container-torizon-debug-arm", + "run-container-torizon-debug-arm", + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + } + ], + "inputs": [] +} diff --git a/zigConsole/Dockerfile b/zigConsole/Dockerfile new file mode 100644 index 000000000..24e1f6cb3 --- /dev/null +++ b/zigConsole/Dockerfile @@ -0,0 +1,106 @@ +ARG CROSS_SDK_BASE_TAG=3.0.9-bookworm +ARG BASE_VERSION=3.0.8-bookworm +## +# Board architecture +# arm or arm64 +## +ARG IMAGE_ARCH= + +## +# Application Name +## +ARG APP_EXECUTABLE=__change__ + + +# BUILD ------------------------------------------------------------------------ +FROM torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} As Build + +ARG IMAGE_ARCH +ARG COMPILER_ARCH +ENV IMAGE_ARCH ${IMAGE_ARCH} +ARG HOST_ARCH +ARG TARGET + +# __deps__ +RUN apt-get -q -y update && \ + apt-get -q -y install \ + wget \ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + # __torizon_packages_dev_start__ + # __torizon_packages_dev_end__ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + && \ + apt-get clean && apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* +# __deps__ + +RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \ + HOST_ARCH=aarch64 ; \ + elif [ "$IMAGE_ARCH" = "amd64" ] ; then \ + HOST_ARCH=x86_64 ; \ + fi + +# Install Zig 0.11.0 (uses LLVM-16.0.6) +RUN wget -q https://github.com/marler8997/zigup/releases/download/v2023_07_27/zigup.ubuntu-latest-${HOST_ARCH}.zip && \ + unzip zigup.ubuntu-latest-${HOST_ARCH}.zip -d /usr/bin && \ + chmod +x /usr/bin/zigup && \ + zigup 0.11.0 + +ARG UNAME=ziguana +ARG UID=1000 +ARG GID=1000 +RUN groupadd -g $GID -o $UNAME +RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME + +USER $UNAME + +# default linux-libc: host - glibc (most), cross-compilation - musl (static) +# zig pure-code (no ffi), no need libc linking + +# for glibc choose version: +# e.g.: -Dtarget=$TARGET-gnu.2.20 (my host has 2.36 [default], but my target use old version) +# for cross-compilation to glibc, use minimum version (2.19) supported. + +# C++: zig uses llvm-libcxx/abi + llvm-unwind on almost all (LLVM)targets. [builtin static-linking] + +RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \ + TARGET=aarch64-linux-gnu; \ + elif [ "$IMAGE_ARCH" = "arm" ] ; then \ + TARGET=arm-linux-gnu; \ + elif [ "$IMAGE_ARCH" = "amd64" ] ; then \ + TARGET=x86_64-linux-gnu; \ + fi + +WORKDIR /app +COPY . /app + +# zig optimizers: +# (Debug | ReleaseSafe) w/ dbg-info + runtime stacktrace (compiler safety), +# (ReleaseSmall | ReleaseFast) no runtime stacktrace (undefined & fast) +RUN zig build -Doptimize=ReleaseSmall -Dtarget=$TARGET && \ + mkdir -p target/deploy && \ + cp zig-deploy/$TARGET/release/bin/$APP_EXECUTABLE target/deploy + +# BUILD ------------------------------------------------------------------------ + +# DEPLOY ------------------------------------------------------------------------ +FROM --platform=linux/${IMAGE_ARCH} torizon/debian:${BASE_VERSION} AS Deploy + +ARG IMAGE_ARCH +ARG APP_EXECUTABLE +ENV APP_EXECUTABLE ${APP_EXECUTABLE} + +RUN apt-get -y update && apt-get install -y --no-install-recommends \ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + # __torizon_packages_prod_start__ + # __torizon_packages_prod_end__ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* + +# copy the build +COPY --from=Build /app/target/deploy/${APP_EXECUTABLE} /usr/bin/${APP_EXECUTABLE} + +# ADD YOUR ARGUMENTS HERE +CMD ${APP_EXECUTABLE} + +# DEPLOY ------------------------------------------------------------------------ diff --git a/zigConsole/Dockerfile.debug b/zigConsole/Dockerfile.debug new file mode 100644 index 000000000..44e04d9aa --- /dev/null +++ b/zigConsole/Dockerfile.debug @@ -0,0 +1,94 @@ +# ARGUMENTS -------------------------------------------------------------------- +## +# Board architecture +## +ARG IMAGE_ARCH= +# For armv7 use: +#ARG IMAGE_ARCH=arm + +## +# Base container version +## +ARG BASE_VERSION=3.0.8-bookworm + +## +# Application Name +## +ARG APP_EXECUTABLE=app + +## +# Debug port +## +ARG SSH_DEBUG_PORT= + +## +# Run as +## +ARG SSHUSERNAME= + +# BUILD ------------------------------------------------------------------------ +## +# Deploy Step +## +FROM --platform=linux/${IMAGE_ARCH} \ + torizon/debian:${BASE_VERSION} AS Debug + +ARG IMAGE_ARCH +ARG SSH_DEBUG_PORT +ARG APP_EXECUTABLE +ARG SSHUSERNAME +ENV APP_EXECUTABLE ${APP_EXECUTABLE} + +# SSH for remote debug +EXPOSE ${SSH_DEBUG_PORT} + +# Make sure we don't get notifications we can't answer during building. +ENV DEBIAN_FRONTEND="noninteractive" + +# your regular RUN statements here +# Install required packages +RUN apt-get -q -y update && \ + apt-get -q -y install \ + openssl \ + openssh-server \ + rsync \ + file \ + curl \ + gdb && \ + apt-get clean && apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* + +# automate for torizonPackages.json +RUN apt-get -q -y update && \ + apt-get -q -y install \ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + # __torizon_packages_dev_start__ + # __torizon_packages_dev_end__ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + && \ + apt-get clean && apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* + +# ⚠️ DEBUG PURPOSES ONLY!! +# copies RSA key to enable SSH login for user +COPY .conf/id_rsa.pub /id_rsa.pub + +# create folders needed for the different components +# configures SSH access to the container and sets environment by default +RUN mkdir /var/run/sshd && \ + sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' \ + -i /etc/pam.d/sshd && \ + if test $SSHUSERNAME != root ; \ + then mkdir -p /home/$SSHUSERNAME/.ssh ; \ + else mkdir -p /root/.ssh ; fi && \ + if test $SSHUSERNAME != root ; \ + then cp /id_rsa.pub /home/$SSHUSERNAME/.ssh/authorized_keys ; \ + else cp /id_rsa.pub /root/.ssh/authorized_keys ; fi && \ + echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config && \ + echo "Port ${SSH_DEBUG_PORT}" >> /etc/ssh/sshd_config && \ + su -c "env" $SSHUSERNAME > /etc/environment + +RUN rm -r /etc/ssh/ssh*key && \ + dpkg-reconfigure openssh-server + +CMD [ "/usr/sbin/sshd", "-D" ] diff --git a/zigConsole/Dockerfile.sdk b/zigConsole/Dockerfile.sdk new file mode 100644 index 000000000..3090ab386 --- /dev/null +++ b/zigConsole/Dockerfile.sdk @@ -0,0 +1,34 @@ +# ARGUMENTS -------------------------------------------------------------------- +ARG CROSS_SDK_BASE_TAG=3.0.9-bookworm + +## +# Board architecture +# arm or arm64 +## +ARG IMAGE_ARCH= + + +# BUILD ------------------------------------------------------------------------ +FROM torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} + +# __deps__ +RUN apt-get -q -y update && \ + apt-get -q -y install \ + # ADD YOUR PACKAGES HERE + && \ + apt-get clean && apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* +# __deps__ + +# automate for torizonPackages.json +RUN apt-get -q -y update && \ + apt-get -q -y install \ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + # __torizon_packages_dev_start__ + # __torizon_packages_dev_end__ +# DO NOT REMOVE THIS LABEL: this is used for VS Code automation + && \ + apt-get clean && apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app diff --git a/zigConsole/build.zig b/zigConsole/build.zig new file mode 100644 index 000000000..f042b07d6 --- /dev/null +++ b/zigConsole/build.zig @@ -0,0 +1,43 @@ +const std = @import("std"); +const Path = std.Build.LazyPath; + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const mode = switch (optimize) { + .ReleaseFast, .ReleaseSafe, .ReleaseSmall => "release", + else => "debug", + }; + const triple_target = target.linuxTriple(b.allocator) catch &.{}; + + const binary = b.addExecutable(.{ + .name = "__change__", + .root_source_file = Path.relative("src/main.zig"), + // or (implicit LazyPath struct, w/ path field) + // .root_source_file = .{ .path = "src/main.zig" }, + .target = target, + .optimize = optimize, + }); + + // build C and/or C++ + + // Need use libc to C code build? uncomment below + + // binary.addIncludePath(Path.relative("myinclude")); + // binary.addCSourceFile(.{ .file = Path.relative("src/main.c"), .flags = &.{ "-Wall", "-Wextra" } }); + // binary.addCSourceFiles(&.{ "foo.cc", "bar.cc" }, &.{ "-Wall", "-std=c++17" }); + + // warning to mixing C and C++ code. Use same flags, but c++flags(exclusive) not working (e.g.: "-std=c++11") + // binary.addCSourceFiles(&.{ "foo.cc", "bar.c" }, &.{ "-Wall", "-Werror" }); + + // linking + // binary.linklibC(); // get libc and c-stdlib + // for C++ + // binary.linklibCpp(); // builtin llvm-libcxx/abi + libunwind (+ stl) + libc (avoid duplicate - no need linklibC()) + + // copy binary from zig-cache to zig-out/bin [default] + b.installArtifact(binary); + // overwritten: copy binary from zig-cache to zig-deploy/{triple-target}/{mode}/bin + b.resolveInstallPrefix(b.fmt("zig-deploy/{s}/{s}", .{ triple_target, mode }), .{}); +} diff --git a/zigConsole/docker-compose.yml b/zigConsole/docker-compose.yml new file mode 100644 index 000000000..3efdc7fe9 --- /dev/null +++ b/zigConsole/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.9" +services: + __container__-debug: + build: + context: . + dockerfile: Dockerfile.debug + image: ${LOCAL_REGISTRY}:5002/__container__-debug:${TAG} + ports: + - 2230:2230 + + __container__: + build: + context: . + dockerfile: Dockerfile + image: ${DOCKER_LOGIN}/__container__:${TAG} diff --git a/zigConsole/src/main.zig b/zigConsole/src/main.zig new file mode 100644 index 000000000..b30e4b97b --- /dev/null +++ b/zigConsole/src/main.zig @@ -0,0 +1,12 @@ +const std = @import("std"); +const log = std.log.scoped(.toradex); + +// override the std implementation +pub const std_options = struct { + pub const log_level = .info; +}; +pub fn main() void { + log.info("Hello {s}!\n", .{"Torizon"}); + // output: + // info(toradex): Hello Torizon! +}