Open jkrech opened 1 year ago
I believe it is possible to define the generator directly in the pack different, for example with:
<generator id="generator-packid">
I believe this would do the same job.
Hi Reinhard,
/<generator-id>
; <generator-id>
is defined by the id
in the generators element of the PDSC file. the "generator-id" is a free string that will end up as the directory folder name in the filesystem.Based on your proposal: Manual definition of the "generator-Id" by the "pack PDSC writer" based on the following pattern "generatorName-PackID":
"generator-id" strict rules/naming conventions should be added here to prohibit having special chars not allowed at the file system level (e.g: \ / ? * : < > ") (a control to add at the PDSC schema level and in the packchk tool?).
"packId" included in the generator identifier naming conventions should be clarified also:
<vendor>::<name>@<version>
(since : char is not allowed at FileSystem level)<vendor>.<name>.<version>
<vendor>.<name>@<version>
Others you may suggest ?
Expected Full GeneratorId pattern : (to be confirmed):
<generatorName>-<vendor>.<name>@<version>
Ex: CubeGenerator-<vendor>.<name>@<version>
Observed drawbacks here:
having also the pack version in the generatorId means that it will be the responsibility of the pack developer to guarantee the alignment of the all occurrences of this generatorId in the PDSC (generators
node, generator
attribute at component level), this seems to be very error prone across different packs.
Other alternatives that could be analyzed/discussed:
since csolution tool is able to identify the generator original Pack (through the"from-pack"
attribute), maybe be it would be more convenient that the tool should guarantee the uniqueness of Generators invocations per pack (by appending the pack Id to the Generators PDSC declared Id at invocation time ?
This mechanism is already used for component identification inside a pack (always append the original packId before the component id description).
@Torbjorn-Svensson, based on your latest shared feedback, could you comment further this approach. thank you
I think you explained it all well @badreddinebenjemaa. What I would like is that the tool helps to identify the generators in a way that is guaranteed to be unique. If it's up to the pack creator to uniquely name the generators, there will likely be overlap between packs with unforeseen results.
a) updating the PACK.xsd schema file to restrict the "generatorID" (https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_generators_pg.html) to prevent special characters
b) vendor::name@version
should create the directory: vendor__name_version
but we could still debate whether the version becomes part of the directory name. A consequence of having the version is that each time the pack containing the generator component changes, the generated files will be located in a different directory. Also I question whether it is useful to use two different generator versions concurrently.
An alternative idea for discussion:
A generator is associated with a component. Should we extend the run syntax so that the component can be specified?
For example:
csolution run -g CubeMX(Device:DMA) mysolution.csolution.yml -c Blinky.Debug+STM32L4
Describe the bug In case there is two packs with selected generator components using the same
generatorID
there is no means of choosing a generator uniquely.Background: the scope of generator descriptions is limited to the current pdsc file. There is no mechanism to ensure unique naming of generatorIDs across packs. Therefore one needs to specify the
packID + generatorID
for a unique reference to a generator.To Reproduce Create two packs Test.A.1.0.0.pack and Test.B.1.0.0 with generator components. Call both generators "generator"
<generator id="generator">
. Create a cproject with the generator components selected from both packs and run:Expected behavior
Invoking the generator would require an additional flag e.g.
-p
If
-p
is not specified and there is ambiguity an error is thrown and the command aborted. If no pack version is specified the one specified in YAML input is used. If there is no version specified in YAML input then the latest installed pack version is used. If the version specified at the commandline conflicts with the version specified through YAML input and error is thrown and the command aborted.Environment (please complete the following information):
Additional context Add any other context about the problem here.