Skip to content

Commit

Permalink
Sync with 0.5.0-RC2 (#37)
Browse files Browse the repository at this point in the history
* Sync with 0.5.0-RC2
  • Loading branch information
WojciechMazur authored Mar 13, 2024
1 parent 1702e56 commit 08c3aa3
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Test
run: >
sbt 'set cli/scalaVersion := "${{matrix.scala}}"'
+cli/test
+cliScriptedTests/scripted
sbt ++${{matrix.scala}}
cli/test
"cliScriptedTests/scripted ${{ startsWith(matrix.OS, 'windows') && 'integration/cli' || ''}}"
shell: bash
23 changes: 14 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

val ScalaNativeVersion = "0.5.0-SNAPSHOT"
val ScalaNativeVersion = "0.5.0-RC2"
// Update during release procedure to provide access to staged, but not published artifacts
val StagingRepoIds = Nil
val StagingRepoIds = (1130 to 1132)
val StagingRepoNames = StagingRepoIds.map(id => s"orgscala-native-$id").toSeq

val crossScalaVersions212 = (14 to 19).map("2.12." + _)
val crossScalaVersions213 = (8 to 13).map("2.13." + _)
val crossScalaVersions3 =
(2 to 3).map("3.1." + _) ++
(0 to 2).map("3.2." + _) ++
(0 to 2).map("3.3." + _) ++
(0 to 3).map("3.3." + _) ++
(0 to 0).map("3.4." + _)

val scala2_12 = crossScalaVersions212.last
Expand Down Expand Up @@ -37,12 +37,15 @@ def scalaStdlibForBinaryVersion(
def artifact(module: String, binV: String, version: String = nativeVersion) =
organization % s"${module}_native${nativeBinaryVersion}_$binV" % version

def crossScalaLibVersion(scalaVersion: String) =
s"$scalaVersion+$nativeVersion"
def scalalibVersion(scalaBinVersion: String): String = {
val scalaVersion = scalaReleasesForBinaryVersion(scalaBinVersion).last
s"$scalaVersion+$nativeVersion"
crossScalaLibVersion(scalaVersion)
}
def scalalib(binV: String) = artifact("scalalib", binV, scalalibVersion(binV))
val scala3lib = artifact("scala3lib", "3", scalalibVersion("3"))
val scala3lib =
artifact("scala3lib", "3", crossScalaLibVersion(scala3PublishVersion))
val crossRuntimeLibraries = List(
"nativelib",
"clib",
Expand Down Expand Up @@ -94,8 +97,8 @@ inThisBuild(
Some("scm:git:[email protected]:scala-native/scala-native-cli.git")
)
),
// Used during the releases
resolvers ++= StagingRepoIds.flatMap(id => Resolver.sonatypeOssRepos(s"orgscala-native-$id")),
// Used during the releases
resolvers ++= StagingRepoNames.flatMap(Resolver.sonatypeOssRepos(_)),
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
resolvers += Resolver.mavenCentral,
resolvers += Resolver.defaultLocal
Expand Down Expand Up @@ -149,7 +152,9 @@ lazy val cliScriptedTests = project
"-Dplugin.version=" + (cli / scalaNativeVersion).value,
"-Dscala.version=" + (cli / scalaVersion).value,
"-Dscala-native-cli=" + cliPath,
"-Dscala-native-cli-pack=" + packDir
"-Dscala-native-cli-pack=" + packDir,
"-Dscalanative.build.staging.resolvers=" + StagingRepoNames
.mkString(",")
)
},
scriptedBufferLog := false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ case class NativeConfigOptions(
dump: Boolean = false,
noOptimize: Boolean = false,
embedResources: Boolean = false,
multithreadingSupport: Boolean = true,
multithreading: Option[Boolean] = None,
incrementalCompilation: Boolean = false,
baseName: Option[String] = None,
ltp: List[String] = List.empty,
Expand Down Expand Up @@ -116,7 +116,7 @@ object NativeConfigOptions {
.abbr("-mt")
.optional()
.action((x, c) =>
c.copy(nativeConfig = c.nativeConfig.copy(multithreadingSupport = x))
c.copy(nativeConfig = c.nativeConfig.copy(multithreading = Some(x)))
)
.text(
"Should the target enable multihreading support for builds? [true]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object ConfigConverter {
.withIncrementalCompilation(options.nativeConfig.incrementalCompilation)
.withOptimizerConfig(generateOptimizerConfig(options.optimizerConifg))
.withBaseName(baseName)
.withMultithreadingSupport(options.nativeConfig.multithreadingSupport)
.withMultithreading(options.nativeConfig.multithreading)
.withSemanticsConfig(generateSemanticsConfig(options.semanticsConfig))
.withSourceLevelDebuggingConfig(
generateSourceLevelDebuggingConfig(options.sourceLevelDebuggingConfig)
Expand Down
5 changes: 5 additions & 0 deletions cli/src/sbt-test/integration/cli/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
resolvers ++= sys.props
.get("scalanative.build.staging.resolvers")
.toList
.flatMap(_.split(","))
.flatMap(Resolver.sonatypeOssRepos(_))
enablePlugins(ScalaNativePlugin)

import sbt._
Expand Down
5 changes: 5 additions & 0 deletions cli/src/sbt-test/integration/cli/project/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ if (pluginVersion == null)
else {
addSbtPlugin("org.scala-native" % "sbt-scala-native" % pluginVersion)
}
resolvers ++= sys.props
.get("scalanative.build.staging.resolvers")
.toList
.flatMap(_.split(","))
.flatMap(Resolver.sonatypeOssRepos(_))
5 changes: 5 additions & 0 deletions cli/src/sbt-test/integration/standalone/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ scalaVersion := {
)
else scalaVersion
}
resolvers ++= sys.props
.get("scalanative.build.staging.resolvers")
.toList
.flatMap(_.split(","))
.flatMap(Resolver.sonatypeOssRepos(_))

runScript := {
val scriptName +: rawArgs = spaceDelimited("<arg>").parsed.toSeq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ class ConfigConverterTest extends AnyFlatSpec {
classpath = dummyArguments.toList,
config = dummyConfigOptions,
nativeConfig = NativeConfigOptions(
multithreadingSupport = true,
multithreading = Some(true),
incrementalCompilation = true
)
)
val optionsNegative = LinkerOptions(
classpath = dummyArguments.toList,
config = dummyConfigOptions,
nativeConfig = NativeConfigOptions(
multithreadingSupport = false,
multithreading = Some(false),
incrementalCompilation = false
)
)
Expand All @@ -229,7 +229,7 @@ class ConfigConverterTest extends AnyFlatSpec {
parsed.fold(
fail(_),
{ case (positive, negative) =>
assert(positive.multithreadingSupport != negative.multithreadingSupport)
assert(positive.multithreading != negative.multithreading)
assert(
positive.useIncrementalCompilation != negative.useIncrementalCompilation
)
Expand Down

0 comments on commit 08c3aa3

Please sign in to comment.