Files
pplus-core/THIRD_PARTY.md
T
alexm b10a5c87a3
Test / gate (push) Canceled after 0s
A gate that does not depend on its machine, on a runner of its own
The gate first ran on the server that deploys the site: a slow container
with no C compiler and no ICU. Ten tests failed there on correct code,
and no Mojo program could be built at all.

- The workflows ask for a runner labeled heavy, not the deploy server:
  the gate builds and runs some 300 Mojo programs and fuzzes. docs/ci.md
  says how to register one. With none registered a run waits.
- The pinned environment has a C compiler on Linux (gcc, with its C
  library pinned to glibc 2.34): mojo build links with the C compiler it
  finds, and conda-forge's default links against a C library too old
  for Mojo's runtime. mojo-local reports a program that could not be
  linked as that, and does not keep the answer.
- The pinned Dafny runs without ICU, and dafny-fetch fails when the
  Dafny it fetched does not start.
- A test's time limit is processor time at the machine's pace
  (tests/helpers/pace.mjs).
- The prover's time on the clock is the caller's: provePseudo and
  Workspace.proofBudgetMs take it, the Prove tab's 3 seconds stay the
  default, and the command line, library-check and the tests use none,
  so their answers are the counted budgets' alone.
- The library pointer moves to its workflow change (e5ae090).
2026-11-13 06:13:28 -05:00

52 lines
6.2 KiB
Markdown

# Third-party material in pplus-core
Everything in this repository is ours, under the Apache License 2.0 ([LICENSE.md](LICENSE.md)), except what this file lists. `tests/third-party.test.mjs` holds the versions and licenses below to `package-lock.json`, `pixi.lock` and `scripts/dafny.py`, and holds the list of generated files to `src/mojo/generated/`, so a change there fails the tests until this file says so.
## The library
`library/` is pplus-library, a repository of its own pinned as a submodule. Its [THIRD_PARTY.md](library/THIRD_PARTY.md), written by `pixi run mojo-emit`, lists every file harvested from Modular's repositories (`library/mojo/corpus/`), its source commit and the license header it carries, and the license file of each source at the pinned commit (`library/mojo/licenses/`).
## Made here from Modular's material, and shipped in the app
`pixi run mojo-emit` writes these from the corpus. Each file's first lines name the commit it came from.
| File | Made from | What it is |
|---|---|---|
| `src/mojo/generated/tokens.ts` | modular/modular: `TokenKinds.def`, `lib/MojoParser`, the decorator reference, the stdlib prelude (Apache-2.0 WITH LLVM-exception) | Lists of the language's words: keywords, soft keywords, punctuation, decorators, prelude names, the words 1.x removed. Two messages, for `fn` and `read`, are the compiler's own wording, quoted from its source. |
| `src/mojo/generated/stdlib.ts` | modular/modular: `stdlib/std` (Apache-2.0 WITH LLVM-exception) | Which package exports each public standard-library name: names and module paths, no code. |
| `src/mojo/generated/types.ts` | modular/modular: `stdlib/std` (Apache-2.0 WITH LLVM-exception) | Each standard struct's and trait's name, the traits it declares, and the names of the methods a trait gives by default: names and relations, no code. |
| `src/mojo/generated/editor.ts` | modular/vscode-mojo: `language-configuration.json` (Apache-2.0) | The comment marker, bracket pairs and indentation patterns an editor uses for Mojo: a few configuration values. |
| `src/mojo/generated/pin.ts` | `library/mojo/pin.json` and the lock | The Mojo version, the godbolt compiler id and the source commits: ours. |
| `src/mojo/generated/programs.ts` | `library/mojo/local/` and `library/mojo/golden/` | Our own exercise programs, each with the verdict Compiler Explorer's answer gave it. |
| `src/mojo/generated/listings.ts` | `library/mojo/golden/` (written by `pixi run play`) | The Mojo compiler's assembly listing for each of our exercise programs, as Compiler Explorer returned it. |
| `library/syntax/mojo.xml` | the same words as `tokens.ts` | A KDE syntax definition for Pandoc listings. Its header attribute says `license="Apache-2.0"`, which `scripts/mojo/mojocorpus/kde.py` writes. |
The Mojo checker (`src/mojo/`) reports some errors in the compiler's own words (for example "use of unknown declaration"), so that a student sees the message the compiler would print; `tests/mojo-check.test.mjs` holds them to the compiler's stored answers. These are short phrases, written into our code by hand.
## Stored compiler answers
`library/mojo/golden/` (in pplus-library) holds the answer [Compiler Explorer](https://godbolt.org) returned for each program it was asked about: what the Mojo compiler printed, its exit code and, for some, its assembly. The programs are ours (probes, exercises, stress programs, the library's references) and the harvested corpus. Compiler Explorer is BSD-2-Clause software run by Matt Godbolt and volunteers; its [privacy policy](https://github.com/compiler-explorer/compiler-explorer/blob/main/static/generated/privacy.pug) says it caches compilation results and deletes source code within minutes, and neither the site nor its [API documentation](https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md) states terms of use for its answers.
## The engines and the lessons, which came from the course
`src/engines/` (the pseudo, asm86 and shared modules, and the course's page widgets beside them) and `src/curriculum/` (a lesson corpus kept as an interpreter fixture) come from the course site that also runs these engines. [docs/engines.md](docs/engines.md) says the engines "started as a copy of the course's modules" and that this repository now owns them. They are listed here to say where they came from, not because they are someone else's: both are Copyright Scientific Computing Studio, LLC, under the Apache License 2.0, like the rest of the repository.
## Installed to build and test, not redistributed
pixi installs these into `.pixi/`, npm into `node_modules/`, and `scripts/dafny.py` into `.tools/`; git ignores all three. No compiler binary, runtime library or standard-library source of Mojo is in this repository or in its history.
| Tool | Version | From | License | In what we ship |
|---|---|---|---|---|
| Mojo (`mojo`, `mojo-compiler`, `mojo-python`, `mblack`) | 1.2.0 | conda.modular.com, by pixi | LicenseRef-Modular-Proprietary (Modular's license, as `pixi.lock` records it) | Nothing. Tasks run the compiler on our programs. |
| Node.js | 26.10.0 | conda-forge, by pixi | MIT | Nothing. |
| Python | 3.14.7 | conda-forge, by pixi | Python-2.0 | Nothing. The pipelines use its standard library. |
| GCC (`gcc`, on Linux only) | 16.2.0 | conda-forge, by pixi | GPL-3.0-only WITH GCC-exception-3.1 (the compiler, `gcc_impl_linux-64`), with binutils (GPL-3.0-only) and the headers and C library it builds against (LGPL-2.0-or-later) | Nothing. It links the programs `mojo build` makes and builds the C references `library-check` runs and one test's harness; the programs are ours, and no binary is kept. |
| TypeScript | 6.0.3 | npm (`package-lock.json`) | Apache-2.0 | Nothing. `tsc` compiles `src/`; the output is our code. |
| Dafny | 4.11.0 | the GitHub release zip, by `scripts/dafny.py`, checked by SHA-256 | MIT (Dafny and the Z3 it carries, with .NET runtime files; Dafny's own NOTICES.txt lists the rest) | Nothing. Its verdicts are stored in `library/modules/*/*/golden/dafny.json`. |
The other packages pixi installs come with these from conda-forge; `pixi.lock` names each with its license.
## Names
"Mojo" and "Modular" are trademarks of Modular Inc. Programming+ is not affiliated with or endorsed by Modular. "Compiler Explorer" and "godbolt.org" name the service by Matt Godbolt that the app asks.