mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-23 13:13:48 +00:00
Added the dashes after dotnet run to every call of the build script (#1222)
This commit is contained in:
1 parent
b6d614d96a
commit
6e94a93c70
15 files changed
+40
-36
No files matched your search
+16
-12
@@ -19,41 +19,43 @@ Regardless of whether you want to build the app locally for yourself (not trusti
|
||||
1. Open a terminal.
|
||||
2. Install the Tauri CLI by running `cargo install tauri-cli --version 2.12.6 --locked`.
|
||||
3. Navigate to the `/app/Build` directory within the repository.
|
||||
4. Run `dotnet run build` to build the entire app.
|
||||
4. Run `dotnet run -- build` to 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 build also downloads the PDF library Pdfium in the version which `metadata.txt` names, and downloads it again only when that version changes. `dotnet run build --offline` skips the download and uses the library which is already present.
|
||||
Mind the two dashes after `dotnet run` in this and every other command of the build script. Everything after them reaches the build script unchanged. Without them, `dotnet run` takes some options for itself, such as `--arch`, instead of passing them on.
|
||||
|
||||
The build also downloads the PDF library Pdfium in the version which `metadata.txt` names, and downloads it again only when that version changes. `dotnet run -- build --offline` skips the download and uses the library which is already present.
|
||||
|
||||
## The quality gate
|
||||
One command checks that what you are about to build is sound:
|
||||
|
||||
1. Open a terminal.
|
||||
2. Navigate to the `/app/Build` directory within the repository.
|
||||
3. Run `dotnet run verify`.
|
||||
3. Run `dotnet run -- verify`.
|
||||
|
||||
It runs the .NET tests, the trim smoke test, 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 which changes more than the documentation — including those without the `run-pipeline` label, because a gate which is closed exactly while nobody is looking is not a gate.
|
||||
`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 which changes more than the documentation — including those without the `run-pipeline` label, because a gate which is closed exactly while nobody is looking is not a gate.
|
||||
|
||||
Three notes:
|
||||
- The trim smoke test publishes `app/TrimSmokeTest` trimmed, exactly like the app, and reads and writes the JSON of chats, settings, Visual Briefing projects, backups, model answers, and every other type AI Studio reads or writes. Debug builds and the tests are not trimmed, so only a published build shows when the trimmer removed code which System.Text.Json needs; AI Studio can then neither load nor save that data. A new kind of file or model answer needs nothing there: `JsonRoots` in `app/TrimSmokeTest` finds every type through the context of the options it is read or written with. The smoke test also lets the Mathematics tools compute a few expressions, since AngouriMath is trimmed, too; see `MathematicsChecks` there.
|
||||
- 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 build` itself.
|
||||
- `dotnet run verify-models` reports 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 by `dotnet test`.
|
||||
- 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 -- build` itself.
|
||||
- `dotnet run -- verify-models` reports 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 by `dotnet 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:
|
||||
1. Ensure you have met all the prerequisites.
|
||||
2. Open a terminal.
|
||||
3. Navigate to the `/app/Build` directory within the repository.
|
||||
4. To build the current version, run `dotnet run build` to build the entire app.
|
||||
4. To build the current version, run `dotnet run -- build` to 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/release` afterward.
|
||||
|
||||
## Run the app locally with all your changes
|
||||
Do you want to test your changes before creating a PR? Follow these steps:
|
||||
1. Ensure you have met all the prerequisites.
|
||||
2. At least once, you have to run the `dotnet run build` command (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.
|
||||
2. At least once, you have to run the `dotnet run -- build` command (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.
|
||||
3. Open a terminal.
|
||||
4. Navigate to the `runtime` directory within the repository, e.g. `cd repos/mindwork-ai-studio/runtime`.
|
||||
5. Run `cargo tauri dev --no-watch`.
|
||||
@@ -83,7 +85,9 @@ Neither macOS nor Windows can build a Flatpak, and on Linux it takes the right F
|
||||
|
||||
1. Open a terminal.
|
||||
2. Navigate to the `/app/Build` directory within the repository.
|
||||
3. Run `dotnet run flatpak --output <folder>`, e.g., `dotnet run flatpak --output ~/Downloads/flatpak`. The folder has to lie outside the repository; the command creates it when it does not exist.
|
||||
3. Run `dotnet run -- flatpak --output <folder>`, e.g., `dotnet run -- flatpak --output ~/Downloads/flatpak`. The folder has to lie outside the repository; the command creates it when it does not exist.
|
||||
|
||||
Here, the two dashes after `dotnet run` matter in particular: without them, `dotnet run` takes the option `--arch` for itself and builds the build script for another platform instead of passing the option on.
|
||||
|
||||
The command asks which state of AI Studio goes into the Flatpak. You may also choose it right away:
|
||||
|
||||
@@ -96,7 +100,7 @@ The Flatpak repository always comes from its `main` branch. Before the build sta
|
||||
At the end, the output folder holds `MindWork AI Studio_<arch>.flatpak` and `MindWork AI Studio Plugin Pandoc_<arch>.flatpak`, the same bundles our Flatpak workflow produces. Copy them to a Linux machine, e.g., a virtual machine, and install them there with `flatpak install --bundle <file>`, the app first.
|
||||
|
||||
Some notes:
|
||||
- **Architecture:** The Flatpak is built for the architecture of the Docker host. `--arch x86_64` or `--arch aarch64` chooses the other one, which needs an emulation such as Rosetta, available in OrbStack and in Docker Desktop on Apple silicon, and takes considerably longer.
|
||||
- **Architecture:** The Flatpak is built for the architecture of the Docker host. `--arch x86_64` or `--arch aarch64` chooses the other one, which needs an emulation such as Rosetta, available in OrbStack and in Docker Desktop on Apple silicon, and takes considerably longer. On a Mac with Apple silicon, for example, `dotnet run -- flatpak --output ~/Downloads/flatpak --arch x86_64` builds the Flatpak for x86_64.
|
||||
- **Duration and disk space:** Every build downloads the SDKs and runtimes anew, several gigabytes, before it builds the Tauri CLI, the Rust runtime, and the .NET app. On a fast machine, a build takes between half an hour and 45 minutes, depending on the connection; under an emulation, it takes about twice as long. While the build runs, the container and its volume need about 15 GB of free space. The container image needs about 6 GB more, once for each architecture you build for.
|
||||
- **Firewalls:** The container fetches from GitHub (`github.com`, `ghcr.io`, `*.githubusercontent.com`), Flathub (`flathub.org`), PyPI, crates.io, and NuGet. A firewall on your machine, such as Little Snitch, may have to allow these connections for the processes of Docker.
|
||||
- **Cleaning up:** The command removes its container and volume at the end, also after a failure or when you press Ctrl+C. Pressing Ctrl+C a second time quits at once and prints the commands which remove what is left. A build which ends otherwise, e.g., because the terminal was closed, leaves both behind; the next build names them. The container image stays, so that the next build does not download it again.
|
||||
@@ -107,7 +111,7 @@ In order to create a release:
|
||||
1. To create a new release, you need to be a maintainer of the repository—see step 8.
|
||||
2. Make sure there's a changelog file for the version you want to create in the `/app/MindWork AI Studio/wwwroot/changelog` directory. Name the file `vX.Y.Z.md` and include all release changes—your updates and any others included in this version. Keep its first line, the placeholder which the previous release created, such as `# v26.11.2, build 261 (2026-11-xx xx:xx UTC)`; when you rename the file for another version, change the version in that line as well. The release fills in the build time and refuses to start when the line names another version or build.
|
||||
3. After you have created the changelog file, you must commit the changes to the repository.
|
||||
4. To prepare a new release, open a terminal, go to `/app/Build` and run `dotnet run release --action <ACTION>`, where `<ACTION>` raises one part of the version, which reads year.month.release: `build` raises the release (26.11.1 becomes 26.11.2), `month` the month (26.12.1), and `year` the year (27.1.1). When a month passed without a release, set the version directly instead, e.g., `dotnet run release --version 27.2.1`.
|
||||
4. To prepare a new release, open a terminal, go to `/app/Build` and run `dotnet run -- release --action <ACTION>`, where `<ACTION>` raises one part of the version, which reads year.month.release: `build` raises the release (26.11.1 becomes 26.11.2), `month` the month (26.12.1), and `year` the year (27.1.1). When a month passed without a release, set the version directly instead, e.g., `dotnet run -- release --version 27.2.1`.
|
||||
5. Now wait until all process steps have been completed. Among other things, the version number will be incremented, the build time written into the header of the new changelog, the changelog registered, and the version numbers of central dependencies updated, etc.
|
||||
6. The actual release will be built by our GitHub Workflow. For this to work, you need to create a PR with your changes.
|
||||
7. Your proposed changes will be reviewed and merged.
|
||||
@@ -120,7 +124,7 @@ In order to create a release:
|
||||
If a pre-release must be rebuilt without changing its version, open a terminal in `/app/Build` and run:
|
||||
|
||||
```bash
|
||||
dotnet run rebuild-release
|
||||
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.
|
||||
@@ -119,8 +119,8 @@ Three things to know when adding another one:
|
||||
## Verification
|
||||
|
||||
- **The test project** (`app/Tests/Models/`) owns everything that can be asked of the rules: a corpus of real model IDs per provider, the difference test against the rules this replaced, and the properties every rule has to have — no two rules of equal specificity on one name, every family and host names a page and a day, every pattern in normalized form, no family stating one of the three reasoning words.
|
||||
- **`dotnet run verify-models`** in `app/Build` reports how long ago somebody last read those pages and names everything older than six months. It warns and never fails, because that answer changes with the calendar rather than with the code.
|
||||
- **`dotnet run verify`** runs the whole gate, and `dotnet run build` runs it before building. See `documentation/Build.md`.
|
||||
- **`dotnet run -- verify-models`** in `app/Build` reports how long ago somebody last read those pages and names everything older than six months. It warns and never fails, because that answer changes with the calendar rather than with the code.
|
||||
- **`dotnet run -- verify`** runs the whole gate, and `dotnet run -- build` runs it before building. See `documentation/Build.md`.
|
||||
|
||||
## Checklist
|
||||
|
||||
@@ -131,5 +131,5 @@ Three things to know when adding another one:
|
||||
- State a number only where a page states it. Leaving it out means "nobody knows", which is a usable answer; a made-up number is not.
|
||||
- Add the models to the corpus in `app/Tests/Models/Corpus/` and say whether the answer is expected to change.
|
||||
- Use `Refine` only for what a pattern cannot express, and `Rank` only with a reason that says what the computation gets wrong.
|
||||
- Run `dotnet test`, and `dotnet run verify-models` when you touched sources.
|
||||
- Run `dotnet test`, and `dotnet run -- verify-models` when you touched sources.
|
||||
- Add a changelog entry when users or administrators are affected — a new plugin key always affects administrators.
|
||||
@@ -312,7 +312,7 @@ The tools open no path for content from outside AI Studio. A result holds the ex
|
||||
|
||||
`AngouriMathBehaviorTests` pins the behavior of AngouriMath which the tools build on, such as the traps of the parser, the digits of its functions, and the computations which ignore cancellation. The version is pinned exactly by `packages.lock.json`. Before raising it, read the release notes for silent breaking changes, and run these tests.
|
||||
|
||||
AngouriMath is marked as trimmable, so a published build of AI Studio contains only the parts of it which the trimmer saw being used, and `Trimming.props` suppresses the warnings about the others. The trim smoke test of `dotnet run verify` therefore lets both tools compute a few expressions in a trimmed build, see `MathematicsChecks` in `app/TrimSmokeTest`. When a tool starts to use another part of AngouriMath, such as a new operation, add a check there.
|
||||
AngouriMath is marked as trimmable, so a published build of AI Studio contains only the parts of it which the trimmer saw being used, and `Trimming.props` suppresses the warnings about the others. The trim smoke test of `dotnet run -- verify` therefore lets both tools compute a few expressions in a trimmed build, see `MathematicsChecks` in `app/TrimSmokeTest`. When a tool starts to use another part of AngouriMath, such as a new operation, add a check there.
|
||||
|
||||
## Checklist
|
||||
|
||||
|
||||
Reference in new issue
Block a user