Skip to content
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

Prepare for a release compatible with 4.14 #1409

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- 414-LTS
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
Expand All @@ -21,8 +21,7 @@ jobs:
- macos-latest
- windows-latest
ocaml-compiler:
- "5.2"

- "4.14"

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -59,19 +58,21 @@ jobs:
- name: Build and install dependencies
run: opam install .

# the makefile explains why we don't use --with-test
# ppx expect is not yet compatible with 5.1 and test output vary from one
# compiler to another. We only test on 4.14.
# the makefile explains why we don't use test dependencies
- name: Install test dependencies
if: matrix.ocaml-compiler == '4.14'
run: opam exec -- make install-test-deps

- name: Run build @all
if: matrix.ocaml-compiler == '4.14'
run: opam exec -- make all

- name: Run the unit tests
if: matrix.ocaml-compiler == '4.14'
run: opam exec -- make test-ocaml

- name: Run the template integration tests
if: matrix.ocaml-compiler == '4.14'
run: opam exec -- make test-e2e

coverage:
Expand All @@ -86,7 +87,7 @@ jobs:
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.2"
ocaml-compiler: "4.14"
allow-prerelease-opam: true

- name: Set git user
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Changelog check

on:
pull_request:
branches: [master]
branches: [414-LTS]
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- master
- 414-LTS
jobs:
# tests:
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ all:
# results in a conflict
.PHONY: install-test-deps
install-test-deps:
opam install --yes cinaps 'ppx_expect>=v0.17.0' \
opam install --yes cinaps 'ppx_expect<v0.17.0' \
ocamlformat.$$(awk -F = '$$1 == "version" {print $$2}' .ocamlformat)

.PHONY: dev
Expand Down
8 changes: 4 additions & 4 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ possible and does not make any assumptions about IO.
yojson
(ppx_yojson_conv_lib (>= "v0.14"))
(cinaps :with-test)
(ppx_expect (and (>= v0.17.0) :with-test))
(ppx_expect (and (>= v0.15.0) (< 0.17.0) :with-test))
(uutf (>= 1.0.2))
(odoc :with-doc)
(ocaml (>= 4.14))))
Expand All @@ -55,21 +55,21 @@ possible and does not make any assumptions about IO.
dyn
stdune
(fiber (and (>= 3.1.1) (< 4.0.0)))
(ocaml (>= 5.2.0))
(ocaml (and (>= 4.14.0) (< 5.0)))
xdg
ordering
dune-build-info
spawn
astring
camlp-streams
(ppx_expect (and (>= v0.17.0) :with-test))
(ppx_expect (and (>= v0.15.0) (< 0.17.0) :with-test))
(ocamlformat (and :with-test (= 0.26.2)))
(ocamlc-loc (>= 3.7.0))
(pp (>= 1.1.2))
(csexp (>= 1.5))
(ocamlformat-rpc-lib (>= 0.21.0))
(odoc :with-doc)
(merlin-lib (and (>= 5.2) (< 6.0)))))
(merlin-lib (and (>= 4.18) (< 5.0)))))

