Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
daf975f4
Unverified
Commit
daf975f4
authored
May 04, 2021
by
ben-chain
Committed by
GitHub
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(hh-ovm): Working builds for M1 macs (#751)
* fix(hh-ovm): hack RUN_SOLCJS back to RUN_SOLC * chore: add changeset
parent
90cd0b24
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
quiet-cherries-wave.md
.changeset/quiet-cherries-wave.md
+5
-0
index.ts
packages/hardhat-ovm/src/index.ts
+29
-0
No files found.
.changeset/quiet-cherries-wave.md
0 → 100644
View file @
daf975f4
---
"
@eth-optimism/hardhat-ovm"
:
patch
---
fix(hh-ovm): Working compilation for M1 macs
packages/hardhat-ovm/src/index.ts
View file @
daf975f4
...
@@ -104,6 +104,34 @@ const getOvmSolcPath = async (version: string): Promise<string> => {
...
@@ -104,6 +104,34 @@ const getOvmSolcPath = async (version: string): Promise<string> => {
return
cachedCompilerPath
return
cachedCompilerPath
}
}
// TODO: implement a more elegant fix for this.
// Hardhat on M1 Macbooks does not run TASK_COMPILE_SOLIDITY_RUN_SOLC, but instead this runs one,
// TASK_COMPILE_SOLIDITY_RUN_SOLCJS. We reroute this task back to the solc task in the case
// of OVM compilation.
subtask
(
TASK_COMPILE_SOLIDITY_RUN_SOLCJS
,
async
(
args
,
hre
,
runSuper
)
=>
{
const
argsAny
=
args
as
any
if
(
argsAny
.
real
||
hre
.
network
.
ovm
!==
true
)
{
for
(
const
file
of
Object
.
keys
(
argsAny
.
input
.
sources
))
{
// Ignore any contract that has this tag or in ignore list
if
(
argsAny
.
input
.
sources
[
file
].
content
.
includes
(
'
// @unsupported: evm
'
)
&&
hre
.
network
.
ovm
!==
true
)
{
delete
argsAny
.
input
.
sources
[
file
]
}
}
return
runSuper
(
args
)
}
else
{
return
hre
.
run
(
TASK_COMPILE_SOLIDITY_RUN_SOLC
,
{
...
argsAny
,
solcPath
:
argsAny
.
solcJsPath
})
}
}
)
subtask
(
subtask
(
TASK_COMPILE_SOLIDITY_RUN_SOLC
,
TASK_COMPILE_SOLIDITY_RUN_SOLC
,
async
(
args
:
{
input
:
any
;
solcPath
:
string
},
hre
,
runSuper
)
=>
{
async
(
args
:
{
input
:
any
;
solcPath
:
string
},
hre
,
runSuper
)
=>
{
...
@@ -167,6 +195,7 @@ subtask(
...
@@ -167,6 +195,7 @@ subtask(
const
ovmOutput
=
await
hre
.
run
(
TASK_COMPILE_SOLIDITY_RUN_SOLCJS
,
{
const
ovmOutput
=
await
hre
.
run
(
TASK_COMPILE_SOLIDITY_RUN_SOLCJS
,
{
input
:
ovmInput
,
input
:
ovmInput
,
solcJsPath
:
ovmSolcPath
,
solcJsPath
:
ovmSolcPath
,
real
:
true
})
})
// Just doing this to add some extra useful information to any errors in the OVM compiler output.
// Just doing this to add some extra useful information to any errors in the OVM compiler output.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment