Skip to content

ci(codeql): force Kotlin recompile so CodeQL sees source#218

Merged
kirich1409 merged 1 commit into
mainfrom
claude/codeql-no-source-fix
May 30, 2026
Merged

ci(codeql): force Kotlin recompile so CodeQL sees source#218
kirich1409 merged 1 commit into
mainfrom
claude/codeql-no-source-fix

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Problem

The Analyze Kotlin (CodeQL) job fails with:

CodeQL could not process any code written in Java/Kotlin … no source code seen during build (exit code 32)

The workflow replaces CodeQL autobuild (which looks for a non-existent testClasses task in this KMP project) with ./gradlew assembleDebug. But with gradle/actions/setup-gradle restoring the Gradle cache, the Kotlin compile tasks are served from cache or marked UP-TO-DATE and skipped — so the CodeQL tracer observes zero source and the analysis aborts.

This is a workflow-configuration issue, independent of any source change; it surfaces on PRs whose diff doesn't force a recompile.

Fix

Add --no-build-cache --rerun-tasks to the CodeQL build step:

run: ./gradlew assembleDebug --no-build-cache --rerun-tasks

--rerun-tasks is the essential part — it ignores up-to-date checks and forces the Kotlin compile tasks to actually run, so the CodeQL tracer has source to analyze. --no-build-cache prevents the same outputs being pulled from the build cache.

This change is scoped to the CodeQL build step only; runtime/library behaviour is unaffected.

Verification

Once CI runs on this PR, the Analyze Kotlin check should complete successfully instead of failing with exit code 32.

https://claude.ai/code/session_01LxuawhwkZuJAAoMkDpSTGZ


Generated by Claude Code

The Analyze Kotlin job failed with 'no source code seen during build'
(exit code 32): assembleDebug compile tasks were served from cache / marked
UP-TO-DATE, so CodeQL's tracer observed no Kotlin source.

Add --no-build-cache --rerun-tasks to the CodeQL build step to force actual
recompilation, giving the tracer source to analyze.
@kirich1409 kirich1409 self-assigned this May 30, 2026
@kirich1409 kirich1409 marked this pull request as ready for review May 30, 2026 08:01
Copilot AI review requested due to automatic review settings May 30, 2026 08:01
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@kirich1409 kirich1409 merged commit 84cad63 into main May 30, 2026
11 of 12 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

kirich1409 added a commit that referenced this pull request May 31, 2026
* ci(codeql): force Kotlin recompile so CodeQL sees source (#218)

The Analyze Kotlin job failed with 'no source code seen during build'
(exit code 32): assembleDebug compile tasks were served from cache / marked
UP-TO-DATE, so CodeQL's tracer observed no Kotlin source.

Add --no-build-cache --rerun-tasks to the CodeQL build step to force actual
recompilation, giving the tracer source to analyze.

Co-authored-by: Claude <noreply@anthropic.com>

* chore: release 1.0.0 — Android-stable, docs restructure, CodeQL fix

- Bump VERSION_NAME to 1.0.0
- Add [1.0.0] CHANGELOG entry (Android-facing API as primary stable target)
- Fix mkdocs: exclude cc-verification/specs, add Known Limitations to nav,
  move iOS guides to "iOS Preview" section, update site_description
- Add "Stable in 1.0" admonition to Android guide
- Add "Preview" admonitions to iOS guides
- Fix CodeQL workflow: build-mode=manual + --no-build-cache --rerun-tasks

* test(shrinker): cover -keep defeating flag dead-code elimination (#217)

* test(shrinker): cover -keep defeating flag dead-code elimination

A consumer -keep rule (often a broad wildcard or @keep) that covers a
flag-guarded class defeats R8 tree-shaking: -assumevalues still folds the
disabled branch (behaviour unchanged), but the class itself is pinned as an
unconditional GC root and ships in the APK despite being unreachable —
silently losing the size benefit of build-time flags.

- Add writeBooleanRulesWithKeptDeadBranch() modelling the pitfall
- Add a regression test asserting the dead-branch class survives the keep
- Document the two-phase elimination model and keep-rule guidance in the
  R8 verification guide

* test(shrinker): assert branch folding in keep regression; fix docs

Address review feedback on the -keep regression test and guide:

- The keep test now also asserts BifurcatedCaller no longer references
  IfBranchCode, proving R8 still folded the disabled branch (phase 1) rather
  than only keeping the class alive via the kept caller. Adds
  assertClassDoesNotReference() (ASM bytecode inspection).
- Move -dontoptimize out of the 'not a problem' list in the R8 guide into a
  distinct hazard note — it suppresses elimination and must not be grouped
  with the harmless accessor-method keep.

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore: update Package.swift checksum for v1.0.0

* Bump develop version to 1.1.0-SNAPSHOT

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants