New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.GPDSC location clarification #207
Comments
@slhultgren - you are raising the same generator used by multiple different target-types. How about multiple generators? |
Here are proposed tables for paths in the different cases. @ReinhardKeil What do you think? Where is
|
csolution | cproject | clayer | component | Resulting folder for generated code and primary GPDSC location (look here for GPDSC first but if not found look in "Resulting GPDSC location" in workingDir table below) |
---|---|---|---|---|
n/a | n/a | n/a | referenced by project | $project/gendir-default |
n/a | n/a | n/a | referenced by layer | $layer/gendir-default |
gendir | n/a | ignored | referenced by project | $solution/gendir |
gendir | n/a | ignored | referenced by layer | $solution/gendir |
ignored | gendir | ignored | referenced by project | $project/gendir |
ignored | gendir | ignored | referenced by layer | $project/gendir |
n/a | n/a | gendir | referenced by project | $project/gendir-default |
n/a | n/a | gendir | referenced by layer | $layer/gendir |
Priority order:
project
– most importantsolution
layer
gendir-default: ./generated
Where is workingDir
specified and what is the result?
PDSC workingDir | PDSC specified GPDSC location | Resulting workingDir | Resulting GPDSC location | Comment |
---|---|---|---|---|
n/a | n/a | $project | workingDir | |
n/a | relative | $project | relative to workingDir | |
relative | n/a | relative to PDSC location | workingDir | |
relative | relative | relative to PDSC location | relative to workingDir | workingDir cannot be relative to GPDSC since GPDSC is relative to workingDir |
relative | absolute | relative to PDSC location | absolute GPDSC loc. | |
n/a | absolute | $project | absolute GPDSC loc. | |
absolute | n/a | absolute workingDir | workingDir | |
absolute | absolute | absolute workingDir | absolute GPDSC loc. | |
absolute | relative | absolute workingDir | relative to workingDir |
The workingDir
table does not really change anything compared to the current spec except clarifying the relative-relative that's an infinite recursion
The problem with Have you considered that type of workflows? I'm still leaning towards a I had not enough time to work on the aspects of multi-core yet with CMSIS-Toolbox 1.5.0 (as this version should fix the existing CubeMX workflow). |
clarifying /package/generators element the workingDir description:
|
Thanks for clarifying the relative workingDir case, makes sense :)
Hmm, this seems like a bit problematic, but indeed highlights the issue with placing certain files in the My belief is that the user is focused on the project. This is where they would expect files to be created. IMO the layer is only a "header-file" that is included by the project. The "build artifacts" and sources are still project focused. Compare |
Here is a proposal that could simplify the situation: Definitions: Practical usage (as it exists today) of working directory: Usage-Restrictions (should be enforce with tools like packchk).
New behavior of working directory (to be implemented) Suggestion remove request to define a “working-directory” in PDSC/GDPSC files. Behavior of $P/%P in PDSC/GDPSC files (already implemented in csolution, add to documentation)
Behavior of base directory for
Extending YML input files:
Verification by csolution tool: (new features)
|
Some comments on the proposal from #207 (comment)
The default values of gendir and rtedir to be either layer relative or project relative depending on where the component is specified seems hard to use in practice:
These seem like big hard-to-explain-limitations why certain combinations of default values and components/layers won't work. My vote will always be to simplify and completely remove the IMO the simplest rules would be to say (like in #207 (comment)):
|
@slhultgren thanks for your feedback. Let's discuss today what is written below: Execution Directory: Issue 626 discusses this problem already (suggests a PATH environment variable). I understand that a CubeMX team is working on a proposal. It should be relative easy to query the execution directory within the tool. When I remember correctly this is retrieved by GetModuleFileName or similar calls within the program itself. Working Directory:
Yes, I agree. However, my analysis of current pack implementations makes me believe that this will work. It needs however verification.
Agreed to some extend. However using If we discover during these tests that other options are required, i.e. your suggested default behavior, we can change the csolution tool accordingly.
|
Consider to change the name of Working Directory to Generator Output Directory |
I did review my proposal to remove the Working Directory. Unfortunately, this does not work for CubeMX for multi-processor projects or trustzone enabled projects. Here more then one cproject.yml share the same generator settings. I still would recommend to rename the directory to Generator Output Directory. We could make this directory configurable a csolution.yml level. Default when not specified is as described under #207 (comment) |
This is the revised proposal for the generators element in the PDSC file. workingDir is the default directory where generated files are stored. By default the directory is relative to the csolution.yml file (uses csolution.yml as base directory). Using the prefix $P makes the directory relative to the cproject.yml or clayer.yml that defines the component(s) with the related generator-id. workingDir cannot be an absolute path. workingDir can be overwritten by using the gpdsc is the name of the GPDSC file that the generator creates and updates. When using the csolution tool, the cbuild.yml file contains the generators:
Cube2:
working-dir: ../CubeFiles # from `gendirs:` or if not specified from PDSD file element <generators>
gpdsc: MyPackName.gpdsc # from PDSC file element <generators> |
Examples that use STM32CubeMX:
|
This is mostly part of the Today The The result would then be something like generators:
<generator id>:
# from `gendirs:` or if not specified from PDSC file element <generators>.
# The place where generator should create all files
gendir: ../CubeFiles
# from PDSC file element <generators>. Should be created inside the gendir above
gpdsc: MyPackName.gpdsc Then perhaps we could drop the |
@slhultgren it looks like we are now aligned. I reflected it in the Before I make a pull request, could you please review. Have a nice weekend. |
@slhultgren I suggest to close this item as Open-CMSIS-Pack/devtools#832 covers this now. |
Replaced by Open-CMSIS-Pack/devtools#880 - suggest to continue discussion there |
The specification https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_generators_pg.html#element_generator only specifies that the .gpdsc is located in the
specified absolute path
orrelative to the workingdir
.This is problematic if multiple contexts for different boards/component-sets use the same generator in the same project.
The
output-dirs[gendir]
property introduced in thecsolution / cproject
-yml files should solve this problem since this allows specification in a context aware way.Ideally both the
.gpdsc
and thegenerated files
created by the generator should end up in the user-configurableoutput-dirs[gendir]
-location.Backwards compatibility
Since not all generators will be aware of the
output-dirs[gendir]
from the$G
parameter, the tools should look for.gpdsc
in a few different places:output-dirs[gendir]
folder.relative to WorkingDir
/Absolute path specified
The text was updated successfully, but these errors were encountered: