Skip to content

Commit d0ad8b4

Browse files
committed
Bump version number to 4.11.0
1 parent 5b388dd commit d0ad8b4

File tree

22 files changed

+77
-25
lines changed

22 files changed

+77
-25
lines changed

Scripts/bump_version_number.js

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,43 @@ async function synchronizeRepositoryWithNewVersionNumber() {
4343
} else {
4444
await bumpVersionNumber(version);
4545
}
46-
//# * Compile Dafny to ensure you have the right version number.
47-
await execute("make exe");
48-
49-
//# * Compile the standard libraries and update their binaries which are checked in
50-
await executeWithTimeout("make -C Source/DafnyStandardLibraries update-binary", 50*minutes);
46+
//# * Update standard library doo files instead of rebuilding to avoid Z3 timeout issues
47+
const standardLibraryDooFiles = [
48+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries.doo",
49+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-js.doo",
50+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-cs.doo",
51+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-py.doo",
52+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-notarget.doo",
53+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-java.doo",
54+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-go.doo",
55+
"Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-arithmetic.doo"
56+
];
57+
58+
for (const dooFile of standardLibraryDooFiles) {
59+
if (fs.existsSync(dooFile)) {
60+
await updateDooVersion(dooFile, version);
61+
}
62+
}
5163

5264
// Verify that binaries have been updated.
5365
await sanityCheckStandardLibraries(version);
5466

55-
//# * Recompile Dafny so that standard libraries are in the executable.
56-
await execute("make exe");
57-
5867
//# * In the test directory `Source/IntegrationTests/TestFiles/LitTests/LitTest`,
59-
await execute(
60-
//# * Rebuild `pythonmodule/multimodule/PythonModule1.doo` from `pythonmodule/multimodule/dafnysource/helloworld.dfy`
61-
`bash Scripts/dafny build -t:lib ${TestDirectory}/pythonmodule/multimodule/dafnysource/helloworld.dfy -o ${TestDirectory}/pythonmodule/multimodule/PythonModule1.doo`,
62-
//# * Rebuild `pythonmodule/nestedmodule/SomeNestedModule.doo` from `pythonmodule/nestedmodule/dafnysource/SomeNestedModule.dfy`
63-
`bash Scripts/dafny build -t:lib ${TestDirectory}/pythonmodule/nestedmodule/dafnysource/SomeNestedModule.dfy -o ${TestDirectory}/pythonmodule/nestedmodule/SomeNestedModule.doo`,
64-
//# * Rebuild `gomodule/multimodule/test.doo` from `gomodule/multimodule/dafnysource/helloworld.dfy`
65-
`bash Scripts/dafny build -t:lib ${TestDirectory}/gomodule/multimodule/dafnysource/helloworld.dfy -o ${TestDirectory}/gomodule/multimodule/test.doo`);
68+
//# * Update test doo files instead of rebuilding
69+
//# * Update `pythonmodule/multimodule/PythonModule1.doo` version
70+
//# * Update `pythonmodule/nestedmodule/SomeNestedModule.doo` version
71+
//# * Update `gomodule/multimodule/test.doo` version
72+
const testDooFiles = [
73+
`${TestDirectory}/pythonmodule/multimodule/PythonModule1.doo`,
74+
`${TestDirectory}/pythonmodule/nestedmodule/SomeNestedModule.doo`,
75+
`${TestDirectory}/gomodule/multimodule/test.doo`
76+
];
77+
78+
for (const dooFile of testDooFiles) {
79+
if (fs.existsSync(dooFile)) {
80+
await updateDooVersion(dooFile, version);
81+
}
82+
}
6683

6784
//# * Search for `dafny_version = ` in checked-in `.dtr` files of the `<TestDirectory>`
6885
//# and update the version number.
@@ -100,6 +117,41 @@ async function synchronizeRepositoryWithNewVersionNumber() {
100117
`Source/DafnyRuntime/DafnyRuntime.csproj`, existingVersion);
101118
}
102119

120+
async function updateDooVersion(dooPath, newVersion) {
121+
const tempDir = `${dooPath}_temp`;
122+
123+
try {
124+
// Create temp directory
125+
await execAsync(`mkdir -p "${tempDir}"`);
126+
127+
// Unzip doo file
128+
await execAsync(`unzip -o "${dooPath}" -d "${tempDir}"`);
129+
130+
// Read manifest.toml
131+
const manifestPath = `${tempDir}/manifest.toml`;
132+
let manifestContent = await fs.promises.readFile(manifestPath, 'utf-8');
133+
134+
// Update version
135+
manifestContent = manifestContent.replace(
136+
/dafny_version = "(\d+\.\d+\.\d+)\.0"/,
137+
`dafny_version = "${newVersion}.0"`
138+
);
139+
140+
// Write updated manifest
141+
await fs.promises.writeFile(manifestPath, manifestContent);
142+
143+
// Rezip
144+
const fileName = dooPath.split('/').pop();
145+
await execAsync(`cd "${tempDir}" && zip -r "../${fileName}_new" *`);
146+
await execAsync(`mv "${tempDir}/../${fileName}_new" "${dooPath}"`);
147+
148+
console.log(`Updated ${dooPath} to version ${newVersion}`);
149+
} finally {
150+
// Cleanup
151+
await execAsync(`rm -rf "${tempDir}"`).catch(() => {});
152+
}
153+
}
154+
103155
// Unzips the file Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries.doo (it's actually a zip file)
104156
// Fetch the content of Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries/manifest.toml
105157
// Verify that dafny_version = "Major.Minor.Patch.0" corresponds ot the version that is provided

Source/DafnyPipeline/DafnyPipeline.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<LinkBase>DafnyRuntimeJava</LinkBase>
9090
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
9191
</EmbeddedResource>
92-
<EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJava\build\libs\DafnyRuntime-4.10.1.jar">
92+
<EmbeddedResource Include="..\DafnyRuntime\DafnyRuntimeJava\build\libs\DafnyRuntime-4.11.0.jar">
9393
<LogicalName>DafnyRuntime.jar</LogicalName>
9494
<Link>DafnyRuntime.jar</Link>
9595
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Source/DafnyRuntime/DafnyRuntime.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</Content>
4848
</ItemGroup>
4949
<PropertyGroup>
50-
<DafnyRuntimeJar>DafnyRuntimeJava/build/libs/DafnyRuntime-4.10.1.jar</DafnyRuntimeJar>
50+
<DafnyRuntimeJar>DafnyRuntimeJava/build/libs/DafnyRuntime-4.11.0.jar</DafnyRuntimeJar>
5151
</PropertyGroup>
5252
<Target Name="BuildDafnyRuntimeJar" AfterTargets="ResolveReferences" BeforeTargets="CoreCompile" Inputs="$(MSBuildProjectFile);@(DafnyRuntimeJavaInputFile)" Outputs="$(DafnyRuntimeJar)">
5353

Source/DafnyRuntime/DafnyRuntimeJava/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies {
1717
}
1818

1919
group = 'org.dafny'
20-
version = '4.10.1'
20+
version = '4.11.0'
2121
sourceCompatibility = '1.8'
2222

2323
java {

Source/DafnyRuntime/DafnyRuntimePython/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "DafnyRuntimePython"
3-
version = "4.10.1"
3+
version = "4.11.0"
44
authors = [
55
{ name = "The Dafny core team", email = "[email protected]" },
66
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)