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

chore: use the stock js_of_ocaml #4965

Merged
merged 2 commits into from
Mar 24, 2025
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
22 changes: 0 additions & 22 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,6 @@ let
# Additional ocaml package
ocamlPackages = super.ocamlPackages // rec {

# upgrade `js_of_ocaml(-compiler)` until we have figured out the bug related to 4.1.0 (which is in nixpkgs)
js_of_ocaml-compiler = super.ocamlPackages.js_of_ocaml-compiler.overrideAttrs rec {
version = "5.0.1";
src = self.fetchurl {
url = "https://github.com/ocsigen/js_of_ocaml/releases/download/${version}/js_of_ocaml-${version}.tbz";
sha256 = "sha256-eiEPHKFqdCOBlH3GfD2Nn0yU+/IHOHRLE1OJeYW2EGk=";
};
};

# inline recipe from https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/ocaml/js_of_ocaml/default.nix
js_of_ocaml = with super.ocamlPackages; buildDunePackage {
pname = "js_of_ocaml";

inherit (js_of_ocaml-compiler) version src;
duneVersion = "3";

buildInputs = [ ppxlib ];
propagatedBuildInputs = [ js_of_ocaml-compiler uchar ];

meta = builtins.removeAttrs js_of_ocaml-compiler.meta [ "mainProgram" ];
};

# downgrade wasm until we have support for 2.0.1
# (https://github.com/dfinity/motoko/pull/3364)
wasm_1 = super.ocamlPackages.wasm.overrideAttrs rec {
Expand Down
4 changes: 2 additions & 2 deletions test/test-moc_interpreter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ moc.Motoko.saveFile('empty.mo', '');
moc.Motoko.saveFile('ok.mo', '1');
moc.Motoko.saveFile('warn.mo', '2 - 1');
moc.Motoko.saveFile('bad.mo', '1+');
moc.Motoko.saveFile('limit.mo', 'var i = 0; while (i < 10000) { i += 1 }; i');
moc.Motoko.saveFile('limit.mo', 'var i = 0; while (i < 7600) { i += 1 }; i');
moc.Motoko.saveFile('text.mo', `let s = "${'⛔|'.repeat(10000)}"; s.size()`); // #3822

try {
Expand Down Expand Up @@ -43,7 +43,7 @@ try {
error: null,
},
stderr: '',
stdout: '10_000 : Nat\n'
stdout: '7_600 : Nat\n'
});

moc.Motoko.setRunStepLimit(5000);
Expand Down