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

BCV checks KLib ABIs under build dirs #261

Open
Goooler opened this issue Jul 24, 2024 · 9 comments
Open

BCV checks KLib ABIs under build dirs #261

Goooler opened this issue Jul 24, 2024 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@Goooler
Copy link
Contributor

Goooler commented Jul 24, 2024

Enable KLib ABI validation with the version 0.16.2 and dump KLib ABIs, apiCheck works on my local device but CI:

* What went wrong:
Execution failed for task ':compose-multiplatform:library:klibApiCheck'.
> API check failed for project library.

  --- /home/runner/work/Calendar/Calendar/compose-multiplatform/library/build/api/klib-all/extracted/library.klib.api
  +++ /home/runner/work/Calendar/Calendar/compose-multiplatform/library/build/api/klib/library.klib.api
  @@ -5,7 +5,7 @@
   // - Show manifest properties: true
   // - Show declarations: true
   
  -// Library unique name: <kizitonwose-calendar.compose-multiplatform:library>
  +// Library unique name: <Calendar.compose-multiplatform:library>
   final enum class com.kizitonwose.calendar.compose.heatmapcalendar/HeatMapWeekHeaderPosition : kotlin/Enum<com.kizitonwose.calendar.compose.heatmapcalendar/HeatMapWeekHeaderPosition> { // com.kizitonwose.calendar.compose.heatmapcalendar/HeatMapWeekHeaderPosition|null[0]
       enum entry End // com.kizitonwose.calendar.compose.heatmapcalendar/HeatMapWeekHeaderPosition.End|null[0]
       enum entry Start // com.kizitonwose.calendar.compose.heatmapcalendar/HeatMapWeekHeaderPosition.Start|null[0]
  @@ -364,6 +364,12 @@
       final fun toString(): kotlin/String // com.kizitonwose.calendar.data/WeekDateRange.toString|toString(){}[0]
   }

You can repro this issue at kizitonwose/Calendar#566.

@Goooler Goooler changed the title BCV checks KLib ABI under build dirs BCV checks KLib ABIs under build dirs Jul 24, 2024
@fzhinkin
Copy link
Collaborator

@Goooler, the current klib-abi-validation pipeline extracts an ABI for supported targets from a file stored within the source's api-dir and writes a resulting file into build/api/klib-all/extracted/....

In your example, the first file is a file created by filtering out unsupported targets from an ABI file stored within project sources, and the second file is an ABI generated for the current revision:

  --- /home/runner/work/Calendar/Calendar/compose-multiplatform/library/build/api/klib-all/extracted/library.klib.api
  +++ /home/runner/work/Calendar/Calendar/compose-multiplatform/library/build/api/klib/library.klib.api

So there's nothing wrong in both files being stored in build dir.

The problem with the validation failing in CI seems to be caused by the rootProject.name property not being set in the kizitonwose/Calendar project. Unless the property set, Gradle will use the root directory name as a project name.

@Goooler
Copy link
Contributor Author

Goooler commented Aug 13, 2024

Thanks! It works now.

Is this related to #257?

@fzhinkin
Copy link
Collaborator

Not sure, it should be just kizitonwose/Calendar’s misconfiguration. While #257 is a bug on BCV side

@Goooler
Copy link
Contributor Author

Goooler commented Aug 13, 2024

rootProject.name is not necessary for every project, it's possible to cause this issue when we miss that.

@fzhinkin
Copy link
Collaborator

It's recommended to set rootProject.name as a name inferred from a directory name could be unstable (and the CI issue from the issue's summary is one example how lack of stability shows itself).

@Goooler
Copy link
Contributor Author

Goooler commented Aug 14, 2024

Should we note this point in README?

@Goooler
Copy link
Contributor Author

Goooler commented Aug 14, 2024

The failed tests from #262 (comment), they ref to the settings.gradle.kts already declare rootProject. See

@fzhinkin
Copy link
Collaborator

Should we note this point in README?

Yes, it definitely won't harm.

@fzhinkin fzhinkin added the documentation Improvements or additions to documentation label Aug 21, 2024
@ShreyashKore
Copy link

ShreyashKore commented Sep 29, 2024

I'm facing same issue, and even adding rootProject.name didn't help. Can it be because my project's name and inner module's name is same?

* What went wrong:
Execution failed for task ':inspektor:jvmApiCheck'.
> API check failed for project inspektor.
  --- /Users/runner/work/inspektor/inspektor/inspektor/api/jvm/inspektor.api
  +++ /Users/runner/work/inspektor/inspektor/inspektor/build/api/jvm/inspektor.api

Failing Run: https://github.com/ShreyashKore/inspektor/actions/runs/11087059708/job/30805337163
Project: https://github.com/ShreyashKore/inspektor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants