ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Improvement]: Support GraalVM compatibility flag per platform dependency

Open TharmiganK opened this issue 1 year ago • 0 comments

Description

Support marking a particular Java platform dependency as GraalVM compatible in the Ballerina.toml:

[[platform.java17.dependency]]
groupId = "io.ballerina.openapi"
artifactId = "client-native"
version = "1.9.0"
graalvmCompatible = true

Describe your problem(s)

Currently we can only make the entire package GraalVM compatible by adding the following to the Ballerina.toml:

[platform.java17]
graalvmCompatible = true

This make sense since the package developer can check for GraalVM compatibility and mark it as GraalVM compatible when publishing it to central.

But some of the Ballerina tools like persist, openapi(with effective to update 9) also adds some platform dependencies to support dependently typed functions. If the developers use such tools to create a package then we are giving some warning in bal pack saying that the package is not GraalVM compatible and we do not mark it as GraalVM compatible in the central.

But since these dependencies are added by the Ballerina tools, they are GraalVM compatible. But it is not appropriate to mark the entire project GraalVM compatible by the tool since the actual package can have additional platform dependencies.

So we need a way to derive the package as GraalVM compatible if it only has platform dependencies added by the ballerina tools.

Describe your solution(s)

As a solution we need an improvement to mark a specific platform dependency as GraalVM compatible like the below:

[[platform.java17.dependency]]
groupId = "io.ballerina.openapi"
artifactId = "client-native"
version = "1.9.0"
graalvmCompatible = true

Note: We could also make all io.ballerina.* platform dependencies as GraalVM compatible since these packages are published by Ballerina organisation. But the above approach is more general

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

TharmiganK avatar Apr 03 '24 03:04 TharmiganK