-
Notifications
You must be signed in to change notification settings - Fork 57
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
add const UID attribute to allow constant IDs #352
Conversation
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
+ test_file | ||
+ " ./out.vspec --validate-static-uid " | ||
+ "./validation_vspecs/validation.vspec " | ||
+ "--only-validate-no-export" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it is not obvious why you have "--only-validate-no-export"
here but not for the overlay alternative. Possibly add a comment.
Updated:
Now I noticed that in one of the overlay tests we actually check output. I suggest that we remove --only-validate-no-export
here as well so that the two variants behave in the same way, i.e. both generate files. Or have a separate option to control that.
Should usage possibly be described in https://github.com/COVESA/vss-tools/blob/master/docs/vspec2id.md |
@@ -68,6 +68,7 @@ class VSSNode(Node): | |||
"$file_name$", | |||
"fka", | |||
"delete", | |||
"constUID", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss how integrated we want the id-attributes to be in vss-tools. By adding constUID
(and previously fka
) they will be considered as core attributes and accepted in all tools.
There are two alternatives, one is to consider them as extended attributes and give warning unless they are specified by -e
, the other is to refactor vss-tools so that each tool can add their own core attributes. Or alternatively that we consider them as "global core attributes", but then we should possibly mention them in https://github.com/COVESA/vss-tools/blob/master/docs/vspec2x_arch.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikbosch can you please discuss this during the public meeting today? I have been sick yesterday / today, but can finish this tomorrow if you decide on how you want it to work. I would appreciate it, thank you!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep this for now, just add some documentation, then I can do a quick look and if ok I merge
Thanks for the hint! I will add documentation as soon as we decided on how this will be integrated |
MoM:
|
vspec/vssexporters/vss2id.py
Outdated
assert node.constUID.startswith( | ||
"0x" | ||
), f"constUID has to begin with '0x': {node.constUID}" | ||
assert len(node.constUID) == 10, f"Invalid constUID: {node.constUID}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am considering to move these two assert
statements to a utlils function and also run them on the generation of UIDs as an additional safety measure..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a better way to solve this here f46dd0c
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
I assume there is still some work remaining, like documentation. Correct @nwesem? |
thx for letting me know @erikbosch, I'm currently working on the documentation. Will be done soon. Would it be possible to include my suggestion for this issue #354 in the release candidate as well? I can do it for the shown |
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
@erikbosch quick question: to fix the bug mentioned in #354 I will branch off from here and merge back into this branch |
That works fine, no problem to use the same branch, or to use the "same" commit in multiple branches. Use what is easiest for you, as long as it is understandable what is the intended final result I have no problems fixing minor merge issues when a PR is to be merged. |
There is an issue. I implemented the default values for @erikbosch Do you have a second to take a look and help me on this? I pushed it to branch https://github.com/nwesem/vss-tools/tree/fix/var-init Also fyi @adobekan |
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
Hi @erikbosch I found a decent way to temporarily fix it here ad0b093 which means this PR is ready for 4.2 release. |
Thanks @nwesem - that works for me. I will take a look at the PR and let you know if I have any concerns. |
* add const UID attribute to allow constant IDs --------- Signed-off-by: Niclas Wesemann <[email protected]>
Hi this PR adds
constUID
attribute to allow overwriting generated static UIDs, as for static UID this is a 4-byte hex identifier. Please see testtest_const_id
for more details