Skip to content

Toolchain: Update defaults to GNAT FSF 16.1 - #1392

Merged
gusthoff merged 10 commits into
AdaCore:mainfrom
gusthoff:dev/topic/content/general/gnat-16-update/2026-10-23
Oct 24, 2026
Merged

gusthoff merged 10 commits into
AdaCore:mainfrom
gusthoff:dev/topic/content/general/gnat-16-update/2026-10-23

Conversation

@gusthoff

Copy link
Copy Markdown
Collaborator

Use GNAT and GNATprove 16.1 with GPRbuild 26 by default, and adapt
the examples to the checks enforced by the updated toolchain.

  • Correct boxed formal-package associations, make literal-aspect
    functions primitive operations, and initialize the volatile
    configuration variable to satisfy its Initializes contract.
  • Remove eight obsolete tool-version pins and restore their buttons.
    Pin two ghost-code examples to GNAT 15 to preserve the diagnostics
    discussed in their explanations.
  • Mark 53 examples with ada-run-expect-variable-output to identify
    expected output variation during toolchain comparisons.
  • Retain older tool versions required by pinned examples and remove
    unreferenced versions.

Validation on the VM: covered 18 content files with 537 passing
block reports, plus targeted checks of the revised examples.
Variable-output annotations leave extracted sources unchanged.

Co-Authored-By: Claude noreply@anthropic.com
Co-Authored-By: Codex noreply@openai.com

gusthoff and others added 10 commits October 23, 2026 23:03
Example output can change between executions because of addresses,
clocks, random values or task scheduling. During toolchain updates,
these differences can resemble compiler regressions.

Add `ada-run-expect-variable-output` as structured metadata so reviewers
can distinguish expected variation from regressions when comparing
toolchain versions.

Extraction produces identical files with and without the annotation.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
GNAT 16 rejects the original literal aspect functions because those
declared in `Main` are not primitive operations of `My_Type`. Move the
type and literal functions into the `My_Types` package specification and
import the package from `Main` in both examples.

Both examples build and run with GNAT 16.1, producing unchanged output.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
GNAT 16 rejects positional boxes in the two signature-package examples.
Ada RM 12.7 requires named notation for these boxed associations. Use
`P => <>` and `Hash => <>` to leave the subprogram actuals unconstrained
while binding the formal type to `T`.

Both corrected examples pass GNAT 16.1; the positional forms fail with
"box requires named notation".

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
GNATprove 16 reports that `External_Variable` is not written by
`Configuration`, despite its `Initializes` contract. Reading it to
initialize `Max` during `Stack` elaboration requires this contract;
removing it also fails flow analysis.

Initialize the non-imported variable to a valid `Positive` value.
`Max` still has variable input and must remain in `The_Stack`'s state
refinement.

Flow analysis passes with GNATprove 15 and 16. Removing the initializer
fails with 16; removing `Max` from the refinement still fails with 16.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Six container aggregate examples and two SPARK contract examples pass
with the GNAT 16 toolchain. Remove their GNAT 14.2 and GNATprove 14.1
pins and restore the run/prove buttons.

All eight blocks pass the pipeline checks with GNAT/GNATprove 16.1 and
GPRbuild 26, including the expected contract diagnostic.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
GNAT 16 no longer reports the ghost-use diagnostics discussed in the
ring-buffer examples 2 and 4. Pin both examples to the GNAT 15 toolchain
to preserve their expected errors and the accompanying explanations.
Replace compile/prove buttons with classes that keep pipeline checks
active while disabling the buttons for the default toolchain.

Both examples pass the checks with the pinned GNAT/GNATprove 15 and
GPRbuild 25 toolchain.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Use GNAT and GNATprove 16.1 with GPRbuild 26 for unpinned examples.
Keep older versions required by the remaining example pins, and remove
unreferenced GNATprove 14.1 and GPRbuild 22/24 releases.

Validated 18 files with 537 passing block reports on the updated
worktree VM, including all five pinned examples.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Recognize `ada-run-expect-variable-output` as widget metadata so
Sphinx can render examples that mark expected output variation.
Preserve the widget's existing buttons and execution behavior.

Validated the full HTML build with warnings treated as errors, the
existing parser suite, TypeScript tests, and LaTeX/EPUB fixtures.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Assign `Show_Cat` and `Show_Geo_Forms` to the projects containing their
package declarations so extraction includes the required `Animals` and
`Geo_Forms` units.

The object-oriented chapter check passes with GNAT 16.1 and GPRbuild 26.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Express `Set`'s dependency as `Ext => Ext`. The volatile objects
`X` and `Y` overlay elements of `Ext`, so the contract describes the
underlying array read and updated by `Set`.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
@gusthoff
gusthoff merged commit 597cdbc into AdaCore:main Oct 24, 2026
24 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant