Skip to content

feat(slang): accept viaIR and warn - #771

Merged
hedgar2017 merged 5 commits into
mainfrom
slang-ignored-output-warnings
Sep 30, 2026
Merged

hedgar2017 merged 5 commits into
mainfrom
slang-ignored-output-warnings

Conversation

@nebasuke

@nebasuke nebasuke commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Projects that set viaIR compile again, with a warning that Slang ignores it.

$ solx Simple.sol --bin --via-ir
Warning: viaIR is ignored: Slang has a single compilation pipeline.

Split out of #710.

Hardhat projects routinely set `viaIR: true`, and rejecting it made every
such project fail to compile with Slang. Slang has a single compilation
pipeline, so the setting has nothing to select: it is now accepted with a
warning that it is ignored.
`sourceMap`, `functionDebugData` and `generatedSources` come back as empty
values for toolkit compatibility, which gave no sign that the request was
dropped. Each one spelled out in the output selection now warns that it
is left empty, and the source map warnings point at `debugInfo`, which
carries the DWARF equivalent. Umbrella selections such as `evm.bytecode`
stay quiet, since they ask for whatever the compiler has.
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Coverage Summary

Crate Line Coverage Function Coverage
solx 🟢 83.6% 🔴 20.0%
solx-benchmark-converter 🔴 0.0% 🔴 0.0%
solx-codegen-evm 🟡 55.3% 🔴 49.2%
solx-compiler-downloader 🔴 0.0% 🔴 0.0%
solx-core 🔴 47.1% 🟡 54.2%
solx-dev 🔴 3.2% 🔴 4.2%
solx-mlir 🟡 51.0% 🔴 46.3%
solx-slang 🔴 22.5% 🔴 30.4%
solx-solc-test-adapter 🔴 1.7% 🔴 2.1%
solx-standard-json 🔴 40.7% 🔴 44.6%
solx-tester 🔴 36.7% 🔴 34.6%
solx-utils 🔴 31.6% 🔴 35.0%
Total 🔴 12.9% 🔴 15.9%

Codecov Report | HTML Report | Workflow Run

@nebasuke
nebasuke force-pushed the slang-ignored-output-warnings branch from bc579aa to 7771d29 Compare September 30, 2026 16:23
@nebasuke nebasuke changed the title feat(slang): warn instead of failing on solc pipeline settings feat(slang): accept viaIR and warn for outputs left empty Sep 30, 2026
The hint is a suffix, so matching straight to it drops the Option and the push_str. The functionDebugData/generatedSources fixture no longer selects sourceMap, whose warning select_evm_bytecode_object_and_source_map already asserts.
opcodes is emitted empty like sourceMap, so an explicit selection gets the same warning. select_specific_bytecode now also checks that umbrella selections such as evm.bytecode stay quiet: Hardhat sends them on every compile.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The source-map warnings recommend a debug-info output that the current build does not emit, and several warning branches remain untested.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Allows Slang compilation to accept ignored viaIR settings and warn about explicitly selected empty outputs.

Changes:

  • Emits compatibility warnings for viaIR and unavailable output selectors.
  • Adds CLI and standard JSON coverage.
  • Updates user documentation.
File Description
solx-slang/​src/​slang/​mod.rs Generates compatibility warnings.
solx-standard-json/​src/​input/​settings/​selection/​mod.rs Exposes explicitly requested selectors.
solx-core/​src/​arguments.rs Updates --via-ir help text.
solx/​tests/​cli/​via_ir.rs Tests accepted viaIR behavior.
solx/​tests/​cli/​standard_json.rs Tests empty-output warnings.
solx/​tests/​cli/​standard_json_output.rs Updates output and viaIR expectations.
solx/​tests/​data/​standard_json_input/​select_evm_bytecode_object_and_source_map.json Adds source-map warning input.
solx/​tests/​data/​standard_json_input/​select_empty_outputs.json Adds empty-output warning input.
docs/​src/​user-guide/​02-command-line-interface.md Documents CLI compatibility behavior.
docs/​src/​user-guide/​03-standard-json.md Documents standard JSON warnings.
docs/​src/​user-guide/​04-limitations.md Updates the viaIR limitation.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread solx-slang/src/slang/mod.rs Outdated
Reverts 7771d29, b8e078b and 46856a7. Foundry's default selection names evm.bytecode.sourceMap and evm.deployedBytecode.sourceMap on every build, and the warnings carry no error code, so forge users could neither avoid nor filter them and deny_warnings builds failed. Foundry and Hardhat already handle the empty placeholders, which the standard JSON docs list as unsupported. viaIR keeps its warning: it is a setting that changes the compilation, not an output.
@nebasuke nebasuke changed the title feat(slang): accept viaIR and warn for outputs left empty feat(slang): accept viaIR and warn Sep 30, 2026
@nebasuke
nebasuke marked this pull request as ready for review September 30, 2026 17:52
@nebasuke
nebasuke requested a review from a team September 30, 2026 17:52
@hedgar2017
hedgar2017 added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit b16d639 Sep 30, 2026
45 checks passed
@hedgar2017
hedgar2017 deleted the slang-ignored-output-warnings branch September 30, 2026 21:36
@nebasuke nebasuke mentioned this pull request Oct 1, 2026
3 of 72 tasks
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