2829 Commits

Author SHA1 Message Date
Patrick Quist
ee3e261bb3 Make libs= property optional via auto-discovery (#8552) 2026-03-11 21:40:54 +01:00
Patrick Quist
305156c0a4 fix: allow plus signs in property key names and values (#8485)
## Summary
- Fixes the property parser regex to allow `+` in key names (e.g.
`abc+def=etc`)
- The regex from #8387 used `[^=+]+` for key matching, which excluded
`+` from key names entirely
- Changed to a lazy `.+?` match so `+` is only treated as the `+=`
operator when immediately before `=`

This is a small targeted fix and does not address all edge cases with
the `+=` syntax.

## Test plan
- [x] Added test: `abc+def=etc` correctly sets key `abc+def` to `etc`
- [x] Added test: `abc=def+ghi` correctly sets key `abc` to `def+ghi`
- [x] All existing `+=` append tests continue to pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 21:10:47 -05:00
Jonathan Coates
e21749ea2b Update labelReference regex to match LLVM IR syntax (#8491)
A `catchswitch` instruction has the form:

    catchswitch within none [label %catch.start] unwind to caller

The LLVM IR parser then extracts the labels out of this expression.
However, the regex is too greedy, and (incorrectly) matches
`%catch.start]`. We update the regex to match what LLVM's lexer does.
The [language reference](https://llvm.org/docs/LangRef.html#identifiers)
states that quoted identifiers can include `\xx` escapes, however as far
as I can tell [that is *not*
true](413cafa462/llvm/lib/AsmParser/LLLexer.cpp (L391-L421)),
so I have elected not to support them.

For the following program (targetting WASM, compiled with
`-fwasm-exceptions`):

```c
void bar(int x);

void foo() {
    try {
        bar(1);
    } catch(int x) {
    }
}
```

**Before:**

<img width="1492" height="411" alt="A CFG of the above program. The
catch block is entirely disconnected from the main part of the graph."
src="https://github.com/user-attachments/assets/ad9038cc-f372-4109-bc25-328537bcea88"
/>

**After:**

<img width="1286" height="639" alt="A CFG of the above program. The
catch block is now correctly connected to the rest of the graph."
src="https://github.com/user-attachments/assets/27cce7b3-dd67-4c1c-928c-93f7eaa53fa2"
/>
2026-02-27 20:59:37 -05:00
Blake Ledden
05f60761ad Remove unused AsmResultLink type and links field (#8365)
The `links` field in `ParsedAsmResultLine` and the `AsmResultLink` type
have been unused since 2019 when clickable address links were replaced
by the labels system. This just removes the dead code.

Closes #8251
2026-02-27 20:49:32 -05:00
Matt Godbolt (bot acct)
b35398e471 Fix nasm default output format to elf64 (#8502)
Fixes #8273

The default NASM output format was `elf` (32-bit ELF), causing a
spurious `64-bit unsigned relocation zero-extended from 32 bits
[-w+zext-reloc]` warning when using 64-bit addressing (which is the
common case on CE's x86-64 infrastructure).

Changed the default to `elf64`. Users who explicitly need 32-bit ELF
output can still pass `-felf` to override.

*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-23 07:17:25 -06:00
Partouf
9ae16f889f go fix on large asm output 2026-02-23 14:02:44 +01:00
Matt Godbolt (bot acct)
20505fba5a Filter NVCC fatbinData label from assembly output (#8506)
*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

Closes #5178

## Problem

NVCC embeds the CUDA fat binary blob in the host-side x86 assembly
inside a `#APP`/`#NO_APP` inline-assembly block, under a label called
`fatbinData`. In a realistic kernel this can be 100+ lines of `.quad`
hex values — a wall of noise before any user-readable code.

Example: https://godbolt.org/z/W3YMcq8oY

## Fix

Per-compiler pre-processing step in `NvccCompiler.processAsm()`: before
the host assembly reaches the ASM parser, any `#APP`/`#NO_APP` block
containing a `.nv_fatbin` section is stripped out entirely.

- Only `.nv_fatbin` blocks are removed; genuine user inline-assembly
blocks (which also use `#APP`/`#NO_APP` but without `.nv_fatbin`) are
left intact.
- Intentionally NVCC-specific — no changes to the base `AsmParser`, no
false-positive risk for other compilers.
- Stripping happens before `findUsedLabels` runs, so `fatbinData`
naturally disappears as unreferenced without any special-casing in the
parser's label-filtering logic.
- Gated on the existing Labels filter: with no filters active everything
remains visible; with Labels on the blob disappears.

## Testing

**New compiler unit tests** (`test/compilers/nvcc-tests.ts`):
- Strips `#APP`/`#NO_APP` blocks containing `.nv_fatbin`
- Preserves `#APP`/`#NO_APP` blocks without `.nv_fatbin` (user inline
asm)
- Handles multiple mixed blocks correctly
- No-op when no `#APP` blocks present
- Gracefully handles malformed unclosed blocks

**New parser filter-case**
(`test/filters-cases/nvcc-x86-host-example.asm`): representative NVCC
12.0 host assembly (real 15-line fat binary, boilerplate functions,
`.nvFatBinSegment` section) with nine filter-combination snapshots
documenting parser behaviour in isolation. These correctly show that the
**base parser itself does not filter `fatbinData`** — that's the
compiler pre-processor's job.

All 767 tests pass.

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-22 19:46:36 -06:00
Saagar Jha
30ca56cd2d Centralize CORS handling for /api routes (#8504)
This fixes some APIs that were failing due to CORS checks since the
default handler would not respond to OPTIONS preflight requests from the
browser.
2026-02-22 17:29:21 -06:00
Matt Godbolt (bot acct)
54572dfa4d Add LLVM IR filters for declarations and library function thunks (#8503)
Closes #6319
Closes #6320

Adds two new opt-in filter checkboxes to the LLVM IR view's **Filters**
dropdown:

### Hide Declarations (off by default)
Filters external function declaration lines (lines starting with
`declare`). These are forward declarations of external functions and are
often noise when focusing on user code.

**Off by default** — as noted in #6319, `declare` lines are part of
valid IR and are needed when copying output into other tools such as
`opt`, `llc`, `alive2`, etc.

### Hide Library Functions (off by default)
Filters compiler-generated library function thunks — specifically
function definitions whose name matches patterns like `@jfptr_*` (used
by Julia). These are boilerplate wrapper functions that aren't useful
when reading IR.

**Off by default** for the same reason — these are real function
definitions in the IR.

Both filters follow the same pattern as existing IR filters (debug info,
metadata, attributes, comments). Unit tests added in
`llvm-ir-parser-tests.ts` covering filter-on, filter-off, and
preservation of unaffected lines.

*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-22 17:25:36 -06:00
Steve
17d1898b3a Add support for additional compiler options in .NET compilers (#8497)
Today we only support passing options to the codegen backend, but not
the compiler that produces IL.

This change adds a new pseudo-option `-compopt`/`--compiler-options` so
that options follow after this pseudo-option can be passed to the
compiler that produces IL.
2026-02-22 17:09:28 -06:00
Erik Hemming
97233932f1 Add m68k asm parser to handle | comment character (#8469)
m68k GAS uses `|` as the comment character instead of `#`.
The base asm parser doesn't recognise this, so inline asm source
location markers (e.g. `| 2 "file.c" 1`) leak through into the output
instead of being filtered.

Repro on godbolt.org: https://godbolt.org/z/vYneWc8Tf

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2026-02-16 14:01:37 -06:00
narpfel
c4c0ad4c8b [llvm-ir]: Filter empty metadata nodes (#8473)
LLVM IR specialised metadata nodes can have no arguments, e. g.
[`DIAssignID`](https://llvm.org/docs/LangRef.html#diassignid), which is
commonly emitted by `clang` (https://godbolt.org/z/rb19oGMoT).

These were not filtered because the regex required at least one
character in the field list.
2026-02-16 10:38:21 -06:00
Christopher Erleigh
08ba65abd7 fix: use llvm-objdump for cross-architecture binary disassembly (#8460)
## Summary

- When multiarch compilers (Rust, Zig, etc.) target a non-host
architecture (e.g. `--target=aarch64-unknown-linux-gnu`), GNU `objdump`
fails because it cannot disassemble foreign-arch binaries, producing
`<No output: objdump returned 1>`
- Adds a `llvmObjdumper` config property that switches to `llvm-objdump`
when the compilation targets a non-x86 instruction set, since
`llvm-objdump` can auto-detect the target architecture from the binary
itself
- All multiarch compilers benefit from this generically via
`BaseCompiler.getObjdumperForResult()` — no per-compiler special-casing
needed

## Changes

- **`types/compiler.interfaces.ts`** — Add `llvmObjdumper` to
`CompilerInfo`
- **`lib/compiler-finder.ts`** — Read `llvmObjdumper` from config
- **`lib/base-compiler.ts`** — Add `getObjdumperForResult()` method and
refactor `objdump()` to use it
- **`etc/config/rust.defaults.properties`** — Set
`llvmObjdumper=llvm-objdump`
- **`etc/config/zig.defaults.properties`** — Set
`llvmObjdumper=llvm-objdump`
- **`test/objdumper-tests.ts`** — Add 6 tests for cross-architecture
objdumper selection

## Test plan

- [x] `npm run ts-check` passes
- [x] `npm run lint` passes
- [x] All related tests pass (301 tests across 27 files)
- [x] Smoke test: configure a Rust compiler with
`--target=aarch64-unknown-linux-gnu` and verify `llvm-objdump` is used
instead of GNU `objdump`

Fixes #5593
2026-02-16 10:35:07 -06:00
jiakaiz-g
ac56744927 Add compiler overrides for dex2oat (#8435) 2026-02-09 19:27:57 +01:00
Matt Godbolt (bot acct)
164d33bb42 Add TinyGo compiler support (#8456)
Adds support for [TinyGo](https://tinygo.org/), an LLVM-based Go
compiler targeting microcontrollers and WebAssembly.

## Changes

- **New `TinyGoCompiler` class** (`lib/compilers/tinygo.ts`): Extends
BaseCompiler with TinyGo-specific handling:
- Forces binary mode (TinyGo has no `-gcflags=-S` equivalent — it's
LLVM-based, not gc)
  - Sets up `TINYGOROOT`, `GOROOT`, and `PATH` environment variables
  - Uses `tinygo build -o <output>` as the compilation command
- User arguments (e.g. `-opt=2`, `-gc=none`, `-scheduler=none`) pass
through directly
- **Config**: Adds TinyGo 0.37.0 to `go.amazon.properties`
- **Registration**: Exports `TinyGoCompiler` from `_all.ts`

## Why TinyGo?

TinyGo produces significantly smaller binaries than standard Go (445KB
vs 1.5MB for a hello world). It targets a different niche —
microcontrollers, WASM, and resource-constrained environments — making
it an interesting comparison alongside the existing gc and gccgo
compilers.

## Testing

Tested locally with CE running on a non-default port:
-  Compiler detected and version parsed correctly
-  Compilation produces x86 assembly via objdump (5000+ lines for a
simple program)
-  Execution works (`println` output captured correctly)
-  User arguments like `-opt=2` pass through correctly
-  All pre-commit checks pass (ts-check, lint, properties validation,
related tests)

## Infra

TinyGo 0.37.0 is already configured in the infra repo
(`bin/yaml/go.yaml`) — installation is just a tarball download from
GitHub releases.

The config references `/opt/compiler-explorer/golang-1.24.2/go` as
GOROOT — TinyGo needs a standard Go installation for the stdlib.

Closes #3969

🤖 Generated by LLM (Claude, via OpenClaw)

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-08 15:02:47 -06:00
Matt Godbolt (bot acct)
4229733210 feat(asm): add ca65 assembler (cc65 toolchain) for 6502 (#8455)
Add ca65 as a standalone assembler under the Assembly language, reusing
the existing cc65 toolchain installations (2.17, 2.18, 2.19, trunk).

ca65 generates a listing file with full macro expansion (`-x -x`) so
users can debug macro output — the primary use case from the feature
request.

**What's included:**
- `Ca65Compiler` class — runs ca65, captures the listing output
- `AsmParserCa65` — parses the ca65 listing format (address, hex bytes,
source)
- Config for all 4 existing cc65 versions as ca65 assemblers
- Include paths set to each version's `asminc` directory

**How it works:**
Since ca65 produces object files in cc65's custom format (not ELF), we
can't objdump them. Instead, we use ca65's `-l` (listing) flag with `-x
-x` (full macro expansion) and `--list-bytes 0` (unlimited hex bytes per
line). The listing shows addresses, generated bytes, and expanded source
— exactly what users need for macro debugging.

Closes #7118

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-08 14:23:56 -06:00
Partouf
2395dae3e3 Fix Go library annotation URLs and suppress spurious include path warnings
Go libraries on Conan use a `go_` prefix (e.g. `go_uuid`) but the frontend
was constructing annotation URLs without it. Add library-level `lookupname`
support in options-handler so versions inherit it, and set `lookupname` and
`packagedheaders` on Go libraries. Also suppress the "no include paths"
warning for `packagedheaders` libraries since their paths are resolved at
build time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 13:07:58 +01:00
Partouf
35b0a663cf hotfix go 2026-02-08 12:50:20 +01:00
Patrick Quist
eecaef4ef3 Add library support for Go compiler (#8397) 2026-02-08 01:18:43 +01:00
Matt Godbolt
ec1ac47033 Fix any types for delayCleanupTemp and toolchainPath (#8409)
## Summary

- Fixed `delayCleanupTemp: any` → `boolean`
- Fixed `toolchainPath: any` → `string | undefined`
- Changed `getToolchainPath()` to return `string | undefined` instead of
`string | false` (more idiomatic TypeScript)
- Fixed a latent bug in `changeOptionsBasedOnOverrides`

### Bug fix details

The bug was introduced in commit 079d49575 ("Compiler overrides #5001")
on May 16, 2023.

The original **correct** code (from commit 86a84f7f6) was:
```typescript
let sysrootPath: string | undefined;
const overriddenToolchainPath = this.getOverridenToolchainPath(overrides);
if (overriddenToolchainPath) {
    sysrootPath = getSysrootByToolchainPath(overriddenToolchainPath);
}
```

The buggy refactor changed it to:
```typescript
const sysrootPath = overriddenToolchainPath ?? 
    getSysrootByToolchainPath(overriddenToolchainPath);
```

This had two issues:
1. **The fallback was never reached**: `false ?? x` returns `false`
because `false` is not nullish (only `null`/`undefined` trigger `??`)
2. **The fallback passed the wrong variable**: It passed
`overriddenToolchainPath` to the fallback, but when the fallback is
needed, that variable would be `false`/`undefined`

Fixed to match the original correct behaviour:
```typescript
const sysrootPath = overriddenToolchainPath
    ? getSysrootByToolchainPath(overriddenToolchainPath)
    : this.toolchainPath
      ? getSysrootByToolchainPath(this.toolchainPath)
      : undefined;
```

The sysroot is now always computed via `getSysrootByToolchainPath()`,
since toolchain paths (e.g. `/opt/compiler-explorer/gcc-7.2.0`) differ
from sysroot paths (e.g.
`/opt/compiler-explorer/gcc-7.2.0/x86_64-pc-linux-gnu/sysroot`).

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run test-min` passes
- [x] Pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:31:18 -06:00
Matt Godbolt
2416973a8e Clean up and refactor LlvmPassDumpParser (#8430)
Addresses #4128 — cleans up commented-out code and improves code quality
in `LlvmPassDumpParser`.

**Commit 1: Remove commented-out code**
Remove unused fields (`label`, `instruction`), dead `maxIrLines`
configuration code, stale debug logging (`console.log`/`console.dir`),
and obsolete early-exit logic. The `compilerProps` constructor parameter
was only used by the commented-out code, so remove it and update all
call sites.

**Commits 2–4: Add comprehensive test suite**
50 tests locking in existing behaviour across all parser methods:
`breakdownOutputIntoPassDumps`, `breakdownPassDumpsIntoFunctions`,
`breakdownIntoPassDumpsByFunction`, `matchPassDumps`,
`associateFullDumpsWithFunctions`, and end-to-end `process()`. Covers
edge cases like loop dumps, `(invalidated)` passes, IR→MIR transitions,
CIR headers, and full-module mode.

**Commits 5–6: Clean up code style**
- snake_case → camelCase throughout (`raw_passes`, `final_output`,
`function_name`, etc.)
- Mark all regex fields `readonly`
- Replace `.map()` used for side effects with `for...of` loop
- Replace `[_, entry]` destructuring with `Object.values()`

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-02 20:06:09 -06:00
Saagar Jha
e622115375 Pair some more languages with their formatters (#8412)
Most of these should be fairly noncontroversial but for the others I
figured clang-format is better than no formatter. If someone ends up
adding more "official" options then it should be straightforward to
switch to using that instead.
2026-02-02 20:04:07 -06:00
Artem Belevich
76dc4b0ca5 Add += append syntax for string properties. (#8387)
Introduce a += operator in property file parsing that appends values to
existing string properties. This allows splitting long property values
across multiple lines for improved readability.

Example:
  group.compilers=comp1:comp2:comp3
  group.compilers+=:comp4:comp5:comp6

Error handling:
- Logs error and skips if += is used on an undefined property
- Logs error and skips if += is used on a non-string property

Includes unit tests for the new functionality.

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2026-02-02 20:02:38 -06:00
Matt Godbolt
53c7dd328b Configure Biome import organiser with grouped imports (#8431)
Enable Biome's `organizeImports` with groups matching the original
ESLint `import/order` configuration:

1. **Node builtins** (`node:fs`, `path`, etc.)
2. *(blank line)*
3. **Third-party packages** (`express`, `@sentry/node`, etc.)
4. *(blank line)*
5. **Local/relative imports** (`../foo.js`, `./bar.js`, aliases)

This resolves the inconsistency where Biome wasn't enforcing import
grouping, meaning new files would lose the blank-line separation that
the old ESLint config enforced.

### Impact
- **354 files** updated out of 738 checked (~48%)
- **+188 / -240 lines** (net -52) — almost entirely single blank line
additions/removals between import groups
- No import reordering; purely group separator consistency

Fixes #7373

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-01 20:50:46 -06:00
Matt Godbolt
11cc294698 Fix debug info leaking through filters with clang 21 (#8425)
## Summary
- Fixes #8364: clang 21 debug info (`.debug_loclists` etc.) was passing
through directive+label filters
- The label processor's `endBlock` regex only matched `.cfi_endproc`,
missing section boundaries (`.section`, `.data`, `.text`) that the main
parser already handles — so `currentLabelSet` was never cleared across
sections, causing weak label associations to leak from used labels (e.g.
jump tables in `.rodata`) into debug sections
- Passes `startBlock` and `endBlock` from the parser into `LabelContext`
instead of using hardcoded inline regexes, and clears `currentLabelSet`
on `endBlock`

## Test plan
- [x] Added `bug-8364.asm` test case with a jump table followed by
`.debug_loclists` section
- [x] Verified debug labels appear in unfiltered output but are excluded
from directive+label filtered output
- [x] Full test suite passes (2106 tests, no regressions)
- [x] TypeScript type check clean
- [x] Lint clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:11:08 -06:00
Matt Godbolt
ddb0266645 Convert propscheck.py to TypeScript/Vitest tests (#8404)
## Summary

Replaces the Python `propscheck.py` validation script with TypeScript
code that:
- Uses a testable validator module (`lib/properties-validator.ts`)
- Has comprehensive unit tests (71 tests in
`test/properties-validation-tests.ts`)
- Integrates with the existing property loading infrastructure
- Runs as part of the normal test suite

## Changes

- **New validator module** (`lib/properties-validator.ts`):
- Raw file validation: duplicate keys, empty list elements, typos,
suspicious paths
  - Orphan detection: compilers, groups, formatters, tools, libraries
  - Cross-file duplicate compiler ID detection
  - Disabled allowlist support (`# Disabled: id1 id2`)
- Invalid property format detection (leverages `parseProperties()` with
new `collectErrors` option)
  - Missing compilers list detection for language files

- **Property library enhancement** (`lib/properties.ts`):
- Added `collectErrors` option to `parseProperties()` for structured
error collection

- **New npm script**: `npm run test:props` for quick property validation
  - Set `CHECK_LOCAL_PROPS=true` to include `.local.properties` files

- **Updated references**:
  - CI workflow no longer calls propscheck.py
  - Pre-commit hook uses `npm run test:props`
  - CE Properties Wizard uses the new validation

- **Removed**: `etc/scripts/util/propscheck.py` and `propschecktest.py`

## Test plan

- [x] All 71 unit tests pass
- [x] Integration tests validate real config files
- [x] `npm run test:props` works standalone
- [x] CE Properties Wizard validation works
- [x] CI passes

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:03:00 -05:00
Matt Godbolt
707eac527c Fix any types for alwaysResetLdPath and compilerWrapper (#8410)
## Summary

Improves types for two properties in BaseCompiler:

- `alwaysResetLdPath: any` → `boolean` (added `false` default to
`ceProps()` call)
- `compilerWrapper: any` → `string | undefined` (using generic
`compilerProps<string>()`)

These are more precise than the initial `PropertyValue` type, matching
their actual usage.

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run test-min` passes
- [x] Pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:52:25 -05:00
Matt Godbolt
6f20c5a5c9 Fix any types for objdumperClass and executionEnvironmentClass (#8411)
## Summary

- `objdumperClass: any` → `new () => BaseObjdumper`
- `executionEnvironmentClass: any` → `typeof LocalExecutionEnvironment`

Used a constructor type for `objdumperClass` since `BaseObjdumper` is
abstract and `typeof BaseObjdumper` wouldn't allow instantiation.

### Additional fix

This change exposed a latent type issue: `ObjdumpResult.asm` is `string
| undefined`, but was being passed directly to
`postProcessObjdumpOutput(output: string)`. Added a nullish coalescing
fallback (`?? ''`) for safety.

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run test-min` passes
- [x] Pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:50:21 -05:00
Matt Godbolt
9c27705265 Use CompilationInfo type instead of Record<any, any> in tooling (#8408)
## Summary
- Replaces `Record<any, any>` with `CompilationInfo` for the
`compilationInfo` parameter in tooling files
- The `CompilationInfo` type was already imported in 2 of 3 files but
not used
- Follows up on #8407 which fixed the same issue for `tools` type

## Files changed
- `compiler-dropin-tool.ts` - use existing import
- `sonar-tool.ts` - use existing import  
- `microsoft-analysis-tool.ts` - add import
- `test/tool-tests.ts` - cast mock objects at declaration

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run test-min` passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:55:57 -05:00
Matt Godbolt
f49ed02cfb Fix ClientOptionsType.tools to use proper Tool type (#8407)
## Summary
- Changes `ClientOptionsType.tools` from `Record<any, any>` to
`Record<LanguageKey, Record<string, Tool>>`
- This prevents bugs like the one fixed in #8406 where `tool.name` was
used instead of `tool.tool.name`
- The `any` type was escaping type checking entirely

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run test-min` passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:28:16 -05:00
Matt Godbolt
695d764cc3 Fix /api/tools/:language endpoint missing name field (#8406)
## Summary
- Fixed the `/api/tools/:language` API endpoint to correctly return the
`name` field
- The `BaseTool` class stores tool properties in a nested `tool`
property, but the API handler was incorrectly accessing `name`,
`languageId`, and `stdinHint` directly on the class instance instead of
via `tool.tool.*`
- Added tests to verify the tools endpoint returns the expected fields

Fixes #8399

## Test plan
- [x] Added unit test that verifies `name` field is included in response
- [x] Added test for empty tools list
- [x] All existing tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:18:38 -05:00
Matt Godbolt
f46ad30286 Support absolute paths in temp directory creation (#8403)
## Summary
- When an absolute path prefix is provided to `temp.mkdir()` or
`temp.mkdirSync()`, use it directly instead of joining with
`os.tmpdir()`
- This supports use cases where compilers need temporary directories in
specific locations (e.g., shared NFS drives for remote compilation)
- Existing callers all use relative prefixes, so this is fully backwards
compatible

## Test plan
- [x] Added tests for both `mkdir` and `mkdirSync` with absolute paths
- [x] Verified existing tests still pass
- [x] Checked all callers use relative paths (no behaviour change)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:35:48 -05:00
Tony Cook
3d4fc27de0 Add the perl language (#8351)
Based on
https://github.com/KaceCottam/compiler-explorer/commits/language-perl/
rebased, modernized and captures the generated perl op codes.

<img width="1569" height="878" alt="image"
src="https://github.com/user-attachments/assets/4d131097-d258-419b-86c9-1a56c16f9ce2"
/>

---------

Co-authored-by: Kace Cottam <kaceac1@hotmail.com>
2026-01-25 16:50:12 -05:00
Steve
9a8f2b4ecf Add .NET 10 (#8314)
Add .NET 10 compilers.

Depends on https://github.com/compiler-explorer/infra/pull/1913
2026-01-25 16:28:56 -05:00
Matt Godbolt
da09217c98 Update dependencies (Jan 2025) (#8401)
## Summary
- Minor/patch package updates (AWS SDK, Sentry, Biome, Vitest, etc.)
- Removes Biome version pin workaround (bug in 2.3.9 is fixed)
- Fixes for stricter Express types in `@types/express` - `req.params`
and `req.query` values are now correctly typed as `string | string[]`

## Test plan
- [x] `npm run ts-check` passes
- [x] `npm run lint` passes
- [x] `npm run test-min` passes
- [x] Manual testing of shortlinks, API endpoints, noscript mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 16:22:24 -05:00
Dana Jansens
edf9bd889e Use prebuilt runtimes when linking with the Carbon toolchain (#8384)
This depends on https://github.com/compiler-explorer/infra/pull/1936
which builds the runtimes when installing the Carbon toolchain. Then
this PR passes `--prebuilt-runtimes` to the `carbon link` step in order
to use them. The result is that compiler explorer no longer times out
when trying to link a binary with the Carbon toolchain.

The carbon.ts file is refactored a little in an attempt to improve
clarity about what is going on, and some comments are added throughout.

Fixes https://github.com/carbon-language/carbon-lang/issues/6603.
2026-01-20 21:02:38 -06:00
Patrick Quist
b7a44e62b5 Add /noscript/clientstate/ endpoint for noscript mode (#8385) 2026-01-18 16:46:29 +01:00
Alastair Murray
8e6a58f16f Suppress crash reporting in Mojo compiler (#8382) 2026-01-18 12:31:33 +01:00
Blake Ledden
616c9d0152 Display helpful hints when compilation produces no assembly (#8369) 2026-01-06 00:01:47 +01:00
Matt Godbolt
07c7dfb620 Add comment explaining buildenvsetup.props serialization limitation
Documents why buildenvsetup.props works with prediscovered compilers
(language-level properties) while externalparser needed a different
approach (group-level properties). References #7150 for long-term fix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 07:39:29 -06:00
Matt Godbolt
5b7468293d Fix externalparser properties not surviving prediscovery serialization (#8359)
## Summary
- Fix externalparser not working with prediscovered compilers (e.g.,
MicroPython)
- The `externalparser.props` function was lost during JSON
serialization, causing `exe` path to be undefined
- Now stores `exe` and `args` directly on the externalparser object
- Removes the unused `props` function pattern from externalparser
- Adds proper TypeScript typing for externalparser
- Improves error messages to include compiler ID
- Adds delay before process.exit to allow Loki logs to flush

## Test plan
- [x] TypeScript type check passes
- [x] Linter passes  
- [x] Unit tests pass
- [ ] Deploy to staging and verify MicroPython compilers work

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 07:26:40 -06:00
narpfel
6ac2826949 Make quickfix suggestions clickable in the compiler output pane (#8354)
This makes quickfix suggestions applicable by clicking on the compiler
output line that contains the suggestion.

Example (https://godbolt.org/z/7EsbGM4r7):
<img width="912" height="581" alt="clickfixes"
src="https://github.com/user-attachments/assets/a579b6c5-947e-489c-b7e1-60ea2b79294b"
/>

The little <kbd>💡</kbd> icon indicates that a line contains a quickfix.

Requested in #5284.
2025-12-29 20:50:55 -06:00
Anson Mansfield
8a0fbf826b Add MicroPython Support (#8256) 2025-12-29 10:39:35 +01:00
narpfel
8afd059943 Fix linking Rust error messages to source (#8345)
The compiler output pane only links error messages to the source editor
when a filename is given. `parseRustOutput` didn’t parse the filename,
so Rust error messages were never linked.

This PR also simplifies the regex used to parse the `-->
filename:line:column` line in the `rustc` output. As far as I’m aware
(and I checked the history of the corresponding output in the `rustc`
source), the output format will always be `--> filename:line:column` and
not anything else accepted by the previous regex (no parentheses around
the line number, the column is not optional).
2025-12-20 13:54:45 +02:00
Grant Moyer
b5b71c17ac Fix wine initialization never completing (#8338)
Previously, wine initialization would never complete because it waits
for a magic string which cmd.exe never outputs, because the
corresponding echo never executes. This change adds a newline to the end
of the echo command, so the command executes, and wine initialization
completes.

Co-authored-by: Grant Moyer <code@grantmoyer.com>
2025-12-16 13:56:00 -05:00
Hayden Gray
aeaffd6755 [odin] accommodate changes made in dev-2025-02 (#8328)
in `dev-2025-02`, odin changed from single-module debug builds to
multi-module and prevents it from spitting out a single `.s` file. this
adds version checking to make sure that any odin version after
`dev-2025-02` uses `-use-single-module`. additionally, changes were made
around name canonicalization that required changing the matching for
label names to avoid clogging the assembly output (both standard and
binary)
2025-12-15 19:53:32 -06:00
nrdmn
4bcd8e2b52 Don't double escape metadata (#8296)
Before this PR, source code in the `<meta name="description">` and
`<meta property="og:description">` tags would be doubly escaped, leading
to html escaped code showing up in link previews. Examples:

Discord:
<img width="465" height="167" alt="discord"
src="https://github.com/user-attachments/assets/d2f867e6-f724-4177-8f1d-17986d13343f"
/>

Akkoma:

![akkoma](https://github.com/user-attachments/assets/22b11c48-1bef-4424-a70a-3948213a8354)


This fixes it by removing one layer of escaping.
2025-12-15 17:50:07 -06:00
Sayan Sivakumaran
adca61373a Make sure newlines are present in LLVM IR documentation (#8289) 2025-12-10 13:30:10 +00:00
Matt Godbolt
d2cc7118aa Minor updates and lint and format fixes (#8327) 2025-12-09 22:16:59 -06:00
Mark Zhuang
73393af963 Allow riscv64 run on current host (#8313)
Support execution when CE run on riscv64.
Tested on SpacemiT K1 board.
2025-12-09 21:59:29 -06:00