Skip to content

Commit de2714b

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 1efd1ee commit de2714b

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
@@ -280,6 +280,11 @@ object Build {
280280

281281
val baseOptions = overrideOptions.orElse(sharedOptions)
282282

283+
val inputs0 = updateInputs(
284+
inputs,
285+
overrideOptions.orElse(options) // update hash in inputs with options coming from the CLI or cross-building, not from the sources
286+
)
287+
283288
val scopedSources = value(crossSources.scopedSources(baseOptions))
284289

285290
val mainSources =
@@ -290,12 +295,6 @@ object Build {
290295
value(scopedSources.sources(Scope.Test, baseOptions, inputs.workspace, logger))
291296
val testOptions = testSources.buildOptions
292297

293-
val inputs0 = updateInputs(
294-
inputs,
295-
mainOptions, // update hash in inputs with options coming from the CLI or cross-building, not from the sources
296-
Some(testOptions).filter(_ != mainOptions)
297-
)
298-
299298
def doBuildScope(
300299
options: BuildOptions,
301300
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)