Skip to content

Commit

Permalink
cleanup: Remove locate-dylan-compiler; assume it's on the PATH
Browse files Browse the repository at this point in the history
What was I thinking?
  • Loading branch information
cgay committed Dec 29, 2024
1 parent df85417 commit bce91ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
7 changes: 3 additions & 4 deletions sources/commands/build.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ define method execute-subcommand
| error("No libraries found in workspace and no"
" default libraries configured."));
end;
let dylan-compiler = locate-dylan-compiler();
for (name in library-names)
// TODO: this should pass -target dll in some cases.
let command = remove(vector(dylan-compiler,
let command = remove(vector("dylan-compiler",
"-compile",
get-option-value(subcmd, "clean") & "-clean",
get-option-value(subcmd, "link") & "-link",
Expand All @@ -68,8 +67,8 @@ define method execute-subcommand
let env = make-compilation-environment(ws);
let exit-status
= os/run-application(command,
environment: env, // adds to the existing environment
under-shell?: #f,
environment: env, // AUGMENTS the existing environment
under-shell?: #t,
working-directory: ws/workspace-directory(ws));
if (exit-status ~== 0)
error("Build of %= failed with exit status %=.", name, exit-status);
Expand Down
3 changes: 1 addition & 2 deletions sources/library.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ define module shared
note,
verbose,
trace,
warn,
locate-dylan-compiler;
warn;
end module;

define module pacman
Expand Down
19 changes: 0 additions & 19 deletions sources/shared.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,3 @@ end;
define inline function warn (fmt, #rest args) => ()
apply(note, concat("WARNING: ", fmt), args);
end;


// Find the full path to dylan-compiler or signal an error.
define function locate-dylan-compiler () => (dc :: <string>)
let output = with-output-to-string (stream)
local method outputter (output, #key end: epos)
write(stream, copy-sequence(output, end: epos));
end;
os/run-application("which dylan-compiler",
under-shell?: #t,
outputter: outputter);
end;
let lines = split-lines(output);
if (lines[0].size > 0)
lines[0]
else
error("dylan-compiler not found. Is it on your PATH?");
end
end function;

0 comments on commit bce91ff

Please sign in to comment.