Commit Graph
214 Commits
Author SHA1 Message Date
PartoufandClaude 1e81e3d103 Add s3Key property to compilation results for large result S3 storage
- Add optional s3Key property to CompilationResult interface
- Set s3Key = BaseCache.hash(key) in both compile() and cmake() functions
- Remove s3Key from API responses before sending to users
- Add size checking and logging for large results in compilation queue
- Update documentation with S3 storage integration details

This enables compilation workers to reference large results (>31KiB)
stored in S3 using the deterministic cache key hash, addressing
WebSocket disconnection issues with large compilation results.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-13 05:23:03 +02:00
Matt GodboltandPartouf 2ae38a0c3f Make argument parsers instances instead of static classes (#8017)
- Made parsers stateful instances instead of shared static state (for
mllvm options). Fixes #8011 as this is caused by multiple clang-based
compilers being run concurrently and stomping over each others' state.
- passes `Compiler` to the constructor, which removes some param passing
- Added some missing awaits
- Tried to get things less dependent on `examples`, only `go` needs it
- Spotted that `zig` c++ might have issues in discovery
- Fly-by fixed a broken go path in ppc64le_gl122
- removed a redundant override in coccinelle
- made the mojo parser actually use the parser it defined
- canonified tablegen's special method
- 

I changed the zig parser too but as best I can tell it was broken before
(the `1` return value from the command it runs:)

```
ubuntu@ip-172-30-0-164:/infra/.deploy$ /opt/compiler-explorer/zig-0.14.1/zig c++ -mllvm --help-list-hidden /infra/.deploy/examples/c++/default.cpp -S -o /tmp/output.s
...
  --x86-use-vzeroupper                                                       - Minimize AVX to SSE transition penalty
  --xcore-max-threads=<number>                                               - Maximum number of threads (for emulation thread-local storage)
/infra/.deploy/examples/c++/default.cpp:1:1: error: FileNotFound
```
return code 1 (means it's not cached)

---------

Co-authored-by: Partouf <partouf@gmail.com>
2025-08-11 12:14:13 -05:00
Iain Buclaw 1055430504 Add alias option for gcc tree/rtl viewer (#7985) (#7987)
This option is undocumented, but has been around since 2010 for GCC
4.6.0
2025-08-04 15:44:08 +02:00
Matt Godbolt 8734c3e492 Update biome (#7956)
- latest biome, and fix its configuration
- fixes "static" content to be globally configured too (instead of
per-line)
- fixes issues:
  - imports fixed up
  - `Date.now()` vs `+new Date()`
  - some unused things `_` prefixed
 
After discussion with the team, turned off the unused parameter warning.
2025-07-28 10:34:46 -05:00
Ofek c2e9d61fe9 Adapt python cfg to python 3.13 (#7906)
Along with improved function names.
2025-07-12 18:39:00 +03:00
OfekandOfek Shilon 6a0188a5ed Fix #7852: return processRawOptRemarks back to BaseCompiler (#7860)
Co-authored-by: Ofek Shilon <oshilon@speedata.io>
2025-06-24 07:33:53 +03:00
Patrick Quist a01104840d Add CopperSpice GUI support with automatic Xcb plugin deployment (#7822) 2025-06-19 07:04:37 +02:00
Ofek daf15af5ab Fix #7809 plus some refactoring (#7812)
Fix #7809 and then some:

Stop processing opt-remarks if none were requested,
Make gcc dump remarks to file,
separate opt-file handling to ClangCompiler and GccCompiler,
make DefaultCompiler inherit GccCompiler,
move some tests around.
2025-06-16 10:13:32 -05:00
Patrick Quist abe7d9c836 fixes for windows execution (#7740) 2025-05-30 04:53:20 +02:00
Patrick Quist 7f393e6763 Refactor objdump execution to use BaseObjdumper class (#7715) 2025-05-25 17:21:01 +02:00
Patrick Quist 447737db5b add ld info to CompilationInfo for tools (#7697)
Fixes #7306
2025-05-20 13:15:27 +02:00
narpfel 1150078f7d Treat opt output as LLVM IR (#7670)
Resolves #7669.

`processAsm` didn’t recognise that `opt` generates LLVM IR, so it
invoked the generic `AsmParser` instead.
2025-05-11 23:38:31 -05:00
Ofek 36715c9369 Support opt remarks for rustc-nightly (#7561)
Closes #7525.
2025-04-12 11:29:38 +03:00
Patrick Quist 6b5553d726 Dont change original library versioninfo object (#7517) 2025-03-25 23:09:44 +01:00
Partouf 61715be49a fix rust clippy tool 2025-03-14 16:59:27 +01:00
Matt Godbolt 9a3661416a Don't cleanup build dirs until after processAsm (#7459)
- `d8` and `r8`'s `processAsm` looks in the build output folder for
`.smali` and `.cfg` files.
- it used to do this _synchronously_ and so worked (maybe accidentally)
- changes recently made that async, and so some of the time the files
would be cleaned up before it read them (or even during...)
2025-02-26 14:03:43 -06:00
Matt Godbolt a4995a9c1c Move to using async file reads (#7433)
Remove most, if not all, of the synchronous file reads. Hopefully this
will help a little with performance and "event loop lag". Mostly, it's
"try not to use third party packages when builtins now do the work".

Local testing seems OK - but needs a good poke around on staging to
exercise all the paths.
2025-02-26 11:11:12 -06:00
Matt Godbolt 619e4bd2e4 New temp directory tracker (#7452)
Replaces aging `temp` with a simple, bespoke solution. Reduces the
number of deprecated/out-of-date dependencies we pick up.

Closes #7445.
2025-02-26 10:56:26 -06:00
Ofek e01aa3e691 Various type improvements 2025-02-26 02:07:09 +02:00
Matt Godbolt 9c90f72129 Tiniest possible step towards type safety for CompilationResult.asm (#7432)
This is a super conservative tweak towards trying to use types for
processAsm, objdump, afterCompilation et al.
2025-02-25 08:37:05 -06:00
Matt Godbolt de1a892264 Stdbuf fixes and updates for llvm IR (#7412)
- Don't mutate the `args` in-place which exposes the `-o0` of the stdbuf
args to the rest of the code (breaking a bunch of things)
- Check the return code of the LLVM parser dump and error if it's a
problem.

Found looking into #7410 but doesn't fix it
2025-02-19 10:24:54 -06:00
Stephen HeumannandMatt Godbolt 5a72fa0659 Add support for ORCA/C (#7368)
[ORCA/C](https://github.com/byteworksinc/ORCA-C) is a C compiler that
natively runs on and targets the Apple IIGS. ORCA/C and the programs it
generates can be run on modern Linux systems by using an emulation tool
called [Golden Gate](https://goldengate.gitlab.io).

This adds support for ORCA/C (run via Golden Gate) in Compiler Explorer.
It uses its own assembly format and objdumper (provided by Golden Gate),
so support for those is added. An extra configuration option was also
added to support execution via an emulator, bypassing the usual check
that executables can run natively. Asm docs for the WDC 65C816 processor
were also added.

ORCA/C and Golden Gate are not Free Software, but their rights holders
have given permission for them to be used on Compiler Explorer. Tarballs
for them can be supplied privately. See infra PR:
compiler-explorer/infra#1521

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-02-18 10:28:10 -06:00
Niles Salter bbdad0fe8e [Zig] Fix target/arch parsing so assembly docs query the correct ISA (#7363) 2025-02-16 01:18:18 +01:00
Patrick Quist aae8fdcf7d Waiting for cache when execution of same thing is in progress (#7369) 2025-02-12 18:26:14 +01:00
Ofek 74091949e2 executionType/sandBoxType no longer stored per compiler (#7381)
.. as they're uniform execution options


Note the removal of `(compiler as any).executionType = 'nsjail'` from
tests - seems it didn't do anything.

But better test execution in staging, as I'm having trouble using nsjail
locally.
2025-02-08 18:15:03 +02:00
Mats Jun Larsen 5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Matt Godbolt 8ef76dd5bf Support execution and binary output in ispc (#7273)
- ispc doesn't link, so interpose running `gcc` or similar to output the final binary
- works around some naming issues in ispc

Ckoses #3937
2025-01-16 14:06:35 -06:00
Ofek b97cbb33b9 Fix #7237: account for potential warning/error matches (#7238)
A warning in an old gcc (4.8.1) had a format that was accidentally
caught by the -fopt-info regex. Now accounting for potential
errors/warnings caught accidentally.

I don't like that `processOptOutput` is being called regardless of
whether `backendOptions.produceOptInfo` is set, maybe need to address it
too.
2024-12-22 11:54:29 +02:00
Ofek 97b5735c21 Opt-remarks for gcc (#7230)
![gccoptrem](https://github.com/user-attachments/assets/4662c5d1-3a4e-443b-a989-bc4dc109e90b)
2024-12-20 10:19:33 +02:00
Matt Godbolt 02951a20db Unify types for tool args (#7199)
- Uses strings across the board in the UI part (no functional change
here from before; all state is the same as it was before).
- Sends _arrays_ in the POST, using the same `splitArguments` code as
the backend.
- Backend _still supports_ strings (though doesn't advertise), also
using same `splitArguments`.
- Moves `splitArguments` into common utils, and rephrases to avoid
unnecessary use of underscore and ES2021+ code.

Tested locally:
- with both old and new client code (ran new backend and old webcode to
show sending strings still works)
- with creating and removing tool windows (checked with `ldd` locally)
- with various strings on the client `moo foo "this is bad" #moo` and
even "error" things like `this is "badger` (with a missing close quote).
All works as you'd expect

Happy to break the "move the splitArguments" code into a separate PR if
that'd be easier to review separately.

Fixes #7195
2024-12-07 14:44:42 -06:00
Mats Jun Larsen fba4ba672a De-couple formatter from http server (#7155)
This patch decouples the formatting logic (which is used by the
clang-format feature) from the http API logic.

This is done with the new FormattingService populates the formatters
from the config, and wraps formatter execution. This way, both the http
controller and the clang-format functionality can use it, reducing tight
coupling.
2024-11-30 12:14:11 +09:00
Benjamin MaxwellandMats d5a016471c Support LLVM IR filters for the output of mlir-translate (#6881)
This enables the LLVM IR filters for the output of `mlir-translate`
(with `-mlir-to-llvmir`). The filters are still disabled for `mlir-opt`
(which only outputs MLIR) as there's currently no support for MLIR
filtering.

<!-- 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!
-->

---------

Co-authored-by: Mats <mats@jun.codes>
2024-11-28 22:13:19 +09:00
Patrick Quist 4615e7fb88 Don't keep possibleArguments to reduce memory footprint (#7134)
Hotfix to reduce memory footprint
2024-11-27 17:46:20 +01:00
Ofek 20b8ccaa6f Remove ICompiler, other minor type fixes (#7079) 2024-11-25 18:36:20 +02:00
Ofek 717c9173ad Unify OptCodeEntry and LLVMOptInfo (#7077) 2024-11-14 13:05:26 +02:00
Spencer Fricke 7a19db3378 Add success message for validator tool (#7055) 2024-11-08 16:29:05 +01:00
Sirui Mu a6ca0fed18 Add ClangIR compilation options (#6914)
This patch adds two options to the clangir pane that affects the clangir
compilation pipeline:

* Flat CIR enables the emission of flat clangir CFG;
* -fclangir-mem2reg enables the mem2reg pass on the flat clangir CFG.
2024-11-02 10:53:33 +02:00
Ofek 63dd5e35a5 Various tsifications (#7025) 2024-10-27 15:28:38 +02:00
Partouf f3e369d5dd bugfix cmake execution 2024-10-26 19:09:39 +02:00
Partouf 025be9c495 fix types 2024-10-26 17:53:46 +02:00
Ofek f6438f9c4d Store times in numbers only (#7023)
Also fixes #4655
2024-10-26 18:43:59 +03:00
Patrick Quist 4fe8397fac Remote execution (#6700) 2024-10-26 17:42:22 +02:00
Ofek 648795d0f5 Unify CompileChildLibraries and SelectedVersionLibraries (#7022) 2024-10-26 15:53:27 +03:00
Ofek c312beae24 TSify StackUsage and others (#7021) 2024-10-26 11:35:35 +03:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
Ofek 2df8d32758 Tsify #6 (#6941)
Another tsification batch. 347 to go and I'm running out of easy fixes
:(
2024-10-22 21:41:44 +03:00
Ofek 05dfb2034e tsify argument-parsers.ts (#6929)
470 ts violations to go.
2024-10-07 22:24:18 +03:00
Ofek f5f00606f8 Tsifications galore (#6916)
Still mostly mindless numb work, one rename that touched many files
(`getArgumentParser` -> `getArgumentParserCls`), and a few real
improvements.
The goal is to be able to turn on `noImplicitAny` for the project, to
enforce higher code quality. 600 violations to go.
2024-10-01 12:26:46 +03:00
Ofek 7097a240a7 Introduce opt-pipeline for ClangIr (#6917)
Thank @Lancern for the CIR flags analogous to clang's
`--print-before|after-all.`


![cir](https://github.com/user-attachments/assets/78742d83-799d-40cd-bcef-7a2e69a83c54)
2024-09-30 22:11:30 -05:00