Skip to content

[New Feature]: Support multiple bir and executable cache directories #44368

@warunalakshitha

Description

@warunalakshitha

Description

Problem
When compiling Ballerina programs, the compiler downloads and builds all dependencies from their source and stores the generated BIR files and thin JARs in the user’s local Ballerina cache. On subsequent compilations, these artifacts are loaded from the cache. However, during the first compilation, we have observed significant time and resource usage due to dependency compilation.

This becomes particularly problematic in cloud environments, where each user maintains their own cache. As a result, every user ends up compiling the same dependencies, leading to excessive resource consumption and longer build times.

Solution
Introduce a separate cache for system dependencies that can be shared across users—especially for standard ballerina/* and ballerinax/* modules. This shared cache would minimize redundant compilations and significantly reduce overall build time and resource usage.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team/DevToolsBallerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs )Type/NewFeatureneedTriageThe issue has to be inspected and labeled manuallyuserCategory/Compilation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions