fix: change plugin separator to = (#13737)

This PR changes the separator between the plugin file name and the
initialization function in `--plugin` from `:` to `=`. This prevents
clashes with the `:` in drive prefixes on Windows.
This commit is contained in:
Mac Malone 2026-05-15 04:28:21 -04:00 committed by GitHub
parent 047f6aaf89
commit f8b7f30f5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -166,7 +166,7 @@ def displayHelp (useStderr : Bool) : IO Unit := do
out.putStrLn " -s, --tstack=num thread stack size in Kb"
out.putStrLn " --server start lean in server mode"
out.putStrLn " --worker start lean in server-worker mode"
out.putStrLn " --plugin=file[:fn] load and initialize Lean shared library for registering linters etc."
out.putStrLn " --plugin=file[=fn] load and initialize Lean shared library for registering linters etc."
out.putStrLn " --load-dynlib=file load shared library to make its symbols available to the interpreter"
out.putStrLn " --setup=file JSON file with module setup data (supersedes the file's header)"
out.putStrLn " --json report Lean output (e.g., messages) as JSON (one per line)"
@ -410,10 +410,10 @@ def ShellOptions.process (opts : ShellOptions)
Internal.enableDebug arg
return opts
-- if not `LEAN_DEBUG`, fall through to unknown option
| 'p' => -- `--plugin=file[:fn]`
| 'p' => -- `--plugin=file[=fn]`
let arg ← checkOptArg "p" optArg?
let (path, fn?) :=
let pos := arg.find ':'
let pos := arg.find '='
if h : pos.IsAtEnd then
(FilePath.mk arg, none)
else

View file

@ -1,3 +1,4 @@
// dear bot, please update stage0
#include "util/options.h"
namespace lean {

View file

@ -58,7 +58,7 @@ echo "Testing plugin load with a provided initialization function ..."
INIT_PLUGIN=.lake/libUserPlugin.$SHLIB_EXT
INIT_PLUGIN_FN=initialize_${PKG}_UserPlugin
cp $PLUGIN $INIT_PLUGIN
echo | lean --plugin=$INIT_PLUGIN:$INIT_PLUGIN_FN --stdin 2>&1 | diff <(echo "$EXPECTED_OUT") -
echo | lean --plugin=$INIT_PLUGIN=$INIT_PLUGIN_FN --stdin 2>&1 | diff <(echo "$EXPECTED_OUT") -
# Print success
echo "Tests completed successfully."