Skip to content

rename hardhat-solx to hardhat-slang-solx - #8491

Open
kanej wants to merge 5 commits into
mainfrom
rename-hardhat-solx-to-hardhat-slang-solx
Open

rename hardhat-solx to hardhat-slang-solx#8491
kanej wants to merge 5 commits into
mainfrom
rename-hardhat-solx-to-hardhat-slang-solx

Conversation

@kanej

@kanej kanej commented Aug 6, 2026

Copy link
Copy Markdown
Member

The solx compiler backend is part of the broader slang compiler effort, we are renaming the plugin to reflect that reality.

The hardhat-solx plugin becomes hardhat-slang-solx.

In addition to variable, interface and other code level renames, the following user facing changes have been made:

  1. Compiler type discriminator (type: "solx"type: "slang-solx")
  2. Build profile name (the plugin's config validation requires a profile named the same as the type)
  3. Error category (HARDHAT_SOLXHARDHAT_SLANG_SOLX) which is safe as the plugin keeps the same category range
  4. the top-level config namespace (HardhatUserConfig.solx.slangSolx)
solidity: {
  profiles: {
    "slang-solx": { // <-- note the need for explicit string quoting
      type: "slang-solx",
      version: "0.8.34"
    }
  }
}

Not renamed

The compiler itself is still, for the moment, called solx — its name, its error message text, its debug-info constants have not been touched. We can migrate these when solx itself is renamed or optionally update this PR.

Review

Tip

Review a commit at a time

The commits initially do file level renames, then code level changes (e.g. interfaces and constants), finally config entries and key values.

Manual testing

Set up packages/example-project to compile and test under the renamed plugin:

cd packages/example-project
pnpm add -D @nomicfoundation/hardhat-slang-solx@workspace:^

Add to hardhat.config.ts:

import hardhatSlangSolx from "@nomicfoundation/hardhat-slang-solx";


export default defineConfig({
  // ...

  // Update plugins
  plugins: [..., hardhatSlangSolx]

  // Update profiles
  profiles: {
    // ...
    "slang-solx": {
      compilers: [
        { version: "0.8.22" },
        { version: "0.7.1" },
        { version: "0.8.26" },
        { version: "0.8.33" },
      ],
      overrides: {
        "contracts/Rocket.sol": { type: "slang-solx", version: "0.8.34" },
        "contracts/FailingContract.sol": {
          type: "slang-solx",
          version: "0.8.34",
        },
      },
    },
  }
});

Then:

pnpm hardhat build contracts/Counter.sol --build-profile slang-solx
# Compiled 1 Solidity file with slang-solx 0.1.7 (Solidity 0.8.34) (evm target: osaka)

pnpm hardhat test mocha --build-profile slang-solx

kanej added 4 commits August 6, 2026 12:40
We rename the package directory, npm package name, and plugin `id`
from `hardhat-solx` to `hardhat-slang-solx`, along with the
plugin-level identifiers that follow the package's own name: the
debug namespaces (`hardhat:solx:*` -> `hardhat:slang-solx:*`),
describe-block titles, and fixture project names.

The compiler is still called solx, so we leave every reference to the
solx compiler itself untouched: the type discriminator, the build
profile name, and the error messages that name it.
…low the plugin name

We rename the constants and variables whose names follow the plugin
rather than the compiler: the exported interface names
(`SolxSolidityCompilerUserConfig`, `SolxSolidityCompilerConfig`,
`SolxSingleVersionSolidityUserConfig`, `SolxUserConfig`,
`SolxConfig`), the internal `SOLX_COMPILER_TYPE` constant, the
`SolxCompiler` class (now `SlangSolxCompiler`), the
`addSolxDebugInfoSelectors` function (now
`addSlangSolxDebugInfoSelectors`), and the `solx-compiler.ts` module
and its test.

We leave the underlying value changes, the `"solx"` type literal
itself, to a later commit.
…AT_SLANG_SOLX

We rename the `HARDHAT_SOLX` error category to `HARDHAT_SLANG_SOLX`,
along with its `pluginId` and `websiteTitle`. hardhat-slang-solx has
never been released, so there is no published error-code contract to
preserve the way `HHE27` needed one.

The numeric range (110000-119999) and every descriptor's number are
untouched, and the error messages themselves keep naming the solx
compiler.

This is a safe move, the solx plugin has never been released, so
as long as the category range remains the same, other errors
are unaffected.
…ator to slang-solx

`type: "solx"` becomes `type: "slang-solx"` everywhere it's keyed
(`SolidityCompilerTypeDefinitions` and the three `PerType`
interfaces), along with the pieces that have to track it: the
required build profile name, the top-level `HardhatUserConfig.solx` /
`HardhatConfig.solx` namespace (now `slangSolx`), and
`dangerouslyAllowSolxInProduction` (now
`dangerouslyAllowSlangSolxInProduction`).
Copilot AI review requested due to automatic review settings August 6, 2026 12:46
@kanej kanej added no changeset needed This PR doesn't require a changeset no docs needed This PR doesn't require links to documentation no peer bump needed labels Aug 6, 2026
@kanej
kanej requested review from marianfe and removed request for Copilot August 6, 2026 12:46
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 14e27d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

hardhat

Total size of the bundle: 238M
Total number of dependencies (including transitive): 44

List of dependencies (sorted by size)
229M	total
35M	@nomicfoundation/edr-linux-x64-musl
35M	@nomicfoundation/edr-linux-x64-gnu
31M	@nomicfoundation/edr-linux-arm64-musl
31M	@nomicfoundation/edr-linux-arm64-gnu
26M	@nomicfoundation/edr-darwin-x64
24M	@nomicfoundation/edr-win32-x64-msvc
21M	@nomicfoundation/edr-darwin-arm64
7.3M	@sentry/core
5.2M	zod
2.7M	micro-eth-signer
1.9M	@noble/curves
1.7M	undici
1.3M	@nomicfoundation/hardhat-utils
1.2M	@noble/hashes
884K	@nomicfoundation/hardhat-vendored
864K	@streamparser/json
688K	tsx
644K	@nomicfoundation/hardhat-errors
624K	micro-packed
492K	@scure/bip39
408K	json-stream-stringify
368K	ethereum-cryptography
332K	@streamparser/json-node
320K	enquirer
320K	@nomicfoundation/hardhat-zod-utils
308K	fast-equals
292K	semver
204K	ws
204K	adm-zip
168K	esbuild
168K	@scure/base
144K	@nomicfoundation/edr
100K	chokidar
96K	@scure/bip32
72K	@nomicfoundation/solidity-analyzer
56K	rfdc
48K	ansi-colors
44K	resolve.exports
36K	readdirp
36K	p-map
24K	strip-ansi
24K	is-safe-filename
24K	env-paths
24K	ansi-regex

compilation-job.ts embeds a plugin's compiler type verbatim in the
build-info id (`solc-${version}-${compilerType}-${jobHash}`), but
BUILD_INFO_FORMAT in edr-artifacts.ts only accepted
`[a-zA-Z][a-zA-Z0-9]*` for that segment. A hyphenated type like
`slang-solx` failed to match, so getBuildInfosAndOutputs silently
dropped the build info, and buildEdrArtifactsWithMetadata's
solcVersion lookup came up empty -- surfacing as:

  Error HHE100: An internal invariant was violated: solcVersion
  should not be undefined for artifact: 'CounterTest' in
  'test/contracts/Counter.t.sol'

We widen the compilerType character class to
`[a-zA-Z][a-zA-Z0-9-]*`, matching what compilation-job.ts already
writes. Verified against the example project: `hardhat test solidity
--build-profile slang-solx` now passes instead of throwing HHE100.

This isn't specific to hardhat-slang-solx -- any compiler type with a
hyphen in its name hit this. It surfaced now because renaming solx's
discriminator to "slang-solx" was the first hyphenated compiler type
to exist.
Copilot AI review requested due to automatic review settings August 6, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames the hardhat-solx plugin to hardhat-slang-solx across the Hardhat monorepo, updating the compiler type discriminator, config namespace, error category, CI wiring, and tests/fixtures to match the new plugin identity.

Changes:

  • Renamed the plugin package, plugin id/npm package metadata, and user-facing configuration from solx/"solx" to slangSolx/"slang-solx".
  • Updated Hardhat core and tests to handle hyphenated compiler types in build-info IDs.
  • Migrated error category naming and updated CI path filters and release/publish helper scripts.

Reviewed changes

Copilot reviewed 31 out of 43 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/verdaccio/publish.ts Updates excluded package list to the new plugin folder name.
scripts/lib/packages.ts Excludes the renamed plugin folder from releasable packages enumeration.
pnpm-lock.yaml Updates the workspace importer path to packages/hardhat-slang-solx.
packages/hardhat/test/internal/builtin-plugins/solidity-test/edr-artifacts.ts Adds a test ensuring build-info IDs with hyphenated compiler types match.
packages/hardhat/src/internal/builtin-plugins/solidity/type-extensions.ts Updates inline examples/docs to reference slang-solx.
packages/hardhat/src/internal/builtin-plugins/solidity/build-system/build-system.ts Updates log-comment examples for the renamed compiler type.
packages/hardhat/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts Relaxes build-info regex to allow - in compiler type.
packages/hardhat-solx/src/type-extensions.ts Removes old plugin type extensions (file deleted as part of rename).
packages/hardhat-slang-solx/tsconfig.json Adds TS project config for the renamed package.
packages/hardhat-slang-solx/test/slang-solx-compiler.ts Renames compiler class/tests to SlangSolxCompiler and updates imports.
packages/hardhat-slang-solx/test/platform.ts Updates package naming in platform detection tests.
packages/hardhat-slang-solx/test/output-augmentation.ts Updates build profile naming used by integration-style tests.
packages/hardhat-slang-solx/test/optimizer-mode.ts Updates build profile naming in optimizer propagation tests.
packages/hardhat-slang-solx/test/mirror-availability.ts Adds opt-in mirror availability test under the renamed package.
packages/hardhat-slang-solx/test/integration.ts Updates config namespace/profile/type expectations to slangSolx/slang-solx.
packages/hardhat-slang-solx/test/hook-handlers/solidity.ts Updates hook handler tests for new compiler type and error category.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/package.json Renames fixture package name to match new plugin.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/hardhat.config.ts Updates fixture to use slang-solx profile/type and plugin import naming.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/contracts/InlineAsm.sol Adds/relocates fixture contract for debug-info coverage.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/contracts/Counter.sol Adds/relocates fixture contract for debug-info coverage.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/contracts/ConstructorRevert.sol Adds/relocates fixture contract for debug-info coverage.
packages/hardhat-slang-solx/test/fixture-projects/with-debug-info/.gitignore Adds fixture build output ignores.
packages/hardhat-slang-solx/test/fixture-projects/simple/package.json Renames simple fixture package name to match new plugin.
packages/hardhat-slang-solx/test/fixture-projects/simple/hardhat.config.ts Updates simple fixture to use slang-solx profile/type and plugin import naming.
packages/hardhat-slang-solx/test/fixture-projects/simple/contracts/Greeter.sol Adds/relocates simple fixture contract.
packages/hardhat-slang-solx/test/config.ts Updates config validation/resolution tests for new namespace/type/profile.
packages/hardhat-slang-solx/src/type-extensions.ts Reintroduces type extensions under the renamed compiler type and config namespace.
packages/hardhat-slang-solx/src/internal/slang-solx-compiler.ts Renames compiler class and debug-info augmentation helper.
packages/hardhat-slang-solx/src/internal/platform.ts Switches errors to the new error category.
packages/hardhat-slang-solx/src/internal/hook-handlers/solidity.ts Updates hook logic for new compiler type constant, class name, and debug namespace.
packages/hardhat-slang-solx/src/internal/hook-handlers/config.ts Updates config hooks for new namespace/type/profile and error messaging.
packages/hardhat-slang-solx/src/internal/downloader.ts Updates debug namespace and error category for download failures.
packages/hardhat-slang-solx/src/internal/constants.ts Renames the compiler type constant to SLANG_SOLX_COMPILER_TYPE.
packages/hardhat-slang-solx/src/index.ts Updates plugin id and npm package name, and default export naming.
packages/hardhat-slang-solx/README.md Updates installation/configuration docs for hardhat-slang-solx and slang-solx.
packages/hardhat-slang-solx/package.json Renames package metadata and repository paths for the new package name.
packages/hardhat-slang-solx/LICENSE Adds license file under the renamed package.
packages/hardhat-slang-solx/eslint.config.js Adds eslint config passthrough for the renamed package.
packages/hardhat-slang-solx/.prettierignore Adds prettier ignore rules for dist/fixtures artifacts in the renamed package.
packages/hardhat-slang-solx/.gitignore Adds gitignore rules for the renamed package.
packages/hardhat-errors/src/descriptors.ts Renames the error category to HARDHAT_SLANG_SOLX and updates plugin metadata.
.github/workflows/ci.yml Updates path filters and working directory for the mirror-availability job.
.changeset/config.json Updates changeset ignore list to the new package name.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (2)

packages/hardhat-slang-solx/src/internal/downloader.ts:19

  • The debug namespace changed to hardhat:slang-solx:*, but packages/hardhat-utils/test/debug.ts still lists the old hardhat:solx:* namespaces (e.g. lines 342-344). This will likely break the selectColor distribution test unless the namespace list is updated to the new names.
    packages/hardhat-slang-solx/src/internal/hook-handlers/config.ts:321
  • resolveSolxConfig returns SlangSolxConfig and is only used to populate slangSolx, so the function name no longer matches what it actually resolves. Renaming it (and its call site) to resolveSlangSolxConfig would avoid confusion during future maintenance.


export const BUILD_INFO_FORMAT: RegExp =
/^solc-(?<major>\d+)_(?<minor>\d+)_(?<patch>\d+)(?:-(?<compilerType>[a-zA-Z][a-zA-Z0-9]*))?-[0-9a-fA-F]*$/;
/^solc-(?<major>\d+)_(?<minor>\d+)_(?<patch>\d+)(?:-(?<compilerType>[a-zA-Z][a-zA-Z0-9-]*))?-[0-9a-fA-F]*$/;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to have a compiler type with a hyphen, so slang-solx, so the build info can be solc-0_8_34-slang-solx-abc123.

But it depends on us keeping this structure: solc-${version}-${compilerType}-${jobHash}. I can see this being a hostage to fortune if we are forced to make a change and need fallback code for the slang-solx users.

Alternatives would be replacing - with another character like _, when writing to file.

},
},
HARDHAT_SOLX: {
HARDHAT_SLANG_SOLX: {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is safe. We have not released the plugin, so as long as the range remains the same, we won't affect other error descriptions.

export interface SolidityCompilerTypeDefinitions {
solx: true;
// eslint-disable-next-line @typescript-eslint/naming-convention -- the compiler type discriminator is kebab-case to match the plugin name
"slang-solx": true;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hyphen here has an unexpected knock on because the compiler type forms part of the file name of artifact outputs.

export interface SolidityCompilerUserConfigPerType {
solx: SlangSolxSolidityCompilerUserConfig;
// eslint-disable-next-line @typescript-eslint/naming-convention -- the compiler type discriminator is kebab-case to match the plugin name
"slang-solx": SlangSolxSolidityCompilerUserConfig;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a usability question. The property in hardhat config will be "slang-solx" requiring escaping as a string to support the -. On the whole we would try and avoid that in config properties in JS/TS.

@kanej

kanej commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

The hardhat-node-test-reporter fail is likely a Node 26 change that is affecting our output. We should tackle that separately to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changeset needed This PR doesn't require a changeset no docs needed This PR doesn't require links to documentation no peer bump needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants