-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 auto-detect not working as expected #209
Comments
can you try running with Auto-detection is based on semver, and So solc will try to find a compatible, already downloaded, solc install It seems like that this doesn't necessarily hold for solc though |
@mattsse, thanks for the quick response. Here's the output:
|
Hmm... I guess it'll favor the solc used in the test(s)? |
yes, There are currently some limitations when it comes to dependency graphs, so if you could share the imports and pragma of |
Something tells me that |
Yes! If I specify diff --git a/src/Contract.sol b/src/Contract.sol
index c116a9e..3ee7dc0 100644
--- a/src/Contract.sol
+++ b/src/Contract.sol
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: Unlicense
-pragma solidity ^0.4.0;
+pragma solidity 0.4.0;
contract Counter {
uint public count;
// Function to get the current count
- function get() public returns (uint) {
+ function get() public view returns (uint) {
return count;
} It'd be nice if we could get the actual compiler error/output from
Expected output:
Actual output:
|
any chance you built with hardhat in the meantime? |
Sure. However, on the expected/actual solc output above, do you think I should open an issue? |
I think the root problem is, that solc not necessarily abide to semver rules. |
I think I finally got Expected output:
Actual output:
Ping me and I'll make an issue for it. Closing this one for now. |
ethers-solc uses a different artifact format by default, but the same cache format as hardhat, so this can happen, I think we should find a way around that
I think It's worth discussing if we want to follow always semver or if we need some additional checks, +1 |
Φοβερή δουλειά! Great job!
It looks like
forge
's solc auto-detect not working as expected(?)I just run
followed by
then
then replaced what's inside
src/Contract.sol
with the following (notice^0.4.0
)and then on purpose I declared
get()
asview
which I would expect to break with^0.4.0
run
and got
success.
instead of a compilation error (e.g. Remix gives an error sinceview
doesn't exist in^0.4.0
.Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: