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
reason-language-server: init at 1.7.8 #85841
base: master
Are you sure you want to change the base?
Conversation
This makes it much easier to override the version of ocaml reason is built against (`reason.override { ocamlPackages = ...; }` instead of having to override `ocaml`, `findlib`, `dune`, etc.
note: reason-language-server is *not* compatible with ocaml 4.09
ocamlPackages = ocaml-ng.ocamlPackages_4_08; | ||
inherit (ocaml-ng.ocamlPackages_4_08) buildDunePackage; | ||
}; | ||
|
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.
Maybe this should live in pkgs/top-level/ocaml-packages.nix
? I couldn't find a nice way to force OCaml 4.08 when it was there though
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.
Agree it should.
You can do something like this: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/ocaml/dune.nix#L7-L10
And it would avoid having to override
ocamlPackages
in the reason derivation.
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.
The problem is that there is no maximumOCamlVersion
argument anywhere - reason-language-server
works with OCaml versions before 4.09. I don't know the ocaml infrastructure well at all (this is my first look at it), so I would really appreciate it if someone more knowledgeable could maybe add a commit to this pr if this is something that requires changes.
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.
What about changing the expression so that instead of buildDunePackage
and ocamlPackages
it takes ocaml-ng
and then picking these two things within the pkgs/development/tools/reason-language-server/default.nix
?
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.
Something else I remembered: given that Reason is a build time only dependency, does it even need to be on the same OCaml version than RLS? AFAIK there just needs to be a refmt
binary in $PATH
for Dune to compile a Reason project.
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.
Something else I remembered: given that Reason is a build time only dependency, does it even need to be on the same OCaml version than RLS? AFAIK there just needs to be a
refmt
binary in$PATH
for Dune to compile a Reason project.
While I was packaging it seemed to break unless Reason used the same OCaml version.
What about changing the expression so that instead of
buildDunePackage
andocamlPackages
it takesocaml-ng
and then picking these two things within thepkgs/development/tools/reason-language-server/default.nix
?
I don't have strong feelings either way, but I feel like someone who uses OCaml a lot more than me should make the decision.
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.
Does the user of reason-language-server care about the version of OCaml that is used to build it? (i.e., does RLS behave differently depending on the version of OCaml used to build it?) Programs that use native OCaml serialization often do (for instance: unison, Coq, merlin).
If this is the case, it may make sense to put it inside ocamlPackages
.
Otherwise just take ocamlPackages
as argument (don’t take neither reason
nor buildDunePackage
as argument: read them from ocamlPackages
).
In either case, reason
should not take the whole ocamlPackage
set as argument (because it is part of it).
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.
yup exactly my thoughts @vbgl 👍
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.
I think there's an argument that reason
shouldn't be a part of ocamlPackages
to be made - seems like the use case of compiling reason
against different sets of ocamlPackages
is going to be a lot more common than overriding specific dependencies, and it is supposed to be its own whole ecosystem.
Does the user of reason-language-server care about the version of OCaml that is used to build it? (i.e., does RLS behave differently depending on the version of OCaml used to build it?) Programs that use native OCaml serialization often do (for instance: unison, Coq, merlin).
I'm not sure of the answer to this question. Someone who has used reason more should weigh in.
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.
Whatever the answer to this question, the commit “reason: use the whole ocamlPackages set as a variable” is wrong.
In particular, its explanation (“This makes it much easier to override the version of ocaml reason is built against (reason.override { ocamlPackages = ...; }
instead of having to override ocaml
, findlib
, dune
, etc.”) is nonsense. If you want a reason
built with a specific set of OCaml stuff, just use ocaml-ng.ocamlPackages_XXX.reason
.
I marked this as stale due to inactivity. → More info |
Motivation for this change
Language Server for Reason.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)How to test
Configure your editor by telling it where the binary lives:
${pkgs.reason-language-server}/bin/reason-language-server
, then