Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6ebb2ef
chore: Update Windows CI runners from windows-2019 to windows-2022
fabiomadge Jul 1, 2025
1401b68
chore: Remove unnecessary news entry
fabiomadge Jul 1, 2025
c176d72
chore: Update package.py to use windows-2022
fabiomadge Jul 1, 2025
a30e6f1
Apply suggestions from code review
fabiomadge Jul 1, 2025
ec3361c
Merge branch 'master' into chore/fix-windows-ci-targets
keyboardDrummer Jul 2, 2025
db44e2a
bump solver builds
fabiomadge Jul 2, 2025
4926db3
bump z3
fabiomadge Jul 2, 2025
ef9c746
fix urls
fabiomadge Jul 3, 2025
993caf7
Fixes windows targets
MikaelMayer Jul 3, 2025
3d07fc6
fix crash
fabiomadge Jul 3, 2025
2e96eb1
Debug code to investigate why it's not working.
MikaelMayer Jul 3, 2025
51b236f
Merge branch 'chore/fix-windows-ci-targets' of https://github.com/daf…
MikaelMayer Jul 3, 2025
cd39aed
Ensured test passes on Windows
MikaelMayer Jul 3, 2025
96ad34b
Merge branch 'master' into chore/fix-windows-ci-targets
fabiomadge Jul 4, 2025
80c6365
Merge branch 'master' into chore/fix-windows-ci-targets
fabiomadge Jul 4, 2025
5e668c0
Revert "Debug code to investigate why it's not working."
MikaelMayer Jul 7, 2025
5e5236b
Merge branch 'chore/fix-windows-ci-targets' of https://github.com/daf…
MikaelMayer Jul 7, 2025
472b222
Fix a crash on Windows and vscode-ide
MikaelMayer Jul 7, 2025
33352e9
Merge branch 'master' into chore/fix-windows-ci-targets
MikaelMayer Jul 7, 2025
82644b3
Trigger Build
fabiomadge Jul 8, 2025
bb68e36
Merge branch 'master' into chore/fix-windows-ci-targets
MikaelMayer Jul 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-downloads-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

env:
dotnet-version: 8.0.x # SDK Version for running Dafny (TODO: should this be an older version?)
z3BaseUri: https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02
z3BaseUri: https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
## Record versions, checking that dafny runs
- name: Versions
run: |
dafny/z3/bin/z3-4.8.5 -version
dafny/z3/bin/z3-4.12.1 -version
dafny/z3/bin/z3-4.14.1 -version
dafny/dafny -version

## Check that a simple program compiles and runs on each supported platform
Expand Down
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,34 @@ refman-release: exe

z3-mac:
mkdir -p "${DIR}"/Binaries/z3/bin
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.12.1-x64-macos-11-bin.zip
unzip z3-4.12.1-x64-macos-11-bin.zip
rm z3-4.12.1-x64-macos-11-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.8.5-x64-macos-11-bin.zip
unzip z3-4.8.5-x64-macos-11-bin.zip
rm z3-4.8.5-x64-macos-11-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.14.1-x64-macos-13-bin.zip
unzip z3-4.14.1-x64-macos-13-bin.zip
rm z3-4.14.1-x64-macos-13-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.12.1-x64-macos-13-bin.zip
unzip z3-4.12.1-x64-macos-13-bin.zip
rm z3-4.12.1-x64-macos-13-bin.zip
mv z3-* "${DIR}"/Binaries/z3/bin/
chmod +x "${DIR}"/Binaries/z3/bin/z3-*

z3-mac-arm:
mkdir -p "${DIR}"/Binaries/z3/bin
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.12.1-arm64-macos-11-bin.zip
unzip z3-4.12.1-arm64-macos-11-bin.zip
rm z3-4.12.1-arm64-macos-11-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.8.5-x64-macos-11-bin.zip
unzip z3-4.8.5-x64-macos-11-bin.zip
rm z3-4.8.5-x64-macos-11-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.14.1-arm64-macos-13-bin.zip
unzip z3-4.14.1-arm64-macos-13-bin.zip
rm z3-4.14.1-arm64-macos-13-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.12.1-arm64-macos-13-bin.zip
unzip z3-4.12.1-arm64-macos-13-bin.zip
rm z3-4.12.1-arm64-macos-13-bin.zip
mv z3-* "${DIR}"/Binaries/z3/bin/
chmod +x "${DIR}"/Binaries/z3/bin/z3-*

z3-ubuntu:
mkdir -p "${DIR}"/Binaries/z3/bin
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.12.1-x64-ubuntu-20.04-bin.zip
unzip z3-4.12.1-x64-ubuntu-20.04-bin.zip
rm z3-4.12.1-x64-ubuntu-20.04-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02/z3-4.8.5-x64-ubuntu-20.04-bin.zip
unzip z3-4.8.5-x64-ubuntu-20.04-bin.zip
rm z3-4.8.5-x64-ubuntu-20.04-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.14.1-x64-ubuntu-22.04-bin.zip
unzip z3-4.14.1-x64-ubuntu-22.04-bin.zip
rm z3-4.14.1-x64-ubuntu-22.04-bin.zip
wget https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02/z3-4.12.1-x64-ubuntu-22.04-bin.zip
unzip z3-4.12.1-x64-ubuntu-22.04-bin.zip
rm z3-4.12.1-x64-ubuntu-22.04-bin.zip
mv z3-* "${DIR}"/Binaries/z3/bin/
chmod +x "${DIR}"/Binaries/z3/bin/z3-*

Expand Down
10 changes: 5 additions & 5 deletions Scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

# Configuration

Z3_VERSIONS = [ "4.8.5", "4.12.1" ]
Z3_URL_BASE = "https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2023-08-02"
Z3_VERSIONS = [ "4.12.1", "4.14.1" ]
Z3_URL_BASE = "https://github.com/dafny-lang/solver-builds/releases/download/snapshot-2025-07-02"

## How many times we allow ourselves to try to download Z3
Z3_MAX_DOWNLOAD_ATTEMPTS = 5
Expand Down Expand Up @@ -287,9 +287,9 @@ def main():

# Z3
flush("* Downloading Z3 releases")
releases = [ Release("macos-11", "x64", args.version, args.out),
Release("macos-11", "arm64", args.version, args.out),
Release("ubuntu-20.04", "x64", args.version, args.out),
releases = [ Release("macos-13", "x64", args.version, args.out),
Release("macos-13", "arm64", args.version, args.out),
Release("ubuntu-22.04", "x64", args.version, args.out),
Release("windows-2022", "x64", args.version, args.out) ]
if args.os:
releases = list(filter(lambda release: release.os_name == args.os, releases))
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/AST/Grammar/ProgramParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected virtual DfyParseFileResult ParseFile(DafnyOptions options, FileSnapsho
filesContainer.Files.SelectMany(f => f.TopLevelDecls));

return new DfyParseFileResult(null, uri,
filesContainer.Files.Where(f => !f.IsLibrary).Select(f => new Uri(f.Uri)).ToList(),
filesContainer.Files.Where(f => !f.IsLibrary).Select(f => DafnyFile.CreateCrossPlatformUri(f.Uri)).ToList(),
new BatchErrorReporter(options), filesModule, syntaxDeserializer.SystemModuleModifiers);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/AST/SyntaxDeserializer/HandWritten.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public FilesContainer ReadFilesContainer() {
public FileHeader ReadFileStart() {
var uri = ReadString();
var isLibrary = ReadBool();
this.uri = new Uri(uri);
this.uri = DafnyFile.CreateCrossPlatformUri(uri);
var topLevelDecls = ReadList(ReadAbstract<TopLevelDecl>);
return new FileHeader(uri, isLibrary, topLevelDecls);
}
Expand Down
4 changes: 4 additions & 0 deletions Source/DafnyCore/AST/Tokens.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public static string ToFileRangeString(this TokenRange? range, DafnyOptions opti
}

public static string GetRelativeFilename(DafnyOptions options, Token token) {
if (token.Uri == null) {
return token.Filepath ?? "unknown";
}

var currentDirectory = Directory.GetCurrentDirectory();
string filename = token.Uri.Scheme switch {
"stdin" => "<stdin>",
Expand Down
8 changes: 8 additions & 0 deletions Source/DafnyCore/DafnyFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using DafnyAssembly;
using DafnyCore;
Expand Down Expand Up @@ -320,4 +321,11 @@ public static List<string> FileNames(IReadOnlyList<DafnyFile> dafnyFiles) {
return null;
}

public static Uri CreateCrossPlatformUri(string path) {
// Only fixes Unix paths on Windows
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && path.StartsWith("/")) {
return new Uri("file://" + path);
}
return new Uri(path);
}
}
4 changes: 2 additions & 2 deletions Source/DafnyCore/JsonOutputWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Task Code(string message) {
private Task WriteMessage(string message, string type) {
return options.BaseOutputWriter.WriteLineAsync(new JsonObject() {
["type"] = type,
["value"] = message
["value"] = message.Replace("\r\n", "\n")
}.ToJsonString());
}

Expand Down Expand Up @@ -84,7 +84,7 @@ private static JsonObject SerializeToken(DafnyOptions options, TokenRange range)
return new JsonObject {
["filename"] = range.StartToken.filename,
["filePath"] = TokenExtensions.GetRelativeFilename(options, range.StartToken),
["uri"] = range.Uri!.AbsoluteUri,
["uri"] = range.Uri?.AbsoluteUri ?? "file:///unknown",
["range"] = SerializeRange(range)
};
}
Expand Down
9 changes: 8 additions & 1 deletion Source/DafnyCore/Options/ProjectFileOpener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ public ProjectFileOpener(IFileSystem fileSystem, IOrigin origin) {
}

protected virtual Task<DafnyProject?> OpenProjectInFolder(string folderPath) {
var configFileUri = new Uri(Path.Combine(folderPath, DafnyProject.FileName));
Uri configFileUri;
try {
configFileUri = new Uri(Path.Combine(folderPath, DafnyProject.FileName));
} catch (Exception) {
// On Windows systems, the URI "/Untitled-1" is not recognized for example
return Task.FromResult<DafnyProject?>(null);
}

if (!fileSystem.Exists(configFileUri)) {
return Task.FromResult<DafnyProject?>(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ solverRoots = os.pathsep.join(
print(solverRoots)

solverPath = \
lit.util.which("z3-4.8.5", solverRoots) or \
lit.util.which("z3-4.12.1", solverRoots) or \
lit.util.which("cvc4", solverRoots)

if not solverPath:
Expand Down
Loading