8.2 KiB
Building
You just want to use the app? Then simply download the appropriate setup for your operating system. This chapter is intended for developers who want to modify and customize the code.
Prefaces regarding Linux development systems
Unfortunately, we have to provide a note regarding development on Linux systems. MindWork AI Studio consists of a Rust and a .NET part. Compiling the .NET code works smoothly on all operating systems. However, this is not the case for our Rust part. More specifically, it is not the Rust code itself that is problematic, but rather the Tauri framework on which we base our work. Tauri has certain dependencies that depend on the operating system. The specific dependencies vary between different Linux distributions and between versions of distributions.
Therefore, we cannot provide a static list here that is valid for all Linux systems. Unfortunately, the situation is even more complex: Tauri requires dependencies that are not available in current Linux distributions because they already include newer versions. For these reasons, we currently advise against developing AI Studio on Linux. In case you still want to try, you will need a lot of patience and willingness to experiment. We ask for your understanding. Thank you very much.
Prerequisites
- Install the .NET 9 SDK.
- Install the Rust compiler in the latest stable version.
- Meet the prerequisites for building Tauri. Node.js is not required, though.
- The core team uses JetBrains Rider and RustRover for development. Both IDEs are free to use for open-source projects for non-commercial use. They are available for macOS, Linux, and Windows systems. Profiles are provided for these IDEs, so you can get started right away. However, you can also use a different IDE.
- Clone the repository.
One-time mandatory steps
Regardless of whether you want to build the app locally for yourself (not trusting the pre-built binaries) or test your changes before creating a PR, you have to run the following commands at least once:
- Open a terminal.
- Install the Tauri CLI by running
cargo install tauri-cli --version 2.11.0 --locked. - Navigate to the
/app/Builddirectory within the repository. - Run
dotnet run buildto build the entire app.
This is necessary because the build script and the Tauri framework assume that the .NET app is available as a so-called "sidecar." Although the sidecar is only necessary for the final release and shipping, Tauri requires it to be present during development as well.
The quality gate
One command checks that what you are about to build is sound:
- Open a terminal.
- Navigate to the
/app/Builddirectory within the repository. - Run
dotnet run verify.
It runs the .NET tests, the Rust tests, Clippy (cargo clippy --all-targets -- -D warnings), and a report on the pages the model rules were written from. Every check runs, even after one of them has failed, so that a single run tells you everything that is wrong instead of the first thing.
dotnet run build runs the gate first and stops when it does not pass. For the quick loop while you are working on something, use dotnet run build --skip-verify, and let the gate run before you open a pull request. The same command runs in our GitHub workflow as the verify job, on every pull request — including those without the run-pipeline label, because a gate which is closed exactly while nobody is looking is not a gate.
Two notes:
- The Rust half of the gate needs the .NET sidecar (see "One-time mandatory steps" above). While that file is missing, the gate skips the Rust tests and Clippy and says so rather than failing, because the command which produces the sidecar is
dotnet run builditself. dotnet run verify-modelsreports how long ago somebody last read the pages behind the model rules, and names everything older than six months. It is a report and never a failure: a page nobody has looked at for a while is not a page which changed. Everything else about the model rules — whether two rules claim the same names, whether every family names a page and a day, whether every pattern is written the way model names arrive — is checked by the test project, and therefore bydotnet test.
Build AI Studio from source
In order to build MindWork AI Studio from source instead of using the pre-built binaries, follow these steps:
- Ensure you have met all the prerequisites.
- Open a terminal.
- Navigate to the
/app/Builddirectory within the repository. - To build the current version, run
dotnet run buildto build the entire app.- This will build the app for the current operating system and CPU architecture (x64, or ARM64).
- The final setup program will be located in
runtime/target/releaseafterward.
Run the app locally with all your changes
Do you want to test your changes before creating a PR? Follow these steps:
- Ensure you have met all the prerequisites.
- At least once, you have to run the
dotnet run buildcommand (see above, "One-time mandatory steps"). This is necessary because the Tauri framework checks whether the .NET app as so-called "sidecar" is available. Although the sidecar is only necessary for the final release and shipping, Tauri requires it to be present during development. - Open a terminal.
- Navigate to the
runtimedirectory within the repository, e.g.cd repos/mindwork-ai-studio/runtime. - Run
cargo tauri dev --no-watch. - Now you have to wait until the Rust code is compiled. Afterward, the Tauri runtime will be started and the app window will appear. This may take a while, especially the first time you run it.
- Open another terminal or tab.
- Navigate to the
app/MindWork AI Studiodirectory within the repository. - Execute the command
dotnet run. - After compiling the .NET code, the app will finally start inside the Tauri runtime window.
You can now test your changes. To stop the application:
- Close the Tauri window (GUI).
- Press
Ctrl+Cin the terminal where the app is running. - Stop the process via your IDE’s run/debug controls.
Create a release
In order to create a release:
- To create a new release, you need to be a maintainer of the repository—see step 8.
- Make sure there's a changelog file for the version you want to create in the
/app/MindWork AI Studio/wwwroot/changelogdirectory. Name the filevX.Y.Z.mdand include all release changes—your updates and any others included in this version. - After you have created the changelog file, you must commit the changes to the repository.
- To prepare a new release, open a terminal, go to
/app/Buildand rundotnet run release --action <ACTION>, where<ACTION>is eitherpatch(creating a patch version),minor(creating a minor version), ormajor(creating a major version). - Now wait until all process steps have been completed. Among other things, the version number will be incremented, the new changelog registered, and the version numbers of central dependencies updated, etc.
- The actual release will be built by our GitHub Workflow. For this to work, you need to create a PR with your changes.
- Your proposed changes will be reviewed and merged.
- Once the PR is merged, a member of the maintainers team will create & push an appropriate git tag in the format
vX.Y.Z. - The GitHub Workflow will then build the release and upload it to the release page.
- Building the release including virus scanning takes some time. Please be patient.
Rebuild the current pre-release
If a pre-release must be rebuilt without changing its version, open a terminal in /app/Build and run:
dotnet run rebuild-release
The command keeps the current version, increments the build number, refreshes the release time and related changelog metadata, reserves the following build number for the next changelog, and performs the same two builds as the regular release command. Use --offline to skip downloads and rely on locally available build dependencies.