Comments (3)
Could it be related to #1585?
I confirm this is the culprit. The root cause is that Filename.quote_command
is given a string that it cannot handle and it fails.
merlin/src/ocaml/driver/pparse.ml
Line 42 in dc73ba0
The backtrace in my case is:
failed with Failure("Filename.quote_command: bad file name C:\\cygwin64\\home\\nojebar\\mlfi\\_build/default/.ppx/878efc8ece20bcbf2dd8c437a0746ae0/ppx.exe --as-ppx --cookie \"library-name=\\\"js_core\\\"\"")
# 0.03 Typing_aux.raise_error - Failure
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Stdlib__Filename.Win32.quote_command in file "filename.ml", line 234, characters 6-28
Called from Merlin_kernel__Pparse.commandline in file "merlin/src/ocaml/driver/pparse.ml" (inlined), line 42, characters 2-34
Called from Merlin_kernel__Pparse.apply_rewriter in file "merlin/src/ocaml/driver/pparse.ml", line 48, characters 13-41
Called from Merlin_kernel__Pparse.rewrite in file "merlin/src/ocaml/driver/pparse.ml", line 118, characters 4-87
Called from Merlin_kernel__Pparse.apply_rewriters_str in file "merlin/src/ocaml/driver/pparse.ml", line 129, characters 16-61
Called from Merlin_kernel__Pparse.apply_rewriters in file "merlin/src/ocaml/driver/pparse.ml", line 144, characters 20-70
Called from Merlin_kernel__Mppx.rewrite.(fun) in file "merlin/src/kernel/mppx.ml", line 27, characters 4-76
However, the call to Filename.quote_command
is only used for logging, so it can be easily avoided. The following patch fixes it:
diff --git a/src/ocaml/driver/pparse.ml b/src/ocaml/driver/pparse.ml
index 077e93ff..0bc75ac0 100644
--- a/src/ocaml/driver/pparse.ml
+++ b/src/ocaml/driver/pparse.ml
@@ -39,7 +39,7 @@ let report_error = function
"External preprocessor does not produce a valid file. Command line: %s" cmd
let commandline prog args =
- Filename.quote_command prog args
+ Printf.sprintf "%s %s" prog (String.concat ~sep:" " (List.map ~f:Filename.quote args))
let apply_rewriter magic ppx (fn_in, failures) =
let title = "apply_rewriter" in
This also has the virtue that it matches what the function System.run_in_directory
actually uses.
from merlin.
Thanks for taking the time to investigate! I remember we took great care to keep existing windows behavior untouched, it a shame we overlooked that debug call.
I will apply your fix and probably do a patch-release soon.
from merlin.
I will apply your fix and probably do a patch-release soon.
Thanks!
from merlin.
Related Issues (20)
- Benchmark CI HOT 1
- General Behavior CI HOT 1
- Specified Regression CIs HOT 1
- Merlin's time-space trade-off HOT 3
- Refine cache for typing the buffer HOT 2
- Cancellation
- Some executables should install to /usr/libexec and not /usr/bin HOT 1
- Failure to report short paths with intervening packages HOT 7
- Merlin Pipeline PPX Cache is Broken when a pipeline is only used partially HOT 4
- Allow jump to an enclosing module type HOT 3
- How to use Merlin with unusual OCaml packages? HOT 3
- ppx deriving on a type adversely affects merlin location HOT 1
- Destructing punned record field breaks syntax HOT 1
- emacs' merlin-mode highlighting of code w/ errors is just bad HOT 11
- Confusion between module type and module of the same name HOT 3
- Rename does not work properly with ppx_string HOT 2
- Enrich Merlin telemetry with GC info HOT 1
- Unclean sources HOT 2
- Issue when destructing tuples in letops
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from merlin.