Silence scala-cli 'using directives in multiple files' warning when running plugin commands #339

Open
opened 2026-04-10 12:18:43 +00:00 by mprihoda · 3 comments
mprihoda commented 2026-04-10 12:18:43 +00:00 (Migrated from github.com)

Problem

When running plugin commands, scala-cli warns about using directives appearing in multiple files:

./iw kanon/transcript-analyze PROC-272
[warn]  Using directives detected in multiple files:
- /home/mph/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-6:71
It is recommended to keep them centralized in the /home/mph/Devel/iw/iw-cli/core/project.scala file.

This is expected — plugins legitimately need their own //> using dep directives in their lib/ files, separate from iw-cli core's project.scala. The warning is noise and confuses users.

Context

iw-run already passes -q and --suppress-outdated-dependency-warning to scala-cli (line ~599). The multi-file directive warning needs a separate suppression flag.

Possible approaches

  1. --suppress-directives-in-multiple-files-warning — scala-cli has this flag (added in 1.x). Just add it to the scala-cli run invocations in iw-run.

  2. //> using options directive — some scala-cli warnings can be suppressed via directives, but this one likely can't.

  3. Restructure plugin deps — avoid //> using in plugin lib files entirely by passing deps as CLI args. Overly complex and breaks the current plugin authoring model.

Approach 1 is the obvious fix if the flag exists in our scala-cli version.

Acceptance criteria

  • Running ./iw <plugin>/<command> does not show the "using directives detected in multiple files" warning
  • Core commands (no plugins) are unaffected
## Problem When running plugin commands, scala-cli warns about `using` directives appearing in multiple files: ``` ./iw kanon/transcript-analyze PROC-272 [warn] Using directives detected in multiple files: - /home/mph/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-6:71 It is recommended to keep them centralized in the /home/mph/Devel/iw/iw-cli/core/project.scala file. ``` This is expected — plugins legitimately need their own `//> using dep` directives in their `lib/` files, separate from iw-cli core's `project.scala`. The warning is noise and confuses users. ## Context `iw-run` already passes `-q` and `--suppress-outdated-dependency-warning` to scala-cli (line ~599). The multi-file directive warning needs a separate suppression flag. ## Possible approaches 1. **`--suppress-directives-in-multiple-files-warning`** — scala-cli has this flag (added in 1.x). Just add it to the `scala-cli run` invocations in `iw-run`. 2. **`//> using options` directive** — some scala-cli warnings can be suppressed via directives, but this one likely can't. 3. **Restructure plugin deps** — avoid `//> using` in plugin lib files entirely by passing deps as CLI args. Overly complex and breaks the current plugin authoring model. Approach 1 is the obvious fix if the flag exists in our scala-cli version. ## Acceptance criteria - [ ] Running `./iw <plugin>/<command>` does not show the "using directives detected in multiple files" warning - [ ] Core commands (no plugins) are unaffected
Member

Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-339/analysis.md on branch IW-339

Intake: agent-ready Workflow: diagnostic Reason: all gates passed Analysis: project-management/issues/IW-339/analysis.md on branch IW-339
Member

Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin did not compile against the iw-cli core of this branch, so no phase ran

batch-implement.log was not written; the command stopped while scala-cli compiled the plugin. Its output:

[warn]  Using directives detected in multiple files:
- ~/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-7:41
It is recommended to keep them centralized in the core/project.scala file.

[error] ~/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7
[error] Found:    Either[iw.core.model.TrackerError, Option[batch.ForgeState]]
[error] Required: Either[String, Option[batch.ForgeState]]
Compilation failed

The iw-cli core on main returns TrackerError from the tracker port's forge calls (#778, #780). The installed kanon plugin still expects String there. This blocks every iw-cli issue in the implement loop, not only this one, until the plugin is updated.

Implement: needs-human Reason: batch-implement exit 1 — the kanon plugin did not compile against the iw-cli core of this branch, so no phase ran `batch-implement.log` was not written; the command stopped while scala-cli compiled the plugin. Its output: ``` [warn] Using directives detected in multiple files: - ~/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-7:41 It is recommended to keep them centralized in the core/project.scala file. [error] ~/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7 [error] Found: Either[iw.core.model.TrackerError, Option[batch.ForgeState]] [error] Required: Either[String, Option[batch.ForgeState]] Compilation failed ``` The iw-cli core on `main` returns `TrackerError` from the tracker port's forge calls (#778, #780). The installed kanon plugin still expects `String` there. This blocks every iw-cli issue in the implement loop, not only this one, until the plugin is updated.
Member

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#339
No description provided.