43 Commits

Author SHA1 Message Date
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
Matt Godbolt
b51b8250b0 Expose the naming convention of the jailing process (#8211)
To allow resolc to correctly find in-sandbox named artifacts

See #8164
2025-10-22 11:34:14 -05:00
Partouf
c83515d970 better fix 2025-09-30 01:49:12 +02:00
Partouf
51a576464a temp fix for faulty cache entries 2025-09-30 00:42:48 +02:00
Patrick Quist
3f317553c2 okToCache fix for nsjail errors and extra checks (#8148) 2025-09-29 22:21:51 +02:00
narpfel
4836aa2360 Fix quadratic runtime in execution output reading (#8123) 2025-09-22 21:29:42 +02:00
Partouf
847ea95559 bugfix 2025-09-12 18:07:12 +02:00
Patrick Quist
447201a583 fix unicode stream bug (#8086) 2025-09-10 06:00:40 +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
Matt Godbolt
2cd262ddaa Drop logging of unbuffering to debug 2025-02-25 08:51:33 -06:00
Matt Godbolt
aa03700929 Fix silly bug (whoops) 2025-02-19 11:09:45 -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
Matt Godbolt
7d4f77d84a Misc fixes for unbuffering (#7404)
- Wrap the executable in `stdbuf` higher up than in `executeDirect`
which means we run `stdbuf` _inside_ the jail instead of outside it when
running. This fixes jail/stdbuf interactions.
- Install `which` types to avoid a `no-ts`
- Ensure `stdbuf` et al is mapped in compilers-and-tools
- As a fly-by also unify the configuration of NVidia devices between
execution and compilation.
2025-02-18 15:17:15 -06:00
Ofek
a457221f7a Fix #7239: Prefix exeutions with stdbuf -o0 (#7378)
Please note this adds the anti-stdout-buffering machinery to all
executions - *including of the compilers themselves*. I think this is a
good thing.

I (hope I) excluded execution on windows. Are there other needed
exceptions?
2025-02-17 00:55:53 +02:00
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Ofek
f6438f9c4d Store times in numbers only (#7023)
Also fixes #4655
2024-10-26 18:43:59 +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
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
Patrick Quist
b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00
Matt Godbolt
7ba2635029 Check for non-string values in exec's env (#6087)
- warns
- fixes the case I found
2024-02-04 17:53:48 -06:00
Patrick Quist
68efdcbd97 transform paths given through options.ldPath (#6086) 2024-02-04 16:51:46 -06:00
Matt Godbolt
01b7992ada Fix nsjail environment variables that need mapping to destination paths (#6084)
Maps env vars just like we map everything else, to catch all cases where
"app dir" is an input to jailed processes, the jailed process only sees
the "right" path (`/app/something`).

Tested locally and fixes the dot net "read only `/nosym`" thing while
keeping the `/nosym` behaviour etc
2024-02-04 13:53:50 -06:00
Matt Godbolt
c26a2924fc Add more typings (#6082) 2024-02-04 13:33:19 -06:00
Matt Godbolt
613d7f688a Unify the way tmp dir is used (#6052)
Instead of having several globals, set via environment variables,
explicitly set the "correct" env var if passed `--tmpDir` and then
consistently use it in the rest of the program.

See @apmorton's comments in #1707
2024-01-28 18:50:46 -06:00
J. Ryan Stinnett
e7b22b41be Limit exec streams to max string length (#5898)
Some operations set `exec`'s `maxOutput` to a value larger than the max
string length. This change ensures we always cap output to the engine's
string limit (currently 512 MB in recent Node versions).

This also tweaks handling when reaching the string limit to ensure
adding the "truncated" message itself does not send us beyond the limit.
2023-12-23 17:54:46 -06:00
Patrick Quist
49252efa92 Execution hotfix (#5659) 2023-10-26 20:46:32 +02:00
Jeremy Rifkin
fb147126e8 Fix WSL for systems that don't have windows paths (#5480)
Attempt to fix #5476. As far as I can tell `process.env.winTmp` is
needed just for windows executables and WslVcCompiler. It should be
possible to just ignore the exec error and continue. If for some reason
the user doesn't have windows paths in their WSL but does want to run
windows executables they can pass `-tmpDir`.
2023-09-16 15:59:26 -04:00
Jorge Lopez
a90dfab5f5 Add a line break before kill (#5258)
A fix for
https://github.com/compiler-explorer/compiler-explorer/issues/5233
2023-07-15 10:37:01 -05:00
Guo Ci
701301642e resolve #4330 (#5196)
#4330
2023-07-03 15:07:26 -04:00
Jeremy Rifkin
ddb4ed8c05 Improve the type of ExecutionOptions.env (#5206) 2023-06-28 08:15:24 -04:00
Jeremy Rifkin
d907f34bdc Fix handling when the opt output is truncated (#5189)
Fixes #2984
2023-06-21 21:26:55 -04:00
Jeremy Rifkin
910d69f233 Turn on @typescript-eslint/await-thenable (#5131) 2023-06-11 18:09:35 -04:00
Jeremy
f8409da979 Add a backend unwrapString 2023-05-23 16:49:22 -04: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
Patrick Quist
7d192ccde1 add properties and test for cewrapper (#4761) 2023-03-18 11:46:27 +01: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
Jeremy Rifkin
384c297906 Fix trailing comma issue (#4775)
Make trailing commas more consistent throughout the project, fixes
config conflict between eslint and prettier. Resolves an oversight in
#4766.
2023-02-26 12:21:35 -05:00
Jeremy Rifkin
2b06c69111 Turn some auto-fixable eslint rules back on (#4766)
This PR turns comma-dangle and indent eslint rules on for lib/. These
are rules inherited from the eslint config for static/, this PR just
makes things more consistent. Also turned
@typescript-eslint/no-var-requires back on while I was here.
2023-02-23 17:16:17 -05: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
Jeremy Rifkin
e13fe4a2f9 Mg/props ts (#4340)
* WIP

* Type changes to the property getter

* Finish getting types working for properties.ts

* Reduce type casts in exec.ts

* Format files

* Remove old comment

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2022-11-26 13:56:04 -05:00
Matt Godbolt
c363d1a07d Port @trxcllnt improvements to awaiting (#4220)
* Port @trxcllnt improvements to awaiting

* More async improvements
2022-10-31 22:38:23 -05:00
Patrick Quist
8334d96bf3 tsify exec.js (#4026) 2022-09-06 20:22:28 +02:00