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

[Bug]: Bad sad error occurs when the CompilerPlugin.toml is empty #42120

Closed
SasinduDilshara opened this issue Feb 6, 2024 · 4 comments
Closed
Assignees
Labels
Area/CLI-BuildTools Credits/30 Fix/Crash All issues caused by NPE, CCE, etc Hacktoberfest Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@SasinduDilshara
Copy link
Contributor

Description

Steps to reproduce

Create a Ballerina project that contains both Ballerina and native packages with a `CompilerPlugin.toml`.
Commented the content in the `CompilerPlugin.toml`
Then build the project using `./gradlew clean build`

Bad sad error is

ballerina: Oh no, something really went wrong. Bad. Sad.

We appreciate it if you can report the code that broke Ballerina in
https://github.com/ballerina-platform/ballerina-lang/issues with the
log you get below and your sample code.

We thank you for helping make us better.

[2024-02-06 16:51:51,836] SEVERE {b7a.log.crash} - Index 0 out of bounds for length 0 
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
        at java.base/java.util.Objects.checkIndex(Objects.java:361)
        at java.base/java.util.ArrayList.get(ArrayList.java:427)
        at io.ballerina.projects.JBallerinaBalaWriter.addCompilerPlugin(JBallerinaBalaWriter.java:121)
        at io.ballerina.projects.BalaWriter.populateBalaArchive(BalaWriter.java:135)
        at io.ballerina.projects.BalaWriter.write(BalaWriter.java:108)
        at io.ballerina.projects.JBallerinaBackend.emitBala(JBallerinaBackend.java:244)
        at io.ballerina.projects.JBallerinaBackend.emit(JBallerinaBackend.java:221)
        at io.ballerina.cli.task.CreateBalaTask.execute(CreateBalaTask.java:79)
        at io.ballerina.cli.TaskExecutor.executeTasks(TaskExecutor.java:40)
        at io.ballerina.cli.cmd.PackCommand.execute(PackCommand.java:256)
        at java.base/java.util.Optional.ifPresent(Optional.java:178)
        at io.ballerina.cli.launcher.Main.main(Main.java:58)
 


Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Feb 6, 2024
@SasinduDilshara SasinduDilshara added Fix/Crash All issues caused by NPE, CCE, etc Area/CLI-BuildTools and removed needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Feb 6, 2024
@nipunayf nipunayf added the Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) label Feb 17, 2024
@gayaldassanayake gayaldassanayake added Hacktoberfest Points/0.5 Equivalent to half a day effort labels Sep 27, 2024
@keizer619 keizer619 added Credits/20 Credits/30 and removed Points/0.5 Equivalent to half a day effort Credits/20 labels Sep 30, 2024
@Shadow-Devil
Copy link
Contributor

Hi, I already added a PR for a duplicate of this issue.
PR: #43426
Duplicate: #41418

Could you please assign this issue to me and does this still count towards the Hacktoberfest?
Thank you :)

@azinneera
Copy link
Contributor

Hi, I already added a PR for a duplicate of this issue. PR: #43426 Duplicate: #41418

Could you please assign this issue to me and does this still count towards the Hacktoberfest? Thank you :)

Hi @Shadow-Devil

Yes we can apply it for Hacktoberfest :)

@gimantha
Copy link
Contributor

Fixed with #43426

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@gimantha gimantha added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CLI-BuildTools Credits/30 Fix/Crash All issues caused by NPE, CCE, etc Hacktoberfest Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug
Projects
Status: Done
Development

No branches or pull requests

8 participants