-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to set classpath via @<argument-file> from dist/bin/scala
command line
#13552
Comments
i noticed that the regexes for scalaOption and colorOption are not capturing anything, but maybe that is not necessary: |
dist/bin/scala
command linedist/bin/scala
command line
This problem is a side-effect of the order that command line arguments are being passed at case ExecuteMode.Script =>
val properArgs =
List("-classpath", settings.classPath.mkString(classpathSeparator)).filter(Function.const(settings.classPath.nonEmpty))
++ settings.residualArgs
++ (if settings.save then List("-save") else Nil)
++ settings.scalaArgs
++ List("-script", settings.targetScript)
++ settings.scriptArgs
scripting.Main.main(properArgs.toArray) This bug also manifests when However, after the above re-ordering of arguments to Flag -classpath set repeatedly
Could not find package scala from compiler core libraries.
Make sure the compiler core libraries are on the classpath. A user could work around this by prepending compiler core libraries to their classpath, although it would seem preferrable to for Here's the relevant section of [[ $save_compiled == true ]] && rm -f $target_jar
PROG_NAME=$ScriptingMain
compilerJavaClasspathArgs # initialize jvm_cp_args with toolchain classpath
scripting_string="-script $target_script ${script_args[@]}"
# use eval instead of exec, to insure that onExit is subsequently called
# $script_cp_arg must be the first argument to $ScriptingMain
# $scripting_string must be last
eval "\"$JAVACMD\"" \
${JAVA_OPTS:-$default_java_opts} \
"${java_args[@]}" \
"-classpath \"$jvm_cp_args\"" \
-Dscala.usejavacp=true \
"$setScriptName" \
"$ScriptingMain" \
${script_cp_arg-} \
"${scala_args[@]}" \
"${residual_args[@]}" \
"${scripting_string-}" # must be the last arguments
scala_exit_status=$? Perhaps because the compiler toolchain libraries are added to the java classpath, and the |
Compiler version
Scala code runner version 3.1.0-RC2 -- Copyright 2002-2021, LAMP/EPFL
Minimized command line
The test script, named
importTest.sc
:Output
Expectation
Should be able to set the -classpath via
@argumentFile.txt
on the command line, as with previous releases.Am able to demonstrate the problem in each of the following bash environments:
Seems like this would have been caught by
compiler/test/dotty/tools/scripting/BashScriptsTests.scala
.The text was updated successfully, but these errors were encountered: