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

Add scopes to the tasks defined by the sbt plugin #714

Merged
merged 4 commits into from May 16, 2017

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented May 9, 2017

The changes to the scripted tests may be seen as a problem, but they are actually correct. The following build definition would fail at runtime, saying that there are undefined settings:

lazy val foo = taskKey[Unit]("...")

foo := {
  compile.value
  ()
}

Also, fixes #692

@@ -235,18 +236,18 @@ object ScalaNativePluginInternal {
logger.running(compilec)
val result = Process(compilec, cwd) ! logger
if (result != 0) {
println("Failed to compile native library runtime code.")
sys.error("Failed to compile native library runtime code.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is a fix of #692

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I mentioned it in the commit message, but forgot to in the PR description. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that sys.error will be deprecated in 2.13: scala/scala#5677. It's better to use throw new RuntimeException instead.

@densh
Copy link
Member

densh commented May 16, 2017

The changes look good to me! 👍
Please rebase on top of master and it's good to go!

Copy link
Member

@densh densh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@Duhemm
Copy link
Contributor Author

Duhemm commented May 16, 2017

Done!

@densh densh merged commit d1255a5 into scala-native:master May 16, 2017
@xuwei-k
Copy link
Contributor

xuwei-k commented May 18, 2017

Maybe there is a regression or change specification of sbt run.
sbt run invoke JVM main method (not native) after this changes.

@densh
Copy link
Member

densh commented May 18, 2017

@xuwei-k That's definitely a regression. 😱 /cc @Duhemm

@Duhemm
Copy link
Contributor Author

Duhemm commented May 18, 2017

@xuwei-k Do you have an example of project that shows this behavior? I can't reproduce it on the sandbox project in Scala Native's build, nor on another small project.

Duhemm added a commit to Duhemm/scala-native that referenced this pull request May 19, 2017
It was incorrectly unscoped since scala-native#714
muxanick pushed a commit to muxanick/scala-native that referenced this pull request May 25, 2017
* Scope Scala Native's tasks to `Compile` and `Test`

* Report native lib compilation failures

* Adapt scripted tests to scoping changes

* Remove unused imports

Fixes scala-native#692
Duhemm added a commit to Duhemm/scala-native that referenced this pull request Jun 9, 2017
It was incorrectly unscoped since scala-native#714
densh pushed a commit that referenced this pull request Jun 9, 2017
* Fix `nativeMode` scoping in `build.sbt`

It was incorrectly unscoped since #714

* Put certain settings in `Global` scope

* Revert changes to build.sbt
@xuwei-k
Copy link
Contributor

xuwei-k commented Jun 19, 2017

Do you have an example of project that shows this behavior?

[info] Compiling 50 Scala sources to /home/travis/build/xuwei-k/shapeless/examples/.native/target/scala-2.11/classes...
[info] Compiling 1 Scala source to /home/travis/build/xuwei-k/shapeless/nativeTest/target/scala-2.11/classes...
background log: info: Running shapeless.NativeMain 
background log: debug: Waiting for threads to exit or System.exit to be called.
background log: debug:   Classpath:
	/home/travis/build/xuwei-k/shapeless/nativeTest/target/scala-2.11/classes
	/home/travis/build/xuwei-k/shapeless/examples/.native/target/scala-2.11/classes
	/home/travis/build/xuwei-k/shapeless/core/native/target/scala-2.11/classes
	/home/travis/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar
	/home/travis/.ivy2/cache/org.scala-native/nativelib_native0.3_2.11/jars/nativelib_native0.3_2.11-0.3.0.jar
	/home/travis/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.11.jar
	/home/travis/.ivy2/cache/org.scala-native/javalib_native0.3_2.11/jars/javalib_native0.3_2.11-0.3.0.jar
	/home/travis/.ivy2/cache/org.scala-native/scalalib_native0.3_2.11/jars/scalalib_native0.3_2.11-0.3.0.jar
	/home/travis/.ivy2/cache/org.typelevel/macro-compat_2.11/jars/macro-compat_2.11-1.1.1.jar
	/home/travis/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.6.jar
background log: debug: Waiting for thread run-main-0 to terminate.

@densh
Copy link
Member

densh commented Jun 21, 2017

@xuwei-k Can you please file an issue for this?

@Duhemm Duhemm deleted the topic/task-scoping branch September 20, 2017 08:41
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.

Failing to compile nativelib should stop everything
5 participants