smlnj / legacy

This project is the old version of Standard ML of New Jersey that continues to support older systems (e.g., 32-bit machines).
BSD 3-Clause "New" or "Revised" License
25 stars 10 forks source link

CM cannot find tools when using `cmb-make` to compile the compiler #295

Closed JohnReppy closed 5 months ago

JohnReppy commented 5 months ago

Version

110.99.4 (Latest)

Operating System

OS Version

n.a.

Processor

System Component

Compilation manager (CM)

Severity

Minor

Description

If one does not have the ml-yacc (etc) tools installed and in one's path, then cmb-make will fail compiling the compiler, when it should pick up the tools from the same location as the sml command is found.

Transcript

<jhr@Froh> cmb-make ../../bin/sml
Standard ML of New Jersey (64-bit) v110.99.4 [built: Mon Jul 31 12:41:30 2023]
- [autoloading]
...
[plugin $/mllex-tool.cm loaded successfully]
["ml-ulex" --ml-lex-mode "lex/ml.lex"]
sh: ml-ulex: command not found
/Users/jhr/Work/smlnj/sml-legacy/base/compiler/Parse/parser.cm:42.2-42.12 Error: tool "ULex-ML-Lex" failed: "ml-ulex" --ml-lex-mode "lex/ml.lex"
["ml-ulex" --ml-lex-mode "lex/sml.lex"]
sh: ml-ulex: command not found
/Users/jhr/Work/smlnj/sml-legacy/base/compiler/Parse/parser.cm:43.2-43.13 Error: tool "ULex-ML-Lex" failed: "ml-ulex" --ml-lex-mode "lex/sml.lex"
[attempting to load plugin $/mlyacc-tool.cm]
[library $/mlyacc-tool.cm is stable]
[plugin $/mlyacc-tool.cm loaded successfully]
val it = false : bool
- 

Expected Behavior

It should use the tools in ../../bin.

Steps to Reproduce

Make sure that the tools are not available; touch one of the lexer or yacc files in the source tree and then run cmb-make.

Additional Information

No response

Email address

jhr@cs.uchicago.edu

JohnReppy commented 5 months ago

Fixed for 110.99.5. The fix was to modify cmb-make to update the PATH variable to include the path to the directory containing the sml command. I.e., if you run cmb-make ../../bin/sml, then ../../bin is added to the PATH variable.