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

feat(Compiler)!: Change Grain Artifact Name #1839

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _build/
.installed-pkgs
notes.org
node_modules/
*.grartifact
*.wasm
*.wasm.map
*.wat
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/typed/module_resolution.re
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let read_file_cmi = f => {
};

let get_output_name = name => {
Filepath.String.remove_extension(name) ++ ".gr.wasm";
Filepath.String.remove_extension(name) ++ ".grartifact";
};

let find_ext_in_dir = (dir, name) => {
Expand Down Expand Up @@ -177,7 +177,7 @@ let resolve_unit = (~search_path=?, ~cache=true, ~base_dir=?, unit_name) => {
) {
| (true, Some(res)) => res
| _ =>
let exts = [".gr", ".gr.wasm"];
let exts = [".gr", ".gr.wasm", ".grartifact"];
let (_, dir, basename, _) =
find_in_path_uncap(~exts, base_dir, path, unit_name);
if (cache) {
Expand Down Expand Up @@ -205,7 +205,7 @@ let locate_module = (~disable_relpath=false, base_dir, path, unit_name) => {
let grain_src_exts = [".gr"];
let (dir, m) =
switch (
find_in_path_uncap(~exts=[".gr.wasm"], base_dir, path, unit_name)
find_in_path_uncap(~exts=[".grartifact"], base_dir, path, unit_name)
) {
| (objpath, dir, basename, ext) =>
ignore(log_resolution(unit_name, dir, basename));
Expand Down
1 change: 1 addition & 0 deletions compiler/test/TestFramework.re
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ let clean_grain_output = stdlib_dir =>
file => {
let filename = Filepath.to_string(file);
if (Filepath.String.check_suffix(filename, ".gr.wasm")
|| Filepath.String.check_suffix(filename, ".grartifact")
|| Filepath.String.check_suffix(filename, ".gr.wat")
|| Filepath.String.check_suffix(filename, ".gr.modsig")) {
Fs.rmExn(file);
Expand Down