Skip to content

Commit ad41349

Browse files
committed
hardhat compile override task now also wants longVersion field
1 parent b660140 commit ad41349

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/ethereum-contracts/hardhat.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {config as dotenvConfig} from "dotenv";
1313
import {NetworkUserConfig} from "hardhat/types";
1414
import "solidity-docgen";
1515
import {relative} from "path";
16+
import {execSync} from 'child_process';
1617

1718
try {
1819
dotenvConfig();
@@ -28,14 +29,19 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD).setAction(
2829
async (args, hre, runSuper) => {
2930
console.log("subtask TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD");
3031
if (process.env.SOLC !== undefined) {
32+
const versionOutput = execSync(`${process.env.SOLC} --version`, { encoding: 'utf8' }).trim();
33+
const longVersion = versionOutput.match(/Version: (.+)/)?.[1] || `${args.solcVersion}+commit.unknown.Linux.g++`;
3134
console.log(
3235
"Using Solidity compiler set in SOLC:",
33-
process.env.SOLC
36+
process.env.SOLC,
37+
", longVersion:",
38+
longVersion
3439
);
3540
return {
3641
compilerPath: process.env.SOLC,
3742
isSolcJs: false, // false for native compiler
3843
version: args.solcVersion,
44+
longVersion,
3945
};
4046
} else {
4147
// fall back to the default

0 commit comments

Comments
 (0)