feat(slang): accept viaIR and warn - #771
Merged
Merged
Conversation
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.
Coverage Summary
|
nebasuke
force-pushed
the
slang-ignored-output-warnings
branch
from
September 30, 2026 16:23
bc579aa to
7771d29
Compare
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.
Contributor
There was a problem hiding this comment.
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
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
viaIRand 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.
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
marked this pull request as ready for review
September 30, 2026 17:52
hedgar2017
approved these changes
Sep 30, 2026
3 of 72 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Projects that set
viaIRcompile again, with a warning that Slang ignores it.Split out of #710.