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

Support awssdk version 2.21.0 #958

Closed
scrocquesel opened this issue Oct 16, 2023 · 3 comments · Fixed by #989
Closed

Support awssdk version 2.21.0 #958

scrocquesel opened this issue Oct 16, 2023 · 3 comments · Fixed by #989
Labels
help wanted Extra attention is needed

Comments

@scrocquesel
Copy link
Member

Version 2.21.0 introduces a major internal refactor of authentication and more tight coupling with optional aws-crt package. Native build is impacted as it cannot find class definitions.

A potential solution is to provide native substitution using org.graalvm.sdk:graal-sdk to eliminate any dependency on aws-crt when the package is not included.

For eg.

public class Crc32ChecksumSubstitutions {
    static final String SOFTWARE_AMAZON_AWSSDK_CRT_PACKAGE = "software.amazon.awssdk.crt";

    static final class IsCrtAbsent implements BooleanSupplier {
        @Override
        public boolean getAsBoolean() {
            return !Arrays.asList(Package.getPackages()).stream()
                    .map(p -> p.getName())
                    .anyMatch(p -> p.equals(SOFTWARE_AMAZON_AWSSDK_CRT_PACKAGE));
        }
    }

    @TargetClass(Crc32CChecksum.class)
    static final class Target_Crc32CChecksum {

        @Alias
        private Checksum crc32c;

        @Substitute
        public Target_Crc32CChecksum() {
            crc32c = SdkCrc32CChecksum.create();
        }
    }
}
@scrocquesel scrocquesel added the help wanted Extra attention is needed label Oct 16, 2023
@hamburml
Copy link
Contributor

Isn't that a bug in the AWS SDK then? I thought the aws sdk for java 2.x has graalvm support https://aws.amazon.com/blogs/developer/graalvm-native-image-support-in-the-aws-sdk-for-java-2-x/

@scrocquesel
Copy link
Member Author

scrocquesel commented Oct 18, 2023

Isn't that a bug in the AWS SDK then? I thought the aws sdk for java 2.x has graalvm support https://aws.amazon.com/blogs/developer/graalvm-native-image-support-in-the-aws-sdk-for-java-2-x/

AFAIK, aws-crt is not yet supported aws/aws-sdk-java-v2#2948.

But it is indeed interesting that their CI tests passed. They use graalvm 22.3 and quarkus is using 23.0. Maybe there is a difference. Could be interesting to test https://github.com/aws/aws-sdk-java-v2/tree/master/test/sdk-native-image-test with mandrel 23.0

@scrocquesel
Copy link
Member Author

Isn't that a bug in the AWS SDK then? I thought the aws sdk for java 2.x has graalvm support https://aws.amazon.com/blogs/developer/graalvm-native-image-support-in-the-aws-sdk-for-java-2-x/

AFAIK, aws-crt is not yet supported aws/aws-sdk-java-v2#2948.

But it is indeed interesting that their CI tests passed. They use graalvm 22.3 and quarkus is using 23.0. Maybe there is a difference. Could be interesting to test https://github.com/aws/aws-sdk-java-v2/tree/master/test/sdk-native-image-test with mandrel 23.0

Build passed. I saw that aws-sdk is building the native image without --link-at-build-time which require types to be fully defined at native executable build time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants