Closed RobertRostohar closed 6 days ago
The issue I see here is that the output in the *.cbuild-idx.yml
is intended to be copied into the CMSIS Solution project files.
The problem is that the CMSIS Solution project files must not use absolute paths (unless dynamically constructed by access sequences) for portability. Therefore it is "impossible" to create a reference to another drive.
Specification is here: https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/YML-CBuild-Format.md#configurations
@jkrech it should be possible to locate the pack content on a different (central) drive then the actual application. The path:
must then include a drive specification, otherwise the IDE cannot copy the layer. I would recommend that path:
is always an absolute path to the folder that contains the layer.
It is however acceptable to have no value for Board-Layer:
in this situation.
A detail in this GH issue that may have gone unnoticed is that the pack where the layer is located is a local pack which might be in a different drive not only in respect to the solution but also different from the pack repository itself. This scenario is not portable.
Following Reinhard's recommendation, agreed on Open-CMSIS-Pack Technical Meeting 2024-06-04, the path
node will always have an absolute path.
The *-Layer
variable may also contain an absolute path when it is not in the solution drive nor in the pack repository.
I would recommend to reconsider in the future the location of the layer configuration information to avoid deviating *.cbuild-idx.yml
purposes from its primary scope.
Describe the bug
cbuild setup
detects valid layers from packs and writes the configuration variables to*.cbuild-idx.yml
. However the variables are invalid when the pack is on a different drive than the project. Also an absolute path should be used when the relative path is not within the solution directory.To Reproduce Use an example which requires layer detection and put it on a different drive than the pack with the layer. Run
cbuild setup *.csolution.yml
and examine the configuration variables in*cbuild-idx.yml
.You can also use the following project and pack to reproduce this:
Project: FileSystem.csolution.yml:
target-types
:File_Demo.cproject.yml:
provides: - CMSIS-RTOS2
(not needed with the upcoming CMSIS-Toolbox 2.5.0)Pack: STM32H743I-EVAL_BSP: install as local pack
Run
cbuild setup FileSystem.csolution.yml
FileSystem.cbuild-idx.yml
contains the following when the pack is on a different drive than the project:Board-Layer:
is invalid andpath
is missing.FileSystem.cbuild-idx.yml
contains the following when the pack is on the same drive as the project:Board-Layer:
andpath
are correct however they use a relative path. An absolute path should be used when the relative path is not within the solution directory.Expected behavior Variables should be correct regardless if the pack is installed on a different drive than the project. Also an absolute path should be used when the relative path is not within the solution directory.
Environment: