Commit Graph
33 Commits
Author SHA1 Message Date
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 LarsenandMatt Godbolt 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 BlancoandAustin Morton 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