-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix Mbed TLS adjust-config.sh
script
#12998
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
Conversation
The Mbed TLS import script is quite fragile, and depends on certain lines to be present in the files it adjusts to be able to do the modifications it needs to to allow Mbed TLS to build within Mbed OS. Thsi commit changes the `adjust-config.sh` script to look for a the end of the config.h file, defined as "#endif /* MBEDTLS_CONFIG_H */" rather than the include line for "check_config.h". That's because the inclusion of "check_config.h" is being removed upstream in Mbed TLS to fix another issue.
@sbutcher-arm, thank you for your changes. |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
add_code \ | ||
"#include \"mbedtls\/check_config.h\"\n" \ | ||
prepend_code \ | ||
"#endif \/\* MBEDTLS_CONFIG_H \*\/" \ |
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 new approach only makes sense if Mbed TLS has changed to not include check_config.h
in config.h
, which hasn't happened yet. How about changing adjust-config.sh
to work both with the current Mbed TLS and with a future Mbed TLS without check_config.h
in config.h
, by replacing at #include MBEDTLS_USER_CONFIG_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 I said above:
I recommend to the maintainers that they put in their backlog to remove or replace these scripts. They were added as a temporary measure some years ago, and were never updated.
The correct approach is to remove the script and do this differently, preferably without scripts that adapt the source code.
Currently these scripts are brittle and break easily, and this is a modest change to address the immediate problem only.
@dgreen-arm @Patater Shall we merge this one? |
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 as a robustness improvement. Thanks!
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Summary of changes
The Mbed TLS import script is quite fragile, and depends on certain lines to be present in the files it adjusts to be able to do the modifications it needs to to allow Mbed TLS to build within Mbed OS.
This commit changes the
adjust-config.sh
script to look for a the end of theconfig.h
file, defined as#endif /* MBEDTLS_CONFIG_H */
rather than the include line for"check_config.h"
.That's because the inclusion of
"check_config.h"
is being removed upstream in Mbed TLS to fix another issue, which you can see here.I recommend to the maintainers that they put in their backlog to remove or replace these scripts. They were added as a temporary measure some years ago, and were never updated.
Impact of changes
This change should work with the current Mbed OS source, but critically, the change is necessary to allow a future version of Mbed TLS to work.
Migration actions required
None.
Documentation
Not necessary.
Pull request type
Test results
This has been tested by running the Mbed TLS importer script with
make update && make deploy
with the current source code, and that from Mbed TLS PR #1999.Reviewers
@Patater for old times's sake and @dgreen-arm who seems to have been the last person to touch the script.