Skip to content

Commit e2ab606

Browse files
committed
Revert adding options from sources to module hash as it's unnecessary and complicates the build process in compose mode.
1 parent 7a2c15e commit e2ab606

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

modules/build/src/main/scala/scala/build/Build.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ object Build {
275275

276276
val baseOptions = overrideOptions.orElse(sharedOptions)
277277

278+
val inputs0 = updateInputs(
279+
inputs,
280+
overrideOptions.orElse(options) // update hash in inputs with options coming from the CLI or cross-building, not from the sources
281+
)
282+
278283
val scopedSources = value(crossSources.scopedSources(baseOptions))
279284

280285
val mainSources =
@@ -285,12 +290,6 @@ object Build {
285290
value(scopedSources.sources(Scope.Test, baseOptions, inputs.workspace, logger))
286291
val testOptions = testSources.buildOptions
287292

288-
val inputs0 = updateInputs(
289-
inputs,
290-
mainOptions, // update hash in inputs with options coming from the CLI or cross-building, not from the sources
291-
Some(testOptions).filter(_ != mainOptions)
292-
)
293-
294293
def doBuildScope(
295294
options: BuildOptions,
296295
sources: Sources,

modules/integration/src/test/scala/scala/cli/integration/CompileTestDefinitions.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,7 @@ abstract class CompileTestDefinitions
183183

184184
test("no arg") {
185185
simpleInputs.fromRoot { root =>
186-
val projectFilePrefix = root.baseName + "_"
187186
os.proc(TestUtil.cli, "compile", extraOptions, ".").call(cwd = root)
188-
val projDirs = os.list(root / Constants.workspaceDirName)
189-
.filter(_.last.startsWith(projectFilePrefix))
190-
.filter(os.isDir(_))
191-
expect(projDirs.length == 1)
192-
val projDir = projDirs.head
193-
val projDirName = projDir.last
194-
val elems = projDirName.stripPrefix(projectFilePrefix).split("[-_]").toSeq
195-
expect(elems.length == 1)
196187
}
197188
}
198189

@@ -254,18 +245,6 @@ abstract class CompileTestDefinitions
254245
)
255246
expect(isDefinedTestPathInClassPath)
256247
checkIfCompileOutputIsCopied("Tests", tempOutput)
257-
258-
val projectFilePrefix = root.baseName + "_"
259-
260-
val projDirs = os.list(root / Constants.workspaceDirName)
261-
.filter(_.last.startsWith(projectFilePrefix))
262-
.filter(os.isDir(_))
263-
expect(projDirs.length == 1)
264-
val projDir = projDirs.head
265-
val projDirName = projDir.last
266-
val elems = projDirName.stripPrefix(projectFilePrefix).split("[-_]").toSeq
267-
expect(elems.length == 2)
268-
expect(elems.toSet.size == 2)
269248
}
270249
}
271250

0 commit comments

Comments
 (0)