Skip to content

Commit e5b6c3a

Browse files
committed
Sort the settings in the solidity compilation jobs
1 parent 2070d5d commit e5b6c3a

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

v-next/hardhat/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,26 @@ export class CompilationJobImplementation implements CompilationJob {
158158
};
159159
}
160160

161+
const resolvedSettings: CompilerInput["settings"] = {
162+
...settings,
163+
evmVersion:
164+
settings.evmVersion ??
165+
getEvmVersionFromSolcVersion(this.solcConfig.version),
166+
outputSelection: this.#dedupeAndSortOutputSelection(outputSelection),
167+
remappings: this.dependencyGraph.getAllRemappings(),
168+
};
169+
170+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions --
171+
We just sort the same object to make the builds more consistent */
172+
const sortedSettings = Object.fromEntries(
173+
Object.entries(resolvedSettings).sort(([keyA], [keyB]) =>
174+
keyA.localeCompare(keyB),
175+
),
176+
) as CompilerInput["settings"];
177+
161178
return {
162179
language: "Solidity",
163-
settings: {
164-
...settings,
165-
evmVersion:
166-
settings.evmVersion ??
167-
getEvmVersionFromSolcVersion(this.solcConfig.version),
168-
outputSelection: this.#dedupeAndSortOutputSelection(outputSelection),
169-
remappings: this.dependencyGraph.getAllRemappings(),
170-
},
180+
settings: sortedSettings,
171181
sources,
172182
};
173183
}

0 commit comments

Comments
 (0)