-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Driver dispatch Codegen 1.1 #5396
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
Driver dispatch Codegen 1.1 #5396
Conversation
|
@gilles-peskine-arm, This PR has pretty much what I had in mind for rev 1.1. It covers, JSON addition, header generation and key management templating. I expect CI to fail as-is, since the following two seem to be problems |
86cc89a to
da77e04
Compare
6dc91cf to
2585023
Compare
tests/docker/bionic/Dockerfile
Outdated
| # The version of Pylint is set to 2.4.4 to match CI. | ||
| RUN python3 -m pip install \ | ||
| packaging mypy pylint==2.4.4 | ||
|
|
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.
This fixes #5412 .
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 believe that this change is no longer required
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 haven't removed these changes as yet. Do we want to ?. As I understand it from my discussion with @gilles-peskine-arm this docker is not being used and will at some point be completely removed. I've been running my trial tests on this docker. So if it doesn't hurt, I would like to keep these changes. It's a stand alone commit, so can be knocked off.
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'm ok with having these changes. But please be aware that Arm will not make any effort to maintain this Dockerfile, and we're likely to remove it soon. We maintain and use https://github.com/ARMmbed/mbedtls-test/tree/master/resources/docker_files .
|
Changelog and Migration guide will be updated towards the end of review. |
2585023 to
71df609
Compare
scripts/data_files/driver_jsons/mbedtls_test_opaque_driver.json
Outdated
Show resolved
Hide resolved
.travis.yml
Outdated
| language: c | ||
| before_install: | ||
| - choco install python --version=3.5.4 | ||
| - pip install jsonschema==3.2.0 types-jsonschema |
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.
Any reason we are not using the scripts/min_requirements.py script from the install section?
install:
- $PYTHON scripts/min_requirements.py
If it has be provided in the before_install enviroment could we have a comment as to why so?
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 would assume min_requirements.py anyway gets triggered by .travis.yml, but on the Windows server, unless I explicitly request for this install, jsonschema is not installed and the CI cries in pain. @gilles-peskine-arm, I think we saw this in the past as well. Am I missing some thing here ?
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've lost track of all the attempts we made in the early draft of this PR, but I think it should be ok to remove this line. On Windows, first the before_install block installs Python, then the global install block installs the Python packages.
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.
Hmmm, this kind of just fixed itself and am very wary when that happens. @gilles-peskine-arm did we somehow force the Python version on the Windows server to not invoke the alternate system python. Any fixes that went in there ?
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 checked past versions and couldn't find attempts to do it differently here. Just this patch vs nothing. Failing attempts must have been due to not yet having the modules listed in a requirements file.
If it was necessary to install Python modules this way on Windows, that would also apply to Jinja2.
On the Travis Windows images, there's no system Python. Confusion between the system python and the Travis python are an issue on Linux.
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.
Thanks for checking ! But it did fail at some point and was hence added. Maybe something else tripped me then.
|
@minosgalanakis, @gilles-peskine-arm any further comments on this PR ? |
| - pip install jsonschema==3.2.0 types-jsonschema | ||
| env: | ||
| # Add the directory where the Choco packages go | ||
| - PATH=/c/Python35:/c/Python35/Scripts:$PATH |
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 my knowledge in latest Windows, Python can also be installed to:
C:\Users\username\AppData\Local\Programs\Python\Python35\
Should that also be included in the path?
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.
Python can be installed in any number of places on Windows. Here it only matters where we're installing it (with choco on the line above).
scripts/generate_driver_wrappers.py
Outdated
| 'scripts/data_files/driver_jsons/driver_transparent_schema.json'), 'r') as file: | ||
| transparent_driver_schema = json.load(file) | ||
| with open(os.path.join(mbedtls_root, \ | ||
| 'scripts/data_files/driver_jsons/driver_opaque_schema.json'), 'r') as file: |
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.
As discussed above
|
I have added few comments, which can be addressed when reworking the changes that @gilles-peskine-arm requested. |
3dc6d21 to
cc1122a
Compare
b489a1a to
2ae9376
Compare
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.
There's a sentence in the documentation that needs updating. Other than that, looks good to me.
In terms of design, I think there's too much intelligence in the template files, where the meta-logic is mixed with the C code. I'd prefer to have this intelligence in a single place, in the Python script. But this can be improved incrementally in the future.
Signed-off-by: Asfandyar Orakzai <[email protected]>
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.
Thanks for the update, LGTM
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.
Overall it looks good, and is fit for purpose.
Should we have a changelog entry before merging though?
Signed-off-by: Asfandyar Orakzai <[email protected]>
9bd28dc
Updated change log |
ChangeLog
Outdated
| and hmac_demo.c, which use PSA and the md/cipher interfaces side | ||
| by side in order to illustrate how the operation is performed in PSA. | ||
| Addresses #5208. | ||
| * Brought in PSA code gen driver list JSON, |
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.
plz no txtspk in chglog
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.
Also you need to add a file to Changelog.d, don't edit ChangeLog directly (if we edit ChangeLog directly we get conflicts between all the pull requests that do it).
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.
@gilles-peskine-arm Changelog issue is addressed, if there is anything please let me.
Signed-off-by: Asfandyar Orakzai <[email protected]>
Signed-off-by: Asfandyar Orakzai <[email protected]>
Signed-off-by: Asfandyar Orakzai <[email protected]>
Signed-off-by: Asfandyar Orakzai <[email protected]>
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.
LGTM
Thanks, What is merging strategy? |
|
@asfand-silabs Waiting for Minos to approve the latest version, then one of us will push the merge button. Thanks for the updates! |
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.
LGTM
|
@gstrauss Sorry about that. We didn't announce it in the changelog because it only affects people who use the development branch, not people who use a release (the generated file is included in the release). We should probably have a place where we can communicate this. Maybe add a changelog section for people who use development? Or just a small number of entries that are not applicable to people who use releases? (Noting that you need to consult For future reference, Python dependencies are listed in |
|
(Note that this information is in |
|
@gilles-peskine-arm as you can see, I was able to figure it out. The reason I posted is that the requirements changed underneath me and it was not immediately obvious. I do not frequently rebuild my test environment from scratch. When things broke for me, I did check for differences in |
Description
This is rev 1.1 of the Codegen that fixes #5137
Status
IN DEVELOPMENT
Requires Backporting
NO
Which branch?
Migrations
If there is any API change, what's the incentive and logic for it.
YES | NO
Additional comments
Any additional information that could be of interest
Todos
Steps to test or reproduce
NA