47 Commits

Author SHA1 Message Date
Matt Godbolt
f824efe73e Library updates and lint fixes (#8099)
* Minor updates only
* Added explicit radix parameter (10) to all Number.parseInt() calls throughout the codebase (new lint rule)
* Updated several @ts-ignore comments to @ts-expect-error for better TypeScript practices (new lint rule)
* Removed unnecessary @ts-ignore comments in some mode files (ditto)
* Used "none return" based arrow functions for some map stuff
* Replaced a `map()` call that didn't return anything to a for() loop
* Fixed up some cypress stuff, noting work for the future
2025-09-12 14:23:49 -05:00
Patrick Quist
b3c6a321f1 Add compilation worker mode infrastructure (#7864) 2025-09-08 22:07:47 +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
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
Mats Jun Larsen
127c12e0bf Re-enable noShadowRestrictedNames Biome rule (#7387)
I'm not very opinionated on this, but I think it makes enough sense to
do
2025-02-13 00:43:55 +09:00
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00: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
f715dc2932 More tsification (#6877)
About half way through. Only 708 tsification errors to go..
2024-09-28 10:32:36 +03:00
Ofek
fecd0fbf11 tsification + small package upgrade (semver) (#6841) 2024-09-10 17:18:48 +03:00
Patrick Quist
b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00
Matt Godbolt
081f585bcc Use a unique temp file (#5275)
We _once_ saw a local file that had an extra `}` at the end and the
vague hypothesis is because it was cached multiple times at once (it was
a shared executable for clang++) then _sometimes_ it was one char longer
than another run, and two runs at the same time wrote to the same temp
file, and the last byte from the "longer run" was left...
2023-07-23 13:39:31 -05:00
Jeremy Rifkin
acdd5ad45c Capture errors in sentry better (#5128)
Fixes #5127 and similar issues.

Rationale: Whenever something that is not an Error object is passed to
Sentry.captureException we get pretty much no useful information in
sentry

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/c7345449-f7a0-46cb-a198-abe0bd80a8b1)
(usually not even a stacktrace)
2023-06-11 17:31:51 -04:00
Matt Godbolt
3b75a229c8 Bump to latest LRUCache; use the correct import now the old way is deprecated (#5116) 2023-06-06 21:32:03 -05:00
Matt Godbolt
6d367c10d3 Misc discovery and execution cache tweaks (#5073)
- use async file access when looking for llc
- don't use the random customCwd in the cache hash
- don't lookup "log cache accesses" in props every access
- turn on compiler cache access logging in discovery mode
- error on missing wine executable config
- atomically cache on disk file cache
2023-05-22 22:40:09 -05:00
Matt Godbolt
3f7def7e38 Upgrade LRU-Cache (#4833)
- rephrase a few LRUs in terms of the new API
- add `okToCache` to the `CompilationResult` to make typing more correct
(I _think_)
2023-03-08 10:58:56 -06:00
Matt Godbolt
9b1548c949 Format fixes 2023-03-08 07:52:46 -06:00
Matt Godbolt
2b6500203e Update to latest AWS SDK (#4818)
We're not using the new `send` functionality, but this gets everything
running and tests passing. It has _not_ been tested against real AWS
yet. That's next. I might move stuff over to the new `send` API, but
also I might not if it's just working.
2023-03-07 18:10:56 -06:00
Mats Jun Larsen
633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Josh
9196e1367d Converted cache-tests to typescript (#4722)
Added generic typing to lib/cache/from-config nim-tests got added after a make lint (--fix)
2023-02-12 14:03:03 -06:00
Matt Godbolt
749319f791 Slightly more controversial bumpings (#4503)
- latest sentry, tar-stream, which, some yamljs versions
- latest eslint-* stuff
- latest webpack manifest
- Applies all the automatic fixes for newer lint rules
- Bump the webpack version

applies new tslint stuff
2022-12-28 11:42:14 -06:00
Matt Godbolt
19ddc3384e Port cache code to Typescript (#3605)
* Port cache subsystem to typescript
* Extract an interface class
* Use async for s3 cache; add tests for failure case
2022-05-02 15:19:13 -05:00
Austin Morton
fbcad4bbdb Propagate cache hits to higher levels in MultiCache (#2524) 2021-03-30 01:40:52 -04:00
Patrick Quist
77c0a8f3b6 fix undefined stats logging (#2487) 2021-03-11 21:23:11 +01:00
Matt Godbolt
17c8ab8f46 Add stats for caches (#2300) 2020-10-20 14:51:31 -04:00
Austin Morton
044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Rubén Rincón Blanco
ccff4b9ee5 Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible

In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules

This PR attempts to not change code behavior when possible.  In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the 
code base to silence the error.  You can find these by searching for `eslint-disable-next-line`.

Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2020-08-04 16:39:02 -04:00
Austin Morton
4760ae92de Update dependencies (#1842) 2020-02-25 02:46:41 -05:00
Matt Godbolt
717ea51a3e First wave of @apmorton suggestions and fixes 2020-01-28 21:34:52 -06:00
Matt Godbolt
b28d2cf8f9 async multi.js 2020-01-14 22:06:05 -06:00
Matt Godbolt
55bf9939a2 async caches; use null in executable cache instead of throwing an exception for 'not found' 2020-01-14 22:06:04 -06:00
Austin Morton
be8b8aa245 Avoid deleting file when updating a key in disk cache
When setting a key, the file is written to disk first and then
the cache entry is set.  When the key already exists, the dispose
callback will end up deleting the *updated* file from disk.

This results in a cache entry with no corresponding file on disk.
2019-08-23 10:10:16 -04:00
Austin Morton
12380a4a95 Gracefully handle IO errors in disk cache
There appears to be a race condition between key eviction
and access.  It is possible for the file to be deleted from disk,
but the key to still be in the cache momentarily.

If someone tries to access the key during this period a
file not found error will be thrown, and odd behavior may
occur in the caller.

Instead, we catch/log errors and return a cache miss.
2019-08-23 09:44:20 -04:00
Patrick Quist
df78b11679 Update on-disk.js 2019-07-19 20:57:30 +02:00
RabsRincon
57cb1e824a Completely remove need for denodeify
fs-extra already does what we were asking the package to do
2019-07-19 15:11:16 +02:00
Matt Godbolt
1f6e4c8f67 Log updates; lots of logging was missing since we moved to the new logger 2019-05-16 17:30:15 -05:00
Matt Godbolt
423f6688ef Move to newer sentry library (hopefully fixes any sentry log issues) 2018-12-06 22:03:05 -06:00
Matt Godbolt
8c61e3ec83 Shore up s3 error handling 2018-11-21 07:55:33 -06:00
Matt Godbolt
72babf2fcd Fix s3 cache report; fix config string 2018-10-30 22:13:38 -05:00
RabsRincon
8f82c34b9c Add S3 machinery to S3 storage solution 2018-08-06 15:58:54 +02:00
Nicole Mazzuca
9ddf22f090 Support Visual C++ and Windows well
This commit adds support for hosting on windows, as well as better
support for the Visual C++ compiler. Specific interesting changes are:

  - switch from /FAsc to /FA
  - order functions in file order
  - support demangling win32-style identifiers with undname
  - clang++ and vc++ on win32 host are both supported
2018-07-28 15:18:43 -07:00
RabsRincon
dd2ab6d41f Move to own fork of cookieconsent
Due to concerns over status of upstream

Cookie consent value is now tied to hash of cookie privacy text,
	so we get automatic revoking of consent on privacy update
2018-07-04 17:54:23 +02:00
Matt Godbolt
5ba712213a Addressing @RabsRincon comments 2018-05-20 11:10:52 -05:00
Matt Godbolt
52652f660e Clarify a comment 2018-05-18 11:00:12 -05:00
Matt Godbolt
d5ac32becb Handle missing creator metadata 2018-05-18 11:00:00 -05:00
Matt Godbolt
78c3142977 Use the new caching system for compilation caches. 2018-05-18 10:48:53 -05:00
Matt Godbolt
72760b65a4 Support creation of cache chains from config strings 2018-05-18 08:21:24 -05:00
Matt Godbolt
36b720806a First attempt at some new caching; including in-memory, on-disk, and on S3 2018-05-17 23:01:52 -05:00