-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ocamllsp): fix in pp handling the file permissions #1153
fix(ocamllsp): fix in pp handling the file permissions #1153
Conversation
f092f10
to
d473792
Compare
d473792
to
d12379f
Compare
I think this needs to be fixed on Merlin's side: in the same way as for I will do that asap. |
However the proposed change looks reasonable: having input files be read-only and allowing creating new files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After having a look on Merlin's side I think things are all-right there. I added a test for preprocessing.
The issue doesn't show with ppxes
because the driver is responsible for creating/writing to the file, it is not relying on redirecting stdout
.
The changes look good to me.
@jboillot where you able to test the changes on your project ?
It can be done using opam pin https://github.com/jboillot/ocaml-lsp.git#bugfix/ocamllsp-pp-output-file-creation
.
@rgrinberg I guess this deserves a patch release. I can take care of it if you want (and if I have the rights).
Yes, give it a try. Where's the test though? |
The test I mentioned is on Merlin side. I am looking at how I could do the same in |
@voodoos I was able to test the changes on a few files of a big OCaml project with cppo as the only pp (and a few other ppxes). |
I added a test that was effectively failing without the changes in this PR. |
Thanks a lot @jboillot ! |
CHANGES: ## Fixes - Fix file permissions used when specifying output files of pp and ppx. (ocaml/ocaml-lsp#1153)
Hello,
In the PR that made Merlin a dependency #1070 a bug was introduced that prevents from using preprocessor programs as https://github.com/ocaml-community/cppo.
This is because the file permissions are not provided in the right base and that the output files are currently not created if they do not exist yet.
I do not know if the addition of the flag
Unix.O_CREAT
could cause an issue with some pp or ppx.