New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solc-select, crytic-compile, slither-analyzer, echidna: improve testing on ARM #127681
Conversation
# running solc itself requires an Intel system or Rosetta | ||
return if Hardware::CPU.arm? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like it won't be very useful for people to have this bottled on ARM then. I'd say it's better to mark it as x86.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SMillerDev! The software itself (solc-select
) is written in Python and can run fine on ARM. It's also a runtime dependency (imported python lib) for some of the other programs in this PR, which can be meaningfully used on an ARM Mac without Rosetta. My understanding is that marking solc-select
as x86 would mean none of the packages here get bottled, which would not be desirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SMillerDev Seems fine on me as-is given what @elopez has said.
It looks like the CI timed out, we may need a longer run for this PR 😅 |
93c8917
to
698ff17
Compare
d2d304a
to
6ed9a30
Compare
system "solc-select", "install", "0.8.0" | ||
with_env(SOLC_VERSION: "0.8.0") do | ||
system bin/"crytic-compile", testpath/"test.sol", "--export-format=solc", "--export-dir=#{testpath}/export" | ||
resource "testdata" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Homebrew/core is this a thing we're doing now? Not opposed, kinda in favour if it saves a non-test-time download, but just wanted to check it 1) works and 2) is desirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "this", do you mean resource
blocks inside test
blocks? IIRC there were a handful of examples of this a while back that we had to get rid of to enable formulae being frozen after instantiation.
Agreed that it would be good to do if it worked though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work, though, so I must be misremembering. Or maybe formulae freezing has changed since then. Probably the former. @Bo98?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "this", do you mean resource blocks inside test blocks?
@carlocab Yup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to add context, I opted to include this resource block inside the test block to avoid having virtualenv_install_with_resources
trying to install the test file as a python package.
# running solc itself requires an Intel system or Rosetta | ||
return if Hardware::CPU.arm? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SMillerDev Seems fine on me as-is given what @elopez has said.
Running solc itself requires an Intel system or Rosetta. Account for that fact in the brew test.
Running solc (through solc-select) requires an Intel system or Rosetta. Implement testing with a precompiled project instead, which should work on all platforms.
Running solc (through solc-select) requires an Intel system or Rosetta. Implement testing with a pre-compiled project instead, which should work across all platforms.
`solc` binaries (through `solc-select`) are only available for Intel platforms or through Rosetta. Switch `echidna` to test with a Truffle project instead, which can be built on all platforms.
6ed9a30
to
2aa150d
Compare
@MikeMcQuaid thanks for the review! Can you please tag this PR with the longer timeout CI tag? it seems it's very close to the default time limit and some of the jobs got cancelled. |
8ab7a62
to
2aa150d
Compare
🤖 A scheduled task has requested bottles to be published to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?Running solc (through solc-select) requires an Intel system or Rosetta. The tests therefore fail on non-Rosetta ARM Macs, which causes solc-select and dependents to not be bottled on ARM. To remediate this, account for this limitation in the solc-select test, and implement testing with a Truffle or prebuilt project on ARM instead on crytic-compile, echidna, and slither-analyzer, which can use the
solcjs
compiler if needed.