Commit Graph
2586 Commits
Author SHA1 Message Date
Mats Jun Larsen d2cdc3b575 Apply fixes to rebase 2025-02-03 02:23:24 +09:00
Mats Larsen aa85d1fa51 Apply manual fixes 2025-02-03 02:22:58 +09:00
Mats Larsen b4c949afcd Apply automatic fixes
# Conflicts:
#	static/widgets/history-widget.ts
2025-02-03 02:21:16 +09:00
Mats Larsen c27f06f322 Install biome and remove eslint/prettier 2025-02-03 02:20:56 +09:00
Ofek e2fc92f420 Overhaul 'history' look (#7352)
Single tab, no diffs - single source display, no list bullets, added spacing, added syntax highlighting.
2025-02-01 21:29:29 +02:00
Spencer FrickeandMatt Godbolt e7be83e9db Fix number regex for SPIR-V parser (#7340)
I noticed things like `Int64`, `GLSL450`, and `2D` were multi-colored. This fixes them by treating all Capitalised123 things as tokens.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-01-30 10:19:39 -06:00
narpfel ccd62cfc61 Parse terminal hyperlinks in command output (#7318)
Some compilers (such as `gcc` and `rustc`) support emitting hyperlinks
to the documentation for error messages and/or warnings. This PR adds a
parser for the respective `OSC 8` ANSI escape sequence (see
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) and
makes them clickable in the output window.

For example: https://godbolt.org/z/o1v7WzPc6

For GCC, this would make `-Wreturn-type` a clickable link to
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wno-return-type.

For Rust, this would make `E0425` a clickable link to
https://doc.rust-lang.org/error_codes/E0425.html.

Note that this also applies to execution output. A malicious program
could (when executed) produce output that contains clickable links to
anything.

Related feature requests:
* #5284 for `rustc` (`-Z terminal-urls=yes`)
* #7310 for `gcc` (`-fdiagnostics-urls=always`)
2025-01-29 10:46:17 -06:00
Matt Godbolt 9541e1e8d8 Mitigations for CL labels (#7320)
Some syntax highlighting improvement for CL asm lines like:

```as
int * moo DD  01H                       ; moo
```

and

```as
?mooz@@3PAFA DW 01H                                 ; mooz
```

where previously the DD (or DW DQ) wasn't syntax highlighted, making it
harder to spot the case where CL puts the first defined value of an
array on the same line as the label definition.

This isn't perfect, and might be fairly expensive, but helps mitigate
issue #1645, hopefully well enough to close it.

Tested locally with gcc and clang output, and then pasted into
Monarch/Monaco and tested with some CL output.
2025-01-29 10:33:22 -06:00
Waqar Ahmed e0e2420482 Improve odin codegen processing (#7228)
- Builtin runtime functions __$startup_runtime, __$cleanup_runtime, __$*
are now filtered out
- Label matching regex is fixed for odin, see OdinAsmParser class. This
ensures we filter out all labels that don't belong to the current file
- Slightly improved editor support, auto bracket closing and commenting
via keyboard shortcuts works now
- procedures within the file are automatically @require as requested by
GingerBill (odin lang creator).

There still are a lot of unused labels with data definitions that dont
get filtered out.

#7210
2025-01-06 15:49:15 -06:00
Spencer Fricke fc3f37e1f9 Add Monaco LangConfiguration to GPU languages (#7235)
I realize basic things like `ctrl`+`/` and auto complete `}` for my `{`
were missing from HLSL/GLSL/Slang

After digging, found that it was just a lack of setting
`setLanguageConfiguration` for the monaco-editor for each of them

Confirmed the config in
`node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js` suites
the 3 languages (as they are also all derived from C based languages)
2024-12-20 08:41:18 -06: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
Johel Ernesto Guerrero Peña 0a2f5f2655 feat: update grammar of Cpp2 (#7217)
This is an update to #6950.
The test cases: <https://highlight-cpp2.godbolt.org/z/Wbve44Mjv>.

<details><summary>Preview</summary>


![1734028425](https://github.com/user-attachments/assets/88b975bb-fdbb-41f8-a9b5-8a5db8706dbb)

</details>

Resolves #7153.
2024-12-13 04:08:09 -06:00
Spencer Fricke e7c16e1892 Add remaining Slang keywords (#7208)
closes
https://github.com/compiler-explorer/compiler-explorer/issues/7180

Worked with Slang developers on discord and put together a list of
keywords that should be good and when I update the Slang version in the
future can find a change list to include anything that changes then
2024-12-09 08:06:44 -06: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 c256b922f7 Migrate site templates to yaml config (#7189)
Does some winter cleaning on the site-template stuff :)

1. Migrated away from the custom conf format to plain old yaml
2. Made the images and image files match with the name from the yaml
file. (It's not a problem to have spaces in file paths, nor urls so I
don't see why we shouldn't)
3. Updated the relevant documentation

There is a small breakage in the api response for the meta field. It now
returns `{"screenshot_dimensions":{"width":1000,"height":800}}` which I
believe is a lot more useful than
`{"meta.screenshot_dimensions":"1000x800"}`

Besides, I don't believe this endpoint has any third-party consumers
that rely on the metadata since it's a rarely known feature anyways
2024-12-08 00:59:58 +09:00
Waqar Ahmed d3ef2de208 Add Odin language (#7186) 2024-12-06 17:28:47 +01:00
Spencer Fricke 05f86a38dd Add preliminary Slang support (#7151)
Part of
https://github.com/compiler-explorer/compiler-explorer/issues/2331 and
similar to [my GLSL
change](https://github.com/compiler-explorer/compiler-explorer/pull/6883)

[Slang](https://shader-slang.com/) is a GPU focused shading language
that has been worked on for years. Last week [The Khronos
Group](https://www.khronos.org/news/press/khronos-group-launches-slang-initiative-hosting-open-source-compiler-contributed-by-nvidia)
will now be running the project as open governance. The latest [Vulkan
SDK](https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-3-296-0-for-windows-linux-macos/)
has also added a build of `Slangc` (slang compiler).

This change adds support for Slang (the language) as a front end with
`Slangc` (the compiler) as the only compiler. Slang can be used for
things like GLSL/HLSL, but that is for a future PR.

I am in contacts with people on the Slang development and plan to
support things for Slang as well as the other GPU related shading
languages

--- 

of course, screen shots as well


![image](https://github.com/user-attachments/assets/c9f6460b-b779-4ff5-b0bb-5a7eff543de1)


![image](https://github.com/user-attachments/assets/b2dbdd5a-c031-4110-ab9d-ed76b9881ad8)
2024-12-04 04:45:50 -06:00
Ofek b75542bfac Fix #3264: move emitShortLinkEvent from editor-pane to main window (#7163)
When settings are set to emit-short-link upon ctrl+S, managing the logic
in `Editor` is problematic since the editor may lose focus and not
receive the event.

Also logically this is a cross-site event, and doesn't belong in any
particular editor (there can be multiple).
2024-12-02 10:41:12 +02:00
Partouf 99de0f1dac hotfix diff view 2024-11-28 10:03:19 +01:00
Mats ea29a6e9d6 Separate list and load actions for source API (#7090)
This is the first PR in API consistency with more to come:

1. The source API urls have been properly defined with
`/source/:source/list` and `/source/:source/load/:language/:filename`
- These used to be two API endpoints mushed together into one `handle()`
function. They are now separate
- While it may appear from the tests that this is an API breakage,
there's currently no way to have the source API spit out responses for
stuff like `/source/moose/load/Grunkle`.
2. The frontend code calling the list api now has shared types
3. Code has been migrated to `/lib/handlers/api/source.ts`
- I've moved code here, because I would like to separate the stuff
that's under the API and the stuff that isn't (e.g., healthcheck)
- The source endpoint is currently not under /api, but I believe it
makes sense to move it.
4. GitHub is terrible at showing the diff, but the `browser.ts` file has
been removed, since it's never actually used. Our frontend only calls
`/source/builtin/...` and it never had any entries. Besides, the type
used on the frontend for the locally stored stuff is different...
2024-11-27 13:54:47 +09:00
Luka Prebil Grintal 81d18c4c4b Add Bluesky to link sharing options and other menu (#7126)
Adds intent link for sharing a Compiler Explorer link to Bluesky. Also
adds a link to the [Compiler Explorer Bluesky
profile](https://bsky.app/profile/compiler-explorer.com) into the
`Other` menu.

<details>
<summary><b>Screenshots of the new links:</b></summary>
<img width="1239" alt="image"
src="https://github.com/user-attachments/assets/2db4a9ee-a0db-4b32-b317-a671d4744b24">
<img width="244" alt="image"
src="https://github.com/user-attachments/assets/5ebcee95-00b8-4219-b057-842f431bed92">

Shared post
<img width="628" alt="image"
src="https://github.com/user-attachments/assets/57f8c264-5590-4cef-ad00-215af5008512">
</details>

I added the `via @compiler-explorer.com` to be the same as twitter, but
since bsky does not fully support tagging yet, it gives the user a
dropdown to select the compiler explorer user, which seems kinda janky.
I left it in for now, but can remove it until bsky supports tagging
automatically.
2024-11-26 13:48:12 -06:00
Ofek 20b8ccaa6f Remove ICompiler, other minor type fixes (#7079) 2024-11-25 18:36:20 +02:00
Ofek c2c8b4e018 Silence some frontend sentry noise (monaco internal benign errors) (#7103) 2024-11-16 12:07:41 +02:00
Ofek 4399adc523 Some minor additions to frontend typing (#7082) 2024-11-14 17:07:51 +02:00
Ofek 717c9173ad Unify OptCodeEntry and LLVMOptInfo (#7077) 2024-11-14 13:05:26 +02:00
Partouf ea382a8aed fix #7083 2024-11-11 16:53:07 +01:00
Partouf c81ab73e63 hotfix for incompatible GL states 2024-11-08 18:38:41 +01:00
Patrick Quist 29b9fe406d Bugfix Unknown file (#7072) 2024-11-08 17:54:43 +01:00
Patrick Quist 6f97ab5518 Close button fix (#7050) 2024-11-08 16:25:55 +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
OfekandMats Jun 679b908c39 Tooltips for llvm opt output (#7036)
This does fix #7019, but unfortunately in IR lines like -
```
  %2 = mul nsw i32 %0, %0
```
Monaco assigns both the `mul` and `nsw` tokens with type
'operators.llvm-ir' (handled as asm keyword by this PR) and requests the
backend for their docs. Only `mul` is an actual documented keyword -
`nsw` is just a modifier and the request fails with errors like `GET
http://localhost:10240/api/asm/llvm/nsw 404 (Not Found)` thrown at
[getAssemblyDocumentation](https://github.com/compiler-explorer/compiler-explorer/blob/63dd5e35a5856bcd1670b7b1cf21ffd854928ef7/static/api/api.ts#L50-L51).

This draft PR is meant for discussion. Would it be enough eg to wrap the
request in `getAssemblyDocumentation` in a try-catch? Maybe the right
thing to do would be to intervene in the monarch parsing for llvm-ir?
Other ideas that I'm missing?

---------

Co-authored-by: Mats Jun <mats@jun.codes>
2024-10-28 19:41:38 +09:00
Mats Larsen ef0c9f5ded Don't use sinon/chai code for frontend tests
Using these imply that sinon and chai will be built for the final bundle that the user downloads. This is not a good thing, because it bloats our bundle.
2024-10-28 18:59:56 +09:00
Mats Jun 9e1a42288b Remove legacy test dependencies (#7034)
Replaces sinon mocks with cy and removes deep-equal-in-any-order

Removes any old chai imports
2024-10-28 18:12:58 +09:00
narpfel 01a873ab27 Reintroduce [already open] for “new tool” buttons (#7035)
Fixing the merge conflicts in #6974 accidentally removed the
`new-pane-button` class from the buttons in the “Add tool...” menu from
#7002:

https://github.com/compiler-explorer/compiler-explorer/pull/6974/files#diff-40ca496bc7fcf6c9bcd41d530708fe3a7bcc5f58cd9bad27ab919b5033f557deL2695-L2696

See https://godbolt.org/z/fd7v8zfE5 (click on “Add tool...”, `ldd` is
disabled but does say `[already open]`).

This PR reintroduces that change. However, the implementation in #7002
would also show `[already open]` for the “No tools available” button if
there are no tools. In this PR, the `new-pane-button` class is only
added to the “real” new tool buttons.
2024-10-28 16:43:31 +09:00
Ofek b6386887a8 Make 'new source editor' preserve the origin language (#7031)
When doing 'Add new...'/'Source editor' from, e.g., a Rust editor - open
a new Rust editor and not a C++ one.


![image](https://github.com/user-attachments/assets/861c53bc-fb1e-44c0-ac23-09d2ac839bdb)
2024-10-27 11:06:51 +02:00
Ofek a0fe0e3d4f In diff view, protect against undefined asm (case of a failed build) (#7030)
Fixes #7029
2024-10-27 09:20:31 +02:00
Ofek ab4b662ee0 Extra safety around executeParameters.args (#7028)
Hopefully fixes #7027
2024-10-27 09:09:44 +02: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 93133510c2 Move ToolState to component.interfaces, to avoid duplicate tool.interface.ts 2024-10-25 22:02:30 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
narpfel 02b574b4a9 Show that pane is already open when disabling the button to create a new pane (#7002)
When a new pane (such as the LLVM IR view) is opened using a button in
the “Add new...” or “Add tool...” menu, the button is disabled. This can
be confusing when the pane is not visible (e. g. when it is in a tab in
the background), because it can also be interpreted as “this is not
supported“.

This PR adds an `[already open]` to the button when it is disabled.
2024-10-24 21:24:54 +03:00
Ofek e98d361127 Add display for internal compiler id (#7010)
Implement #6985
2024-10-24 14:28:51 +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
Mats Jun 6753449778 Simplify TypeScript types for JQuery elements (#6991)
_No functional changes intended_

The existing type functions a little like this:

"Take the intersection of all common properties of all values in
HTMLElementTagNameMap"

This very much just happens to be the same as HTMLElement, since that's
the declared base for all of the types in HTMLElementTagNameMap. This
small patch simplifies this type (and makes it significantly easier to
read the code)
2024-10-22 19:33:03 +09:00
Matt Godbolt 5e4b209125 Minor bump (#6986) 2024-10-20 18:03:08 -05:00
Ofek d23b327153 A few leftovers that escaped the google-analytics cleanup (#6979)
<!-- 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!
-->
2024-10-19 22:00:12 +03:00
Johel Ernesto Guerrero Peña 601c3ec3d7 feat: update grammar of Cpp2 (#6950) 2024-10-12 18:37:29 +02:00