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

Complete the project setup #1

Open
6 of 12 tasks
fsat opened this issue Sep 6, 2017 · 8 comments
Open
6 of 12 tasks

Complete the project setup #1

fsat opened this issue Sep 6, 2017 · 8 comments
Assignees

Comments

@fsat
Copy link
Owner

fsat commented Sep 6, 2017

  • Generate Scala Native project
  • Enable SBT plugin: AutomateHeader.
  • Enable SBT plugin: Scalariform.
  • Ensure argument parsing using scopt works.
  • Ensure JSON library generation works using argonaut
  • Ensure we can run test using utest
  • Find out what native HTTP client we can use
  • Find out if we can statically link libunwind.so
  • Setup multi-module build
  • Decide packaging format - .deb, .rpm, and .zip?
  • Introduce Travis build
  • Release pipeline
@fsat fsat self-assigned this Sep 6, 2017
@fsat
Copy link
Owner Author

fsat commented Sep 6, 2017

Confirmed scala-test library doesn't have its native version published:

[info] Resolving org.scalatest#scalatest_native0.3_2.11;3.0.3 ...
[warn] 	module not found: org.scalatest#scalatest_native0.3_2.11;3.0.3
[warn] ==== local: tried
[warn]   /Users/felixsatyaputra/.ivy2/local/org.scalatest/scalatest_native0.3_2.11/3.0.3/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalatest/scalatest_native0.3_2.11/3.0.3/scalatest_native0.3_2.11-3.0.3.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/felixsatyaputra/.sbt/preloaded/org.scalatest/scalatest_native0.3_2.11/3.0.3/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/felixsatyaputra/.sbt/preloaded/org/scalatest/scalatest_native0.3_2.11/3.0.3/scalatest_native0.3_2.11-3.0.3.pom
[warn] ==== com-mvn: tried
[warn] ==== com-ivy: tried
[warn]   https://lightbend.bintray.com/commercial-releases/org.scalatest/scalatest_native0.3_2.11/3.0.3/ivys/ivy.xml
[info] Resolving jline#jline;2.14.3 ...
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: org.scalatest#scalatest_native0.3_2.11;3.0.3: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] 	Note: Unresolved dependencies path:
[warn] 		org.scalatest:scalatest_native0.3_2.11:3.0.3 (/Users/felixsatyaputra/workspace/typesafe-fsat/k8s-cli/build.sbt#L11-15)
[warn] 		  +- default:k8s-cli_native0.3_2.11:0.1-SNAPSHOT
sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_native0.3_2.11;3.0.3: not found
	at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
	at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)

However there's a promising PR to enable Scala Native publishing for the Scala Test project:

scalatest/scalatest#1185

This PR depends on the scalacheck native support PR being merged and a native version of the scalacheck being published:

typelevel/scalacheck#337

I have checked the scalacheck PR typelevel/scalacheck#337 - sbt publishLocal publishes the local native library as expected.

Unfortunately the scalatest PR still has some problem when sbt publishLocal is invoked, i.e.

[error] /Users/felixsatyaputra/workspace/typesafe-fsat/scalatest/scalatest.native/target/scala-2.11/src_managed/main/scala/gentables/TableAsserting.scala:445: ';' expected but 'val' found.
[error]     E-ONLY val stackDepth = 1
[error]            ^
[error] /Users/felixsatyaputra/workspace/typesafe-fsat/scalatest/scalatest.native/target/scala-2.11/src_managed/main/scala/gentables/TableAsserting.scala:494: ';' expected but 'val' found.
[error]     E-ONLY val stackDepth = 1
[error]            ^

@longshorej
Copy link

Doesn't play-json use Jackson? I think that'll be a problem as Jackson is a Java library.

Argonaut has scala native support - https://github.com/argonaut-io/argonaut - it's more FP-oriented (lenses etc) but I quite liked it on some prior projects.

@longshorej
Copy link

Also, for testing libraries utest has a build for native: https://github.com/lihaoyi/utest

@shadaj
Copy link

shadaj commented Sep 10, 2017

@fsat I just fixed the compilation issue in the scalatest PR, can you try again with the latest commit?

@fsat
Copy link
Owner Author

fsat commented Sep 11, 2017

@longshorej - Yes, play-json does use Jackson for the JVM artefact:

https://github.com/playframework/play-json/blob/master/build.sbt#L25

However play-json also has a build targeting ScalaJS, and I don't think the ScalaJS build is using Jackson if I understand it correctly. According to Greg, the Scala Native build is just a matter of setting it up.

I think for the sake of expediency, I'd say we can go with the argonaut.

@fsat
Copy link
Owner Author

fsat commented Sep 11, 2017

@longshorej - So I managed to get the argonaut to work, although it requires building a locally published Scala Native 0.3 artefact.

The commit 5fc40c4 generates this output:

Felixs-MBP-2:k8s-cli felixsatyaputra$ target/scala-2.11/k8s-cli-out -f bar
Got input args: InputArgs(Some(bar))
Got input args as Argonaut JSON:
{"foo":"bar"}
Got input args as JSON string:
{
  "foo" : "bar"
}

I have asked the argonaut-json Google groups as to when the next Argonaut release date will be, and if the Scala Native 0.3 artefact will be published as well.

@fsat
Copy link
Owner Author

fsat commented Sep 11, 2017

@longshorej - utest works a treat! Thanks for the suggestion!

@shadaj
Copy link

shadaj commented Sep 12, 2017

@fsat For compiling ScalaTest.native, you need to checkout my PR (Duhemm/scalacheck#1) for ScalaCheck, rename the version in build.sbt to 1.14.0-native and publish locally. I placed ScalaCheck under a different version for the PR to clarify that it is compiling against a PR for ScalaCheck.

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

No branches or pull requests

3 participants