Skip to content
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

--branch xyz fails with 'remote hung up unexpectedly' on ssh:// urls #546

Open
jasperstein opened this issue Apr 26, 2021 · 8 comments
Open

Comments

@jasperstein
Copy link

jasperstein commented Apr 26, 2021

steps

No steps required.
sbt 1.5.0.

problem

sbt new fails when using the --branch switch on an ssh://... protocol g8 template, e.g.:

% sbt new ssh://[email protected]/scala/scala-seed.g8.git
>>> -no problem-

% sbt new ssh://[email protected]/scala/scala-seed.g8.git --branch 2.12.x
[...]
ssh://[email protected]/scala/scala-seed.g8.git: remote hung up unexpectedly

(More details in stack trace)

stack trace
% sbt -v new ssh://[email protected]/scala/scala-seed.g8.git --branch 2.12.x
[sbt_options] declare -a sbt_options=()
[process_args] java_version = '15'
[copyRt] java9_rt = '/Users/jasperstein/.sbt/1.0/java9-rt-ext-n_a_15_0_2/rt.jar'
# Executing command line:
java
-Dfile.encoding=UTF-8
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-Dscala.ext.dirs=/Users/jasperstein/.sbt/1.0/java9-rt-ext-n_a_15_0_2
-jar
/usr/local/Cellar/sbt/1.5.0/libexec/bin/sbt-launch.jar
new
ssh://[email protected]/scala/scala-seed.g8.git
--branch
2.12.x

[info] welcome to sbt 1.5.0 (N/A Java 15.0.2)
[info] loading settings for project global-plugins-build-build-build from metals.sbt ...
[info] loading global plugins from /Users/jasperstein/.sbt/1.0/plugins/project/project/project
[info] loading settings for project global-plugins-build-build from metals.sbt ...
[info] loading global plugins from /Users/jasperstein/.sbt/1.0/plugins/project/project
[success] Generated .bloop/global-plugins-build-build.json
[success] Total time: 0 s, completed 26 apr. 2021 12:30:07
[info] loading settings for project global-plugins-build from build.sbt ...
[info] loading global plugins from /Users/jasperstein/.sbt/1.0/plugins/project
[success] Generated .bloop/global-plugins-build.json
[success] Total time: 0 s, completed 26 apr. 2021 12:30:08
[info] loading global plugins from /Users/jasperstein/.sbt/1.0/plugins
[info] loading project definition from /Users/jasperstein/tmp/project
[info] set current project to tmp (in build file:/Users/jasperstein/tmp/)
[info] set current project to tmp (in build file:/Users/jasperstein/tmp/)

ssh://[email protected]/scala/scala-seed.g8.git: remote hung up unexpectedly

expectation

The specified branch of scala-seed.g8 is used to generate a seed project

notes

@jasperstein jasperstein changed the title --branch xyz fails wit 'remote hung up unexpectedly' on ssh:// urls --branch xyz fails with 'remote hung up unexpectedly' on ssh:// urls May 4, 2021
@jasperstein
Copy link
Author

This seems to be a problem on sbt only, not on 'bare' g8. g8 ssh://[email protected]/scala/scala-seed.g8.git --branch 2.12.x works fine.

@jasperstein
Copy link
Author

This problem appears to have been introduced in sbt 1.3.13

@TonioGela
Copy link
Member

@jasperstein, can you please test this fix? Instructions are provided, and you just need coursier and sbt to build it.

@jasperstein
Copy link
Author

@jasperstein, can you please test this fix? Instructions are provided, and you just need coursier and sbt to build it.

Hi Tonio, thanks for looking into this! I've tried building it locally but it won't on my machine, sorry. (Compile / compileIncremental) java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI I am still something of an sbt n00b so maybe there's something easy and obvious-for-you-but-not-for-me that I could try?

However since your fix will produce an experimental version of g8 not sbt, the only thing I can test is whether this doesn't break g8. On a bare g8, --branch works well with ssh:// urls; it's just that sbt new won't. Or could I easily make an experimental version of sbt too, including this fix?

@TonioGela
Copy link
Member

Argh, I admit that I got confused while I was linking issues to my PR. In fact, this issue might be related to sbt and not to g8, particularly how sbt parses command-line options after new, but I'm totally guessing.
I thought that it could have been related to ssh private keys and/or configurations, while that's clearly not the case since (as you said) with bare g8 this works.
Sorry for giving you false hopes, I swear that I'll try to address this issue too when the one I'm working on gets fixed.
Btw it might be worth opening an issue on sbt, too and link this one probably.

@jasperstein
Copy link
Author

jasperstein commented Jun 13, 2021 via email

@jasperstein
Copy link
Author

Huh. Apparently the image didn't get through via email (and the msg to which it was a reply also seems gone?). Here it is for reals, if at least it works this time :-)

image

@TonioGela
Copy link
Member

Yeah, I removed the message sometime after writing since I realized that it was indeed working 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants