Skip to content

Conversation

@TingDaoK
Copy link
Contributor

@TingDaoK TingDaoK commented Mar 7, 2024

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


# allow custom python to be used
parser = argparse.ArgumentParser()
parser.add_argument('--classifier')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use the argparser instead of env_variable because, in CI, linux-musl-armv7 needs to pass the env var into the docker, which is not easy to do.

But for "CRT_FIPS", I also want our test to get the info and verify the run time check for FIPS is working as expected.

Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

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

didn't get all the way through, but here are comments as I head out for the day

CMakeLists.txt Outdated

project(aws-crt-jni C)
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build" ON)
option(CRT_FIPS "Whether to build with FIPS compliance" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

debatable: I see you failing if FIPS=ON and this is 32bit linux, but there are still a lot of other cases where we do NOT fail (e.g. Windows, Apple, musl, armv6/7)

I'm just spooked about us thinking we're making FIPS builds but one day a year from now, one of the many intermediate steps for it to actually be FIPS doesn't work right during the release process

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a check later in the file like if (CRT_FIPS AND NOT FIPS) fail fail fail

since we only set FIPS=ON when going down the aws-lc path

# prepare FIPS uber jar, download the regular libs
- aws s3 cp --recursive s3://aws-crt-java-pipeline/${GIT_TAG}/lib $CODEBUILD_SRC_DIR/aws-crt-java/target/cmake-build/lib
# Override with the FIPS libs
- aws s3 cp --recursive s3://aws-crt-java-pipeline/${GIT_TAG}/fips_lib $CODEBUILD_SRC_DIR/aws-crt-java/target/cmake-build/lib
Copy link
Contributor

Choose a reason for hiding this comment

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

again, spooked about accidentally uploading fips jar without the expected fips libs. Can we assert that s3://.../fips_lib has the expected files in it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, the fips shared lib will have the same structure and name as the regular one, I don't think we can assert on the files to make sure it works.

We can probably run a test instead.

Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

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

fix & ship

- aws s3 cp --recursive s3://aws-crt-java-pipeline/${GIT_TAG}/fips_lib $CODEBUILD_SRC_DIR/aws-crt-java/target/cmake-build/lib
# Run a test to make sure we get the FIPS libs
- export CRT_FIPS=ON
- mvn test -Dtest=software.amazon.awssdk.crt.test.SystemInfoTest -Dshared-lib.skip=true
Copy link
Contributor

Choose a reason for hiding this comment

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

trivial: cool! but let's be a bit more explicit

Suggested change
- mvn test -Dtest=software.amazon.awssdk.crt.test.SystemInfoTest -Dshared-lib.skip=true
- mvn test -Dtest=software.amazon.awssdk.crt.test.SystemInfoTest.testIsFIPS -Dshared-lib.skip=true

CMakeLists.txt Outdated

project(aws-crt-jni C)
option(BUILD_DEPS "Builds aws common runtime dependencies as part of build" ON)
option(CRT_FIPS "Whether to build with FIPS compliance" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a check later in the file like if (CRT_FIPS AND NOT FIPS) fail fail fail

since we only set FIPS=ON when going down the aws-lc path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants