Skip to content

Commit

Permalink
Changes the sat switch so it can be disabled (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed May 14, 2024
1 parent bcfa33a commit f8bd7b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/nimblepkg/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,13 @@ proc parseFlag*(flag, val: string, result: var Options, kind = cmdLongOption) =
result.developFile = val.normalizedPath
else:
raise nimbleError(multipleDevelopFileOptionsGivenMsg)
of "sat": result.useSatSolver = true
of "solver":
if val == "sat":
result.useSatSolver = true
elif val == "legacy":
result.useSatSolver = false
else:
raise nimbleError("Unknown solver option: " & val)
else: isGlobalFlag = false

var wasFlagHandled = true
Expand Down
2 changes: 1 addition & 1 deletion tests/tsat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ suite "SAT solver":
where c has two versions of the same package. The version is retrieved counterintuitively from
the nimblemeta.json special version field.
]#
let (_, exitCode) = execNimble("install", "-l", "--sat")
let (_, exitCode) = execNimble("install", "-l", "--solver:sat")
check exitCode == QuitSuccess

test "should be able to download a package and select its deps":
Expand Down

0 comments on commit f8bd7b5

Please sign in to comment.