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

Throw error if you run sbt from / #5112

Merged
merged 1 commit into from
Sep 30, 2019
Merged

Throw error if you run sbt from / #5112

merged 1 commit into from
Sep 30, 2019

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Sep 21, 2019

Fixes #1458

Running sbt from / results to sbt getting stuck trying to load the directories recursively, and eventually erroring with a java.lang.OutOfMemoryError (after freezing for a long time) even on an Alpine container.

To prevent it, this adds a check to see if the absolute path is / or not.

/ $ sbt -Dsbt.version=1.4.0-SNAPSHOT
[error] java.lang.IllegalStateException: cannot run sbt from root directory without -Dsbt.rootdir=true; see sbt/sbt#1458
[error] Use 'last' for the full log.

Note: To opt into running sbt at /, run with -Dsbt.rootdir=true.

main/src/main/scala/sbt/Main.scala Outdated Show resolved Hide resolved
main/src/main/scala/sbt/internal/SysProp.scala Outdated Show resolved Hide resolved
Fixes sbt#1458

Running sbt from `/` results to sbt getting stuck trying to load the directories recursively, and eventually erroring with a java.lang.OutOfMemoryError (after freezing for a long time) even on an Alpine container.

To prevent it, this adds a check to see if the absolute path is `/` or not.

```
/ $ sbt -Dsbt.version=1.4.0-SNAPSHOT
[error] java.lang.IllegalStateException: cannot run sbt from root directory without -Dsbt.rootdir=true; see sbt#1458
[error] Use 'last' for the full log.
```
@eed3si9n eed3si9n merged commit f729901 into sbt:develop Sep 30, 2019
@eed3si9n eed3si9n deleted the wip/root branch September 30, 2019 19:04
@eed3si9n eed3si9n added this to the 1.4.0 milestone Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OutOfMemoryError if running sbt from the root directory
2 participants