(package
(name jsonrpc)
Expand Down
100 changes: 15 additions & 85 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 14 additions & 36 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nix-ocaml/nix-overlays";
merlin5_2 = {
url = "github:ocaml/merlin/main";
flake = false;
};
merlin5_1 = {
url = "github:ocaml/merlin/501";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
merlin4_14 = {
url = "github:ocaml/merlin/v4.18-414";
flake = false;
};
};
Expand All @@ -30,7 +26,7 @@
});
dune-release =
prev.dune-release.overrideAttrs (_: { doCheck = false; });
ocamlPackages = prev.ocamlPackages.overrideScope' (oself: osuper:
ocamlPackages = prev.ocamlPackages.overrideScope (oself: osuper:
let
fixPreBuild = o: {
propagatedBuildInputs = o.propagatedBuildInputs ++ [ oself.pp ];
Expand Down Expand Up @@ -58,33 +54,24 @@
in rec {
jsonrpc = buildDunePackage (basePackage // {
pname = "jsonrpc";
doCheck = false;
propagatedBuildInputs = with pkgs.ocamlPackages; [ ];
});

lsp = buildDunePackage (basePackage // {
pname = "lsp";
doCheck = false;
propagatedBuildInputs = with pkgs.ocamlPackages; [
jsonrpc
yojson
ppx_yojson_conv_lib
uutf
];
checkInputs = let p = pkgs.ocamlPackages;
in [
p.stdune
p.cinaps
p.ppx_expect
p.ppx_yojson_conv
(ocamlformat pkgs)
];
in [ p.cinaps p.ppx_expect p.ppx_yojson_conv (ocamlformat pkgs) ];
});

ocaml-lsp = with pkgs.ocamlPackages;
buildDunePackage (basePackage // {
pname = package;
doCheck = false;
checkInputs = let p = pkgs.ocamlPackages;
in [
p.ppx_expect
Expand Down Expand Up @@ -137,29 +124,20 @@
overlays = [ (ocamlVersionOverlay ocaml) (overlay merlin) ];
inherit system;
};
pkgs_5_1 =
makeNixpkgs (ocaml: ocaml.ocamlPackages_5_1) inputs.merlin5_1;
pkgs_5_2 =
makeNixpkgs (ocaml: ocaml.ocamlPackages_5_2) inputs.merlin5_2;
localPackages_5_1 = makeLocalPackages pkgs_5_1;
localPackages_5_2 = makeLocalPackages pkgs_5_2;
pkgs_4_14 =
makeNixpkgs (ocaml: ocaml.ocamlPackages_4_14) inputs.merlin4_14;
localPackages_4_14 = makeLocalPackages pkgs_4_14;
devShell = localPackages: nixpkgs:
nixpkgs.mkShell {
buildInputs = [ nixpkgs.ocamlPackages.utop ];
inputsFrom =
builtins.map (x: x.overrideAttrs (p: n: { doCheck = true; }))
(builtins.attrValues localPackages);
inputsFrom = builtins.attrValues localPackages;
};
in {
packages = (localPackages_5_2 // {
default = localPackages_5_2.ocaml-lsp;
ocaml_5_1 = localPackages_5_1;
});
packages =
(localPackages_4_14 // { default = localPackages_4_14.ocaml-lsp; });

devShells = {
default = devShell localPackages_5_2 pkgs_5_2;

ocaml5_1 = devShell localPackages_5_1 pkgs_5_1;
default = devShell localPackages_4_14 pkgs_4_14;

release = pkgsWithoutOverlays.mkShell {
buildInputs = [ pkgsWithoutOverlays.dune-release ];
Expand All @@ -176,8 +154,8 @@
];
};

check = pkgs_5_2.mkShell {
inputsFrom = builtins.attrValues localPackages_5_2;
check = pkgs_4_14.mkShell {
inputsFrom = builtins.attrValues localPackages_4_14;
};
};
}));
Expand Down
2 changes: 1 addition & 1 deletion jsonrpc-fiber/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
jsonrpc_fiber
;; This is because of the (implicit_transitive_deps false)
;; in dune-project
ppx_expect
ppx_expect.common
ppx_expect.config
ppx_expect.config_types
ppx_inline_test.config
Expand Down
2 changes: 1 addition & 1 deletion lsp-fiber/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
lsp_fiber
;; This is because of the (implicit_transitive_deps false)
;; in dune-project
ppx_expect
ppx_expect.common
ppx_expect.config
ppx_expect.config_types
ppx_inline_test.config
Expand Down
2 changes: 1 addition & 1 deletion lsp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ depends: [
"yojson"
"ppx_yojson_conv_lib" {>= "v0.14"}
"cinaps" {with-test}
"ppx_expect" {>= "v0.17.0" & with-test}
"ppx_expect" {>= "v0.15.0" & < "0.17.0" & with-test}
"uutf" {>= "1.0.2"}
"odoc" {with-doc}
"ocaml" {>= "4.14"}
Expand Down
Loading