From 41c4bdfef17eda3a096cd57d5acf84b666114efe Mon Sep 17 00:00:00 2001 From: Daniel Darabos Date: Sat, 28 Aug 2021 15:53:39 +0200 Subject: [PATCH 1/2] Fix for realpathish /root returning //root. --- sbt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sbt b/sbt index 7fb865514..6403c4414 100755 --- a/sbt +++ b/sbt @@ -46,11 +46,18 @@ realpathish () { COUNT=$(($COUNT + 1)) done + TARGET_DIR="$(pwd -P)" + if [ "$TARGET_DIR" == "/" ]; then + TARGET_FILE="/$TARGET_FILE" + else + TARGET_FILE="$TARGET_DIR/$TARGET_FILE" + fi + # make sure we grab the actual windows path, instead of cygwin's path. if [[ "x$FIX_CYGPATH" != "x" ]]; then - echo "$(cygwinpath "$(pwd -P)/$TARGET_FILE")" + echo "$(cygwinpath "$TARGET_FILE")" else - echo "$(pwd -P)/$TARGET_FILE" + echo "$TARGET_FILE" fi ) } From 39bcfee937bbbe6d99529b5d28052bfc5a66a037 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 5 Sep 2021 00:55:27 -0400 Subject: [PATCH 2/2] Fix ClassCastException Ref #6592 When there's an issue like timeout, currently it throws a ClassCastException because I made some assumption about the underlying error. This removes the unnecessary casting. --- main/src/main/java/sbt/internal/XMainConfiguration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/src/main/java/sbt/internal/XMainConfiguration.java b/main/src/main/java/sbt/internal/XMainConfiguration.java index 9cebe23af..d6cf69af2 100644 --- a/main/src/main/java/sbt/internal/XMainConfiguration.java +++ b/main/src/main/java/sbt/internal/XMainConfiguration.java @@ -22,7 +22,8 @@ import xsbti.*; * we can avoid loading any classes from the old scala provider. */ public class XMainConfiguration { - public xsbti.MainResult run(String moduleName, xsbti.AppConfiguration configuration) { + public xsbti.MainResult run(String moduleName, xsbti.AppConfiguration configuration) + throws Throwable { try { ClassLoader topLoader = configuration.provider().scalaProvider().launcher().topLoader(); xsbti.AppConfiguration updatedConfiguration = null; @@ -56,7 +57,7 @@ public class XMainConfiguration { return (xsbti.MainResult) runMethod.invoke(instance, updatedConfiguration); } catch (InvocationTargetException e) { // This propogates xsbti.FullReload to the launcher - throw (xsbti.FullReload) e.getCause(); + throw e.getCause(); } } catch (ReflectiveOperationException e) { throw new RuntimeException(e);