Hello Martin,
thanks for the fix. Your patch works for me. I tried with
$ ./waf configure --rtems=/opt/rtems/6
--rtems-bsp=arm/xilinx_zynq_a9_qemu
$ ./waf
$ env QEMU_AUDIO_DRV="none" qemu-system-arm -no-reboot -net none -m
256M -serial null -serial mon:stdio -nographic -M xilinx-zynq-a9 -kernel
build/arm-rtems6-xilinx_zynq_a9_qemu/hello.exe
The hello world executable I used runs fine.
Many thanks again,
fk
On 10/5/23 15:40, Martin Erik Werner wrote:
Subject:
[PATCH] Avoid StopIteration exception for non-rtems .pc
From:
Martin Erik Werner <martinerikwerner....@gmail.com>
Date:
10/5/23, 15:40
To:
devel@rtems.org
CC:
chr...@rtems.org, sidd...@bnl.gov, frank.kuehn...@embedded-brains.de
_arch_from_arch_bsp() and _bsp_from_arch_bsp() has overly optimistic
assumptions that the argument must contain a '-'-separated field which
starts with "rtems". These functions are intended to find the target
triplet or the bsp parts of strings like "sparc-gaisler-rtems5-leon3"
and "arm-rtems6-xilinx_zynq_zc702"
But _find_installed_arch_bsps() may call _arch_from_arch_bsp() with the
name (without file extension) of any file which ends with ".pc",
including for example "expat". This triggers a StopIteration exception
when trying to find the next field after the "rtems" field, since no
"rtems" field exists to start with.
Rework these function to remove the preconditions, so that they return
None if no "rtems" field exist or if no field exists before or after the
"rtems" field.
It could be argued. based on their name, that calling these functions
with something that is not a triplet-bsp string is incorrect to start
with, but attempting to address that is not done here.
---
This should fix the issue discovered by David Siddons and Frank Kühndel
described in the "build failed" thread from 2023-07-23 in the
rtems-users mailing list with message-id:
<8e6c2841-ae9e-aacf-de84-e6340d204...@embedded-brains.de>
I have tested this fix when compiling the simple quickstart application
for the sparc-gaisler-rtems5-leon3 and arm-rtems6-xilinx_zynq_zc702
targets, but I have not verified execution of the build results, this is
probably the amount of testing that I will be able to perform at the
moment.
rtems.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/rtems.py b/rtems.py
index c65a7d2..a29d281 100644
--- a/rtems.py
+++ b/rtems.py
@@ -859,15 +859,17 @@ def _check_arch_bsps(req, config, path, archs, version):
def _arch_from_arch_bsp(arch_bsp):
fields = arch_bsp.split('-')
- rtems_field_index = next(i for i, field in enumerate(fields) if
field.startswith('rtems'))
- return '-'.join(fields[:(rtems_field_index + 1)])
-
+ for i, field in enumerate(fields):
+ if field.startswith('rtems') and fields[:(i + 1)] is not None:
+ return '-'.join(fields[:(i + 1)])
+ return None
def _bsp_from_arch_bsp(arch_bsp):
fields = arch_bsp.split('-')
- rtems_field_index = next(i for i, field in enumerate(fields) if
field.startswith('rtems'))
- return '-'.join(fields[(rtems_field_index + 1):])
-
+ for i, field in enumerate(fields):
+ if field.startswith('rtems') and fields[(i + 1):] is not None:
+ return '-'.join(fields[(i + 1):])
+ return None
def _pkgconfig_path(path):
return os.path.join(path, 'lib', 'pkgconfig')
-- 2.30.2
--
embedded brains GmbH & Co. KG
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehn...@embedded-brains.de
phone: +49-89-18 94 741 - 23
mobile: +49-176-15 22 06 - 11
Registergericht: Amtsgericht München
Registernummer: HRA 117265
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel