kotlin: Kotlinc not found

Hi, getting the error when running Danger Kotlin on TeamCity CI: sh: 1: kotlinc: not found But kotlinc is installed at: /usr/local/kotlinc/bin/kotlinc

Do you happen to know how to solve this?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

I have the same issue on GitHub Actions.

My Dangerfile.df.kts

import systems.danger.kotlin.danger
import systems.danger.kotlin.onGitHub
import systems.danger.kotlin.pullRequest
import systems.danger.kotlin.warn

danger(args) {
    onGitHub {
        // Big PR Check
        if ((pullRequest.additions ?: 0) - (pullRequest.deletions ?: 0) > 300) {
            warn("Big PR, try to keep changes smaller if you can")
        }
    }
}

My ci.yaml

  danger:
    name: Danger
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2.4.0
      - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'
      - uses: fwilhe2/setup-kotlin@main
      - name: Danger
        uses: danger/kotlin@1.2.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

And the error I get is:

| Executing $(which danger) ci --process danger-kotlin --passURLForDSL  - pid 1
| Executing kotlinc -script-templates systems.danger.kts.DangerFileScript -cp /usr/local/lib/danger/danger-kotlin.jar -script Dangerfile.df.kts /tmp/danger-dsl.json danger_out.json - pid 23
|
| Uncaught Kotlin exception: kotlin.Exception: Command kotlinc -script-templates systems.danger.kts.DangerFileScript -cp /usr/local/lib/danger/danger-kotlin.jar -script Dangerfile.df.kts /tmp/danger-dsl.json danger_out.json exited with code 32512
|     at 0   danger-kotlin                       0x418785           kfun:systems.danger.cmd.Cmd.exec#internal + 1221
|     at 1   danger-kotlin                       0x4191e5           kfun:systems.danger.cmd.dangerfile.DangerFile#execute(kotlin.String;kotlin.String){} + 1189
|     at 2   danger-kotlin                       0x417ef4           kfun:systems.danger.DangerKotlin#run(){} + 2068
|     at 3   danger-kotlin                       0x41748c           kfun:#main(kotlin.Array<kotlin.String>){} + 2700
|     at 4   danger-kotlin                       0x4231a3           Init_and_run_start + 1811
|     at 5   danger-kotlin                       0x4232da           main + 10
|     at 6   libc.so.6                           0x7fd68c288d8f     0x0 + 140559451196815
|     at 7   libc.so.6                           0x7fd68c288e3f     __libc_start_main + 127
|     at 8   danger-kotlin                       0x405080           0x0 + 4214912
|
| sh: 1: kotlinc: not found
|
| Error:  Error: Got no results back from the Dangerfile evaluation, this is likely an issue with a custom sub-process exiting early.
|     at Executor.<anonymous> (/usr/lib/node_modules/danger/distribution/runner/Executor.js:152:35)
|     at step (/usr/lib/node_modules/danger/distribution/runner/Executor.js:33:23)
|     at Object.next (/usr/lib/node_modules/danger/distribution/runner/Executor.js:14:53)
|     at /usr/lib/node_modules/danger/distribution/runner/Executor.js:8:71
|     at new Promise (<anonymous>)
|     at __awaiter (/usr/lib/node_modules/danger/distribution/runner/Executor.js:4:12)
|     at Executor.handleResults (/usr/lib/node_modules/danger/distribution/runner/Executor.js:146:16)
|     at /usr/lib/node_modules/danger/distribution/commands/utils/runDangerSubprocess.js:172:47
|     at step (/usr/lib/node_modules/danger/distribution/commands/utils/runDangerSubprocess.js:44:23)
|     at Object.next (/usr/lib/node_modules/danger/distribution/commands/utils/runDangerSubprocess.js:25:53)
| Uncaught Kotlin exception: kotlin.Exception: Command $(which danger) ci --process danger-kotlin --passURLForDSL  exited with code 256
|     at 0   danger-kotlin                       0x418785           kfun:systems.danger.cmd.Cmd.exec#internal + 1221
|     at 1   danger-kotlin                       0x419fd8           kfun:systems.danger.cmd.dangerjs.DangerJS#process(systems.danger.cmd.Command;kotlin.String;kotlin.collections.List<kotlin.String>){} + 1336
|     at 2   danger-kotlin                       0x4170c6           kfun:#main(kotlin.Array<kotlin.String>){} + 1734
|     at 3   danger-kotlin                       0x4231a3           Init_and_run_start + 1811
|     at 4   danger-kotlin                       0x4232da           main + 10
|     at 5   libc.so.6                           0x7ff1924dbd8f     0x0 + 140675518414223
|     at 6   libc.so.6                           0x7ff1924dbe3f     __libc_start_main + 127
|     at 7   danger-kotlin                       0x405080           0x0 + 4214912

Any guidance would be greatly appreciated 😊