Skip to content
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

Fix failure detection and failures in basic-build-test.sh with SSL3 in full #3180

Conversation

gilles-peskine-arm
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm commented Apr 9, 2020

Needs partial backports. This PR is release-critical, but the backports aren't (we can check the logs manually to verify that there are no failures).

Alternative that doesn't change the full config: #3181

We used to enable MBEDTLS_ENTROPY_FORCE_SHA256 in the full config,
but this is no longer the case. So the seedfile now needs to be 64
bytes, nor 32 bytes.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm added mbed TLS team needs-backports Backports are missing or are pending review and approval. component-platform Portability layer and build scripts needs-ci Needs to pass CI tests labels Apr 9, 2020
@gilles-peskine-arm
Copy link
Contributor Author

gilles-peskine-arm commented Apr 9, 2020

CI run of basic-build-test.sh: https://jenkins-internal.mbed.com/job/mbedtls-release-new/717/ → PASS

This reverts commit 2b9ebce.

config.py full includes everything that can be tested together, even
deprecated algorithms and protocols.

Signed-off-by: Gilles Peskine <[email protected]>
This reverts commit 03035eb.

Since SSL3 is back in the full config, test it again.

Signed-off-by: Gilles Peskine <[email protected]>
The full config includes everything that can be tested together, even
deprecated features (except deprecated features that lack proper
testing or require additional build dependencies).

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm force-pushed the basic-build-test-status branch from d5f8b5c to aab670d Compare April 9, 2020 18:52
@gilles-peskine-arm gilles-peskine-arm added the needs-review Every commit must be reviewed by at least two team members, label Apr 9, 2020
@gilles-peskine-arm
Copy link
Contributor Author

gilles-peskine-arm commented Apr 9, 2020

New CI run of basic-build-test.sh: https://jenkins-internal.mbed.com/job/mbedtls-release-new/718/ → PASS (with no failed tests)

Run with only the changes in basic-build-test.sh (should fail due to the test case failures, but still emit a report at the end): https://jenkins-internal.mbed.com/job/mbedtls-release-new/720/ → FAIL as expected

@gilles-peskine-arm gilles-peskine-arm changed the title Fix failure detection and failures in basic-build-test.sh Fix failure detection and failures in basic-build-test.sh with SSLv3 in full Apr 9, 2020
@gilles-peskine-arm gilles-peskine-arm changed the title Fix failure detection and failures in basic-build-test.sh with SSLv3 in full Fix failure detection and failures in basic-build-test.sh with SSL3 in full Apr 9, 2020
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. I've run successfully basic-build-test.sh locally and seen the effect of some of the changes. I put comments about a possible typo and two commit messages that could maybe be improved.

@@ -898,9 +898,12 @@ component_test_full_cmake_clang () {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message is confusing to me: turning off deprecated features in something that builds deprecated stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, which commit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message of this commit "Turn off deprecated features in component_build_deprecated."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess it's the name of the component that's confusing. What it actually does is to check that if you build the library without deprecated features, and you arrange disable deprecated features (in either of two ways: compiler warning + -Werror, or compiling them out altogether), the build still works. I guess it should be called component_build_without_deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree that component_build_without_deprecated would be a better name in that case. Probably not for this PR to change that name though but if you include some of your above explanation in the commit message it would be all clear.

tests/scripts/basic-build-test.sh Show resolved Hide resolved
tests/scripts/basic-build-test.sh Show resolved Hide resolved
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, as commented out of github, for now I really prefer #3181 (ie the other PR, not this one). In the longer term, I don't have any objections to switching to the approach in this PR, but I think it needs more comments in some places.

@@ -166,6 +166,7 @@ def include_in_full(name):
if name in [
'MBEDTLS_CTR_DRBG_USE_128_BIT_KEY',
'MBEDTLS_DEPRECATED_REMOVED',
'MBEDTLS_DEPRECATED_WARNING',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something similar to the commit message should be added as a comment above this list, to avoid any ambiguity in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a backlog of writing comments to explain this list. A long time ago I wrote some for config.pl but that never got merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I think it adjusting the definition of full is the best time to finally add those comments. Otherwise this PR will only fix one half of the problem (the definition was suboptimal) but not the other half (different team members at different times had different enough conceptions of what "full" meant that we broke things), which is IMO at least as important.

@@ -898,9 +898,12 @@ component_test_full_cmake_clang () {
}

component_build_deprecated () {
msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
msg "build: make, full config - deprecated + DEPRECATED_WARNING, gcc -O" # ~ 30s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially pre-existing: I don't understand the purpose of this component. Probably deserves a comment in the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime I saw your reply to Ronald. I think something similar should be added as comments in the code.

The comments could also perhaps mention one point that wasn't immediately clear to me: we need to disable deprecated config.h options when building with DEPRECATED_WARNINGS because they use #warning which isn't affected by -Wno-deprecated (unlike deprecated functions which use the deprecated attribute).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR that code has existed since before the componentization of all.sh. The pure-full jobs might not have!

} | tee tests/cov-$TEST_OUTPUT

if [ "$(tail -n1 tests/cov-$TEST_OUTPUT)" != "SUCCESS" ]; then
echo >&2 "Fatal: 'make lcov' failed"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @mpg noted in the alternative PR there's an exit missing here.

@gilles-peskine-arm
Copy link
Contributor Author

Closed in favor of #3180. Some of the changes to config.py and all.sh may be made in a separate PR after further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-platform Portability layer and build scripts needs-backports Backports are missing or are pending review and approval. needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members,
Projects
None yet
3 participants