From ef8f2da7a0397ab49bf16ce0a3a957da15e8ed6e Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 13:03:22 +0200 Subject: [PATCH 1/8] chore: tweak Taskfile jobs --- .github/workflows/ci.yml | 12 ---------- Taskfile.yml | 49 ++++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a1bc45..672ab41c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,13 +30,6 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, windows-2019, macos-latest ] - include: - - os: ubuntu-latest - rust-target: 1.79-x86_64-unknown-linux-gnu - - os: windows-2019 - rust-target: 1.79-x86_64-pc-windows-gnu - - os: macos-latest - rust-target: 1.79-x86_64-apple-darwin runs-on: ${{ matrix.os }} name: Build - ${{ matrix.os }} steps: @@ -57,11 +50,6 @@ jobs: architecture: x64 cache: true - - name: Setup Rust - run: | - rustup install ${{ matrix.rust-target }} - rustup default ${{ matrix.rust-target }} - - name: Setup Task uses: arduino/setup-task@v2 with: diff --git a/Taskfile.yml b/Taskfile.yml index 273d4628..deab5ded 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,38 +17,57 @@ vars: sh: echo '{{if eq OS "windows"}}-H windowsgui -extldflags=-static{{end}}' LD_FLAGS: -s -w {{.BUILD_VARS}} {{.LD_FLAGS_WINDOWS}} BUILD_ARGS: -trimpath -ldflags="{{.LD_FLAGS}}" + RUSTUP_TOOLCHAIN: + sh: | + if [ "$OS" = "Windows_NT" ]; then + echo "stable-x86_64-pc-windows-gnu" + elif [ "$OS" = "Darwin" ]; then + echo "stable-x86_64-apple-darwin" + elif [ "$OS" = "Linux" ]; then + echo "stable-x86_64-unknown-linux-gnu" + else + echo "stable" + fi tasks: - clean-sdmm: + default: cmds: - - rm -frd ./dst + - task: clean + - task: build - clean-sdmmparser: + clean-parser: dir: third_party/sdmmparser/src cmds: - cargo clean + clean-editor: + cmds: + - '{{if eq OS "windows"}}cmd /C "if exist dst (rmdir /S /Q dst)"{{else}}rm -frd ./dst{{end}}' + clean: deps: - - clean-sdmmparser - - clean-sdmm + - clean-parser + - clean-editor - run: - deps: - - build-sdmmparser + build-parser: + dir: third_party/sdmmparser/src cmds: - - go run {{.BUILD_ARGS}} . + - RUSTUP_TOOLCHAIN={{.RUSTUP_TOOLCHAIN}} cargo build --release - build: - deps: - - build-sdmmparser + build-editor: cmds: - go build {{.BUILD_ARGS}} -o "dst/{{.BIN_DST}}" . - build-sdmmparser: - dir: third_party/sdmmparser/src + build: cmds: - - cargo build --release + - task: build-parser + - task: build-editor + + run: + deps: + - build-parser + cmds: + - go run {{.BUILD_ARGS}} . release-files-unzip: dir: dst From 3a29d0bc3b3b8defbee8cc28b4f38df88b31f872 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 13:04:09 +0200 Subject: [PATCH 2/8] chore: up rust version --- third_party/sdmmparser/src/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/sdmmparser/src/Cargo.toml b/third_party/sdmmparser/src/Cargo.toml index 00241590..8b6c9778 100644 --- a/third_party/sdmmparser/src/Cargo.toml +++ b/third_party/sdmmparser/src/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "sdmmparser" version = "2.0.0" -rust-version = "1.79.0" +rust-version = "1.82.0" +edition = "2021" [lib] name = "sdmmparser" From 62a98e7cbbc2d94dba1302bcde497e9ab5c1e7b0 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 13:04:13 +0200 Subject: [PATCH 3/8] chore: up go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index feb44c88..80370e3b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sdmm -go 1.22 +go 1.23 require ( github.com/SpaiR/imgui-go v1.12.1-0.20220214190844-a0bad21e1c5d From 84ace2fa28f7cd7cb4da56d985adf0d0d310bd5e Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 13:28:02 +0200 Subject: [PATCH 4/8] chore: up parser deps --- third_party/sdmmparser/src/Cargo.lock | 151 +++++++++++--------------- third_party/sdmmparser/src/Cargo.toml | 10 +- 2 files changed, 67 insertions(+), 94 deletions(-) diff --git a/third_party/sdmmparser/src/Cargo.lock b/third_party/sdmmparser/src/Cargo.lock index eeac04c2..9dc9e2b6 100644 --- a/third_party/sdmmparser/src/Cargo.lock +++ b/third_party/sdmmparser/src/Cargo.lock @@ -9,16 +9,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "ahash" -version = "0.8.3" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "attribute-derive" @@ -63,7 +57,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "builtins-proc-macro" version = "0.0.0" -source = "git+https://github.com/SpaiR/SpacemanDMM?rev=367bcdd75f736a91ab046d616ce56f61fb835a94#367bcdd75f736a91ab046d616ce56f61fb835a94" +source = "git+https://github.com/SpaiR/SpacemanDMM?rev=d19602a6f081e6877bb5de291b160000fdbd2aaa#d19602a6f081e6877bb5de291b160000fdbd2aaa" dependencies = [ "proc-macro2", "quote", @@ -72,9 +66,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.9.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "cfg-if" @@ -90,9 +84,9 @@ checksum = "186dce98367766de751c42c4f03970fc60fc012296e706ccbb9d5df9b6c1e271" [[package]] name = "color_space" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3776b2bcc4e914db501bb9be9572dd706e344b9eb8f882894f3daa651d281381" +checksum = "52fdfaf2bee6357023bf7f95b15a8ef0b82759d2bce705cc45efcae9ae10f0ff" [[package]] name = "crc32fast" @@ -128,13 +122,13 @@ dependencies = [ [[package]] name = "dreammaker" version = "0.1.0" -source = "git+https://github.com/SpaiR/SpacemanDMM?rev=367bcdd75f736a91ab046d616ce56f61fb835a94#367bcdd75f736a91ab046d616ce56f61fb835a94" +source = "git+https://github.com/SpaiR/SpacemanDMM?rev=d19602a6f081e6877bb5de291b160000fdbd2aaa#d19602a6f081e6877bb5de291b160000fdbd2aaa" dependencies = [ - "ahash", "bitflags", "builtins-proc-macro", "color_space", "derivative", + "foldhash", "get-size", "get-size-derive", "indexmap", @@ -149,13 +143,10 @@ dependencies = [ ] [[package]] -name = "fallible_collections" -version = "0.4.7" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9acf77205554f3cfeca94a4b910e159ad9824e8c2d164de02b3f12495cc1074d" -dependencies = [ - "hashbrown 0.13.2", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fdeflate" @@ -173,9 +164,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.7.1", ] +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "get-size" version = "0.1.4" @@ -193,40 +190,20 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown", ] [[package]] @@ -238,7 +215,7 @@ checksum = "71dd52191aae121e8611f1e8dc3e324dd0dd1dee1e6dd91d10ee07a3cfb4d9d8" [[package]] name = "interval-tree" version = "0.8.0" -source = "git+https://github.com/SpaiR/SpacemanDMM?rev=367bcdd75f736a91ab046d616ce56f61fb835a94#367bcdd75f736a91ab046d616ce56f61fb835a94" +source = "git+https://github.com/SpaiR/SpacemanDMM?rev=d19602a6f081e6877bb5de291b160000fdbd2aaa#d19602a6f081e6877bb5de291b160000fdbd2aaa" [[package]] name = "itoa" @@ -254,12 +231,11 @@ checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "lodepng" -version = "3.7.2" +version = "3.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ad39f75bbaa4b10bb6f2316543632a8046a5bcf9c785488d79720b21f044f8" +checksum = "7b2dea7cda68e381418c985fd8f32a9c279a21ae8c715f2376adb20c27a0fad3" dependencies = [ "crc32fast", - "fallible_collections", "flate2", "libc", "rgb", @@ -278,6 +254,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", "simd-adler32", ] @@ -290,26 +275,20 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - [[package]] name = "ordered-float" -version = "3.0.0" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bcbab4bfea7a59c2c0fe47211a1ac4e3e96bea6eb446d704f310bc5c732ae2" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" dependencies = [ "num-traits", ] [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", "phf_shared", @@ -327,37 +306,37 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", "phf_shared", "proc-macro2", "quote", - "syn 1.0.95", + "syn 2.0.87", ] [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -453,9 +432,9 @@ checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" [[package]] name = "rgb" -version = "0.8.36" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -479,18 +458,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -499,9 +478,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -551,18 +530,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -579,12 +558,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - [[package]] name = "winapi" version = "0.3.9" diff --git a/third_party/sdmmparser/src/Cargo.toml b/third_party/sdmmparser/src/Cargo.toml index 8b6c9778..882b5134 100644 --- a/third_party/sdmmparser/src/Cargo.toml +++ b/third_party/sdmmparser/src/Cargo.toml @@ -10,14 +10,14 @@ path = "lib.rs" crate-type = ["staticlib"] [dependencies] -serde = "1.0.214" -serde_derive = "1.0.203" -serde_json = "1.0.132" -png = "0.17.13" +serde = "1.0.215" +serde_derive = "1.0.215" +serde_json = "1.0.133" +png = "0.17.14" [dependencies.dreammaker] git = "https://github.com/SpaiR/SpacemanDMM" -rev = "367bcdd75f736a91ab046d616ce56f61fb835a94" +rev = "d19602a6f081e6877bb5de291b160000fdbd2aaa" package = "dreammaker" [profile.release] From 8b8cd8f62ce6ffafacc83d5ac80175e6203000e6 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 14:26:26 +0200 Subject: [PATCH 5/8] docs: improve README about "how to build" --- .github/workflows/ci.yml | 2 +- README.md | 57 +++++++++++++++++++++++++++++++--------- versioninfo.json | 2 +- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 672ab41c..c45aff57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v6 with: - version: v1.59.1 + version: v1.62.0 build: strategy: diff --git a/README.md b/README.md index c4f2173e..5dd4a2ef 100644 --- a/README.md +++ b/README.md @@ -118,28 +118,49 @@ Building the application involves two steps: 2. Build the editor. **sdmmparser** is a Rust library based on the [SpacemanDMM](https://github.com/SpaceManiac/SpacemanDMM) parser and is compiled to a `staticlib`. -It can be found at `internal/third_party/sdmmparser/src`. +It can be found at `/third_party/sdmmparser/src`. ### Prerequisites -* [Go](https://go.dev/): version **1.20** or higher. -* [Rust](https://www.rust-lang.org/): version **1.79.0**. -* (Optional) [Task](https://taskfile.dev): for running build scripts. +* [Go](https://go.dev/): version **1.23** or higher. +* [Rust](https://www.rust-lang.org/): version **1.82.0** or higher. +* [Task](https://taskfile.dev): for running build scripts. (Optional, but recommended) #### For Windows -Ensure your Rust is configured to use the `stable-x86_64-pc-windows-gnu` toolchain, as Go can't use MSVC for builds and requires GNU. -The easiest way to get the GNU compiler is to install MinGW through chocolatey, msys2, etc. +* [MinGW-w64](https://www.mingw-w64.org/) -After installing MinGW, ensure that the path to its bin folder is added to the PATH environment variable. +##### How to install + +MinGW can be installed through package managers like choco (Chocolatey) or downloaded and installed directly from the MinGW website. +After installation, make sure the bin directory of MinGW (which contains gcc.exe) is in your system's PATH. + +##### Why to use MinGW + +MinGW, short for Minimalist GNU for Windows, is a lightweight development environment providing essential tools like a C compiler for Windows. +It is required as the application uses `cgo` to integrate C libraries, enabling the build and compilation of `cgo` code and ensuring all dependencies are handled properly. + +Unlike MSVC (Microsoft Visual C++), which uses different conventions and linkers incompatible with `cgo`, +MinGW is designed to work seamlessly with Go's build system, making it the preferred choice for compiling `cgo` code on Windows. + +Alternatively, you can use WSL (Windows Subsystem for Linux) to provide a Linux-like environment that supports cgo and C compilers compatible with Go. +In that case look [for linux](#for-linux) dependencies. #### For Linux -You may need to install dependencies for building GUI apps: `sudo apt install xorg-dev libgtk-3-dev`. +You may need to install dependencies for building GUI apps: + +- **`apt` (Debian, Ubuntu):** `sudo apt install xorg-dev libgtk-3-dev` +- **`yum` (Red Hat, CentOS, Fedora):** `sudo yum install xorg-x11-server-devel gtk3-devel` +- **`dnf` (Fedora, newer Red Hat and CentOS):** `sudo dnf install xorg-x11-server-devel gtk3-devel` +- **`pacman` (Arch Linux):** `sudo pacman -S xorg-server-devel gtk3` +- **`zypper` (openSUSE):** `sudo zypper install xorg-x11-server-devel gtk3-devel` +- **`dnf` or `yum` (Amazon Linux):** `sudo dnf install xorg-x11-server-devel gtk3-devel` +- **`apk` (Alpine Linux):** `sudo apk add xorg-server-dev gtk+3.0-dev` ### Steps -#### Using Task +#### Using Task (Recommended) Task is a cross-platform Make alternative with scripts in `Taskfile.yml`. @@ -150,13 +171,25 @@ With Task installed: #### Manually -1. First, build the **sdmmparser** library.\ - Navigate to `third_party/sdmmparser/src` and run `cargo build --release`.\ - This step is needed only once unless **sdmmparser** is modified. +1. Build the **sdmmparser** library: + * Navigate to `third_party/sdmmparser/src` + * Run command: + * **Windows:** `RUSTUP_TOOLCHAIN=stable-x86_64-pc-windows-gnu cargo build --release` + * **Linux:** `RUSTUP_TOOLCHAIN=stable-x86_64-unknown-linux-gnu cargo build --release` + * **macOS:** `RUSTUP_TOOLCHAIN=stable-x86_64-apple-darwin cargo build --release` 2. In the root directory: * `go build .`: Builds the editor (executable named `sdmm.exe`/`sdmm` in the root). * `go run .`: Runs the editor. +Step #1 is required only when the **sdmmparser** is modified. + +##### Why Use a Custom RUSTUP_TOOLCHAIN + +The **sdmmparser** library is compiled into a `staticlib` that is linked into the final Go binary.\ +The MSVC toolchain is not compatible with Go, as Go relies on the GNU toolchain for CGO (the mechanism that compiles C code natively within Go). +Using a custom `RUSTUP_TOOLCHAIN` ensures that the Rust library is compiled in a way that aligns with Go's requirements, +avoiding compatibility issues and ensuring smooth integration. + ## Credits StrongDMM uses [SpacemanDMM](https://github.com/SpaceManiac/SpacemanDMM) parser made diff --git a/versioninfo.json b/versioninfo.json index a5344a36..a33fa1f5 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -24,7 +24,7 @@ "FileDescription": "StrongDMM", "FileVersion": "", "InternalName": "", - "LegalCopyright": "Copyright (C) 2019-2023", + "LegalCopyright": "Copyright (C) 2019-2024", "LegalTrademarks": "", "OriginalFilename": "", "PrivateBuild": "", From c7c95151af2f7f3e74d208d23f3c9398ebc4029e Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 16:26:49 +0200 Subject: [PATCH 6/8] docs: change contributing tags --- docs/CONTRIBUTING.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 5d68f76a..96ff09ee 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -85,13 +85,10 @@ fixes #0 #### Tags -- **ci:** everything connected with CI stuff; -- **doc:** all about the project documentation; -- **feature:** adding of massive functionality; -- **fix:** fixing and resolving bugs and problems; -- **refactor:** improves code without changing functionality; -- **tweak:** small improvements to the existing functionality, ex. wording changes, buttons movement etc; -- **up:** when bumping dependencies. +* **feat**: A new feature +* **fix**: A bug fix +* **chore**: Routine tasks, refactoring, updates, minor improvements +* **docs**: Documentation only changes ## License From 3a6e75bd1f8b5d1c71588ea05ca7541215102d61 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 16:35:40 +0200 Subject: [PATCH 7/8] fix: invalid rustup_toolchain configuration for Unix --- Taskfile.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index deab5ded..49fbbfcc 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -21,12 +21,15 @@ vars: sh: | if [ "$OS" = "Windows_NT" ]; then echo "stable-x86_64-pc-windows-gnu" - elif [ "$OS" = "Darwin" ]; then - echo "stable-x86_64-apple-darwin" - elif [ "$OS" = "Linux" ]; then - echo "stable-x86_64-unknown-linux-gnu" else - echo "stable" + OS_NAME=$(uname -s) + if [ "$OS_NAME" = "Darwin" ]; then + echo "stable-x86_64-apple-darwin" + elif [ "$OS_NAME" = "Linux" ]; then + echo "stable-x86_64-unknown-linux-gnu" + else + echo "stable" + fi fi tasks: From e031df74e381c6f7700bd5daa0f508773c3de0db Mon Sep 17 00:00:00 2001 From: SpaiR Date: Sun, 17 Nov 2024 16:37:42 +0200 Subject: [PATCH 8/8] chore: tweak labels for dependabot.yml --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6531d2bb..b91d90db 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,13 +4,19 @@ updates: directory: / schedule: interval: weekly + labels: + - deps - package-ecosystem: gomod directory: / schedule: interval: weekly + labels: + - deps - package-ecosystem: cargo directory: ./third_party/sdmmparser/src schedule: interval: weekly + labels: + - deps