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

Projects "successfully" initialize without plugins after de-caching. #5155

Open
swaldman opened this issue Oct 5, 2019 · 1 comment
Open
Labels

Comments

@swaldman
Copy link
Contributor

swaldman commented Oct 5, 2019

problem

Trying to move things to the 1.3.x series, I've sometimes had trouble getting plugin SNAPSHOTs to update as I republish them. (That may become a separate issue.)

Using the oldest, ugliest trick for circumventing a cache, I tried just deleting them from the Coursier cache.

Rather than forcing a reload of the plugins, the projects silently "succeed" at initializing, despite the absence of the plugin dependency. This doesn't seem like great behavior, as plug-in dependencies are real dependencies and builds may behave badly in ways users fail to anticipate if the plugins are not there.

steps

sbt version: 1.3.2

build.sbt:

name := "ghost-plugin"

project/build.properties

sbt.version=1.3.2

project/plugins.sbt

addSbtPlugin("com.orrsella" % "sbt-stats" % "1.0.7")

Then run sbt in the project...

$ sbt
[info] Loading settings for project global-plugins from dependency-graph.sbt,metals.sbt,gpg.sbt ...
[info] Loading global plugins from /Users/swaldman/.sbt/1.0/plugins
[info] Loading settings for project ghost-plugin-build from plugins.sbt ...
[info] Loading project definition from /Users/swaldman/tmp/ghost-plugin/project
[info] Loading settings for project ghost-plugin from build.sbt ...
[info] Set current project to ghost-plugin (in build file:/Users/swaldman/tmp/ghost-plugin/)
[info] sbt server started at local:///Users/swaldman/.sbt/1.0/server/1fae12c9df76ab1c13bb/sock
sbt:ghost-plugin> stats
[info] Code Statistics for project:
[info] Files
[info] - Total:      0 files
...

Hooray! But now...

$ rm -rf ~/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/orrsella/sbt-stats_2.12_1.0/1.0.7/
$ sbt
[info] Loading settings for project global-plugins from dependency-graph.sbt,metals.sbt,gpg.sbt ...
[info] Loading global plugins from /Users/swaldman/.sbt/1.0/plugins
[info] Loading settings for project ghost-plugin-build from plugins.sbt ...
[info] Loading project definition from /Users/swaldman/tmp/ghost-plugin/project
[info] Loading settings for project ghost-plugin from build.sbt ...
[info] Set current project to ghost-plugin (in build file:/Users/swaldman/tmp/ghost-plugin/)
[info] sbt server started at local:///Users/swaldman/.sbt/1.0/server/1fae12c9df76ab1c13bb/sock
sbt:ghost-plugin> stats
[error] Expected ';'
[error] Not a valid command: stats (similar: tasks, settings, set)
...

expectation

The build should notice that the plugin dependency is not in fact present, and either reload it or report a failure.

notes

A round of reload plugins / update / reload return cures the problem.

Adding to build.sbt an explicit enablePlugins(StatsPlugin) is a workaround, correctly forces the build to fail to initialize if the plugin is not present.

@swaldman swaldman added the Bug label Oct 5, 2019
@eed3si9n
Copy link
Member

eed3si9n commented Oct 6, 2019

@swaldman Thanks for the report. This looks like update task in the metabuild caches the result without checking for the still- existence of the JAR files. I wonder if this has always been the case or if it regressed at some point.

@eed3si9n eed3si9n added the area/library_management library management label Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants