From 66956ed5a2697094746c37333e34171f57fc86af Mon Sep 17 00:00:00 2001 From: Johannes Kliemann Date: Wed, 8 Apr 2026 16:15:48 +0200 Subject: [PATCH 1/2] Use pragma instead of aspect for Interrupt_Priority on Serial_Port The definition of Serial_Port uses the aspect Interrupt_Priority taking a value from the specified discriminants. However the discriminant is not visible in this scope. Use a pragma in the definition of the type instead where the discriminant is visible. ref #466 --- examples/shared/serial_ports/src/serial_io-nonblocking.ads | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/shared/serial_ports/src/serial_io-nonblocking.ads b/examples/shared/serial_ports/src/serial_io-nonblocking.ads index dde343f8f..3de63131b 100644 --- a/examples/shared/serial_ports/src/serial_io-nonblocking.ads +++ b/examples/shared/serial_ports/src/serial_io-nonblocking.ads @@ -77,9 +77,11 @@ private (Device : not null access USART; IRQ : Interrupt_ID; IRQ_Priority : Interrupt_Priority) - with - Interrupt_Priority => IRQ_Priority is + pragma Interrupt_Priority (IRQ_Priority); + -- FIXME: this is supposed to be an aspect, however with FSF GNAT 12 + -- the compiler does not have IRQ_Priority in scope when an aspect is + -- used and rejects it. procedure Start_Sending (Msg : not null access Message); From 6dc9b651c1bcbf9b4fa1e5a5e3c62f681135461d Mon Sep 17 00:00:00 2001 From: Johannes Kliemann Date: Wed, 8 Apr 2026 16:40:10 +0200 Subject: [PATCH 2/2] Use shutil.which instead of distutils.spawn in build_all_examples.py The function distutils.spawn.find_executable is deprecated and should be replaced with shutil.which. Distutils itself is also no longer part of the standard library as of Python 3.12. ref #466 --- scripts/build_all_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_all_examples.py b/scripts/build_all_examples.py index 3079111ba..36c9bc1e9 100755 --- a/scripts/build_all_examples.py +++ b/scripts/build_all_examples.py @@ -5,7 +5,7 @@ import os.path import subprocess import sys -import distutils.spawn +import shutil ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) @@ -173,7 +173,7 @@ def gprbuild(project_file, debug=False): ] # Check if RISC-V32 compiler is available -if distutils.spawn.find_executable("riscv64-elf-gnatls"): +if shutil.which("riscv64-elf-gnatls"): # Add RISC-V32 projects projects += ["/examples/HiFive1/hifive1_example.gpr"]