#Error in bal pack : compilation

1 messages · Page 1 of 1 (latest)

sturdy sigil
#

hi Team,

I am trying to follow the readme of https://github.com/sameerajayasoma/app-gateway,

I am on Ballerina 2201.7.2 (Swan Lake Update 7)
Language specification 2023R1
Update Tool 1.3.15

Getting the following error.

bal pack Compiling source ballerinax/gateway:0.1.0 WARNING [gateway] Detected an attempt to compile this package using Swan Lake Update 7.2. However, this package was built using Swan Lake Update 5. To ensure compatibility, the Dependencies.toml file will be updated with the latest versions that are compatible with Update 7.2. ERROR [init.bal:(201:27,201:55)] invalid invocation of a non-isolated function in an 'isolated' function error: compilation contains errors

Any help? Thanks

orchid galleon
#

This is related to a bug fix done for Swan Lake Update 7, which disallowed calling non-isolated functions in an isolated function via function pointers of non-isolated types. https://ballerina.io/downloads/swan-lake-release-notes/swan-lake-2201.7.0#backward-incompatible-changes (issue - https://github.com/ballerina-platform/ballerina-lang/issues/40380).

The error is at https://github.com/sameerajayasoma/app-gateway/blob/master/gateway/init.bal#L201 and can be fixed by updating PluginInitFunction to represent only isolated functions. You will then have to update the init methods of the plugins in samples/xyz-gateway to be isolated too. E.g., https://github.com/sameerajayasoma/app-gateway/pull/3/files

Looping in @rustic obsidian too.