ci: use temporary directory for s2n_head build #4771
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
The
build
command in the nix develop shell ends up creating an "s2n_head" clone in the main repo. That's annoying because 1) the new folder shows up in "git diff" (although tbf that could be fixed by an update to .gitignore) 2) duplicate results show up in any search not specifically configured to ignore the clone. This is particularly annoying because the folder is created even when running the unit tests, not the integration tests (s2n_head is used by the cross_compatibility integ test).Test scripts shouldn't be writing build artifacts to our source directory, or even keeping them around at all. Persisting the build artifacts is unnecessary-- all we need are the s2nc_head and s2nd_head executables. $BUILD_DIR is a temporary folder, so we can instead put all the intermediate build artifacts there. Alternatively, if we don't want the build artifacts in a temporary folder, I could put them in the build folder.
We also don't need to build all the tests, just s2nc and s2nd. So I switched to targeted build commands. It's much faster.
Testing:
I kicked off a manual build of the standard integ tests: here
I also kicked off a manual build of the nix integ tests: here. However, I had to manually add the "cross_compatibility" test to the spec, because it looks like the nix integ tests don't include it. I'm not sure if that's intentional or an oversight, but the tests do pass with it added.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.