Skip to content
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

having trouble installing custom solc #509

Closed
adrianmcli opened this issue Sep 17, 2020 · 13 comments
Closed

having trouble installing custom solc #509

adrianmcli opened this issue Sep 17, 2020 · 13 comments

Comments

@adrianmcli
Copy link

I'm trying to install solc v0.6.12, but keep running into issues (I'm on a Mac).

➜  contracts git:(master) nix-env -iA solc-versions.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
unpacking 'https://github.com/dapphub/dapptools/tarball/master'...
error: attribute 'solc_0_6_12' in selection path 'solc-versions.solc_0_6_12' not found

➜  contracts git:(master) nix-env -iA solc-versions.x86_64-linux.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'x86_64-linux' in selection path 'solc-versions.x86_64-linux.solc_0_6_12' not found

➜  contracts git:(master) nix-env -iA solc-versions.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'solc_0_6_12' in selection path 'solc-versions.solc_0_6_12' not found

➜  contracts git:(master) nix-env -iA solc-versions.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'solc_0_6_12' in selection path 'solc-versions.solc_0_6_12' not found

➜  contracts git:(master) nix-env -iA solc-versions.unreleased.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'unreleased' in selection path 'solc-versions.unreleased.solc_0_6_12' not found

➜  contracts git:(master) nix-env -iA solc-versions.unreleased_x86_64-linux .solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'unreleased_x86_64-linux' in selection path 'solc-versions.unreleased_x86_64-linux' not found

➜  contracts git:(master) nix-env -iA solc-versions.unreleased_x86_64-linux.solc_0_6_12 \
  -if https://github.com/dapphub/dapptools/tarball/master
error: attribute 'unreleased_x86_64-linux' in selection path 'solc-versions.unreleased_x86_64-linux.solc_0_6_12' not found

You can see the various commands I tried above. Not sure what I'm doing wrong, I'm just following what the README says.

@MrChico
Copy link
Member

MrChico commented Sep 17, 2020

You need to add -f /path/to/dapptools to the nix-env command. But unfortunately this won't work on macos with 0_6_12 anyway because we ran into some errors that we weren't able to get to the bottom of for OSX. It's available for linux, however. Currently the latest solc available for osx 0.6.8.

@d-xo
Copy link
Contributor

d-xo commented Sep 17, 2020

You need to add -f /path/to/dapptools to the nix-env command.

This is already included in the above commands, where /path/to/dapptools is the url to the dapptools repo

@MrChico
Copy link
Member

MrChico commented Sep 17, 2020

Oh, right, I missed the linebreak 😅

@adrianmcli
Copy link
Author

adrianmcli commented Sep 17, 2020

@MrChico @xwvvvvwx Thanks for the responses. So there's nothing I can do but to wait for 0.6.12 to be supported?

@MrChico
Copy link
Member

MrChico commented Sep 17, 2020

@adrianmcli you can use dapp with a custom solc path. So if you install 0.6.12 through other means you can do for example:
dapp --use /path/to/solc/bin build

@d-xo
Copy link
Contributor

d-xo commented Sep 17, 2020

@adrianmcli well if you're feeling motivated you could try and fix the 0.6.12 on osx. The nix deriviation in question is here.

Apart from that you can also pass a path to a 0.6.12 binary you have on your system with dapp --use /path/to/solc or DAPP_SOLC=/path/to/solc.

@d-xo
Copy link
Contributor

d-xo commented Sep 17, 2020

haha, nice timing @MrChico 😁

@adrianmcli
Copy link
Author

I followed this particular issue here: #312

I removed nix-env -e solc from the environment and also re-organized my $PATH. Now, when I run solc --version in the terminal, it gives me the correct Version: 0.6.12+commit.27d51765.Darwin.appleclang.

However, when I run dapp test, I still get the errors:

src/interfaces/controller.sol:3:1: Error: Source file requires different compiler version (current compiler is 0.5.15+commit.6a57276f.Darwin.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.6.0;

@adrianmcli
Copy link
Author

adrianmcli commented Sep 17, 2020

Even with this command:

DAPP_SOLC=/usr/local/bin/solc dapp test

I am still getting the same error. But if you run /usr/local/bin/solc --version, it prints out 0.6.12 as expected. Why is dapp so stubborn on using its own solc?

@MrChico
Copy link
Member

MrChico commented Sep 17, 2020

@adrianmcli are you on latest master? The custom solc path hasn't been included in a release yet, so you would need to build directly from master (nix-env -iA dapp -if https://github.com/dapphub/dapptools/tarball/master should do, but not curl https://dapp.tools/install | sh)

Why is dapp so stubborn on using its own solc?

Because we like predictable environments and to be able to quickly switch between solc versions :)

@adrianmcli
Copy link
Author

able to quickly switch between solc versions

This doesn't seem to be working so well right now.

nix-env -iA dapp -if https://github.com/dapphub/dapptools/tarball/master

What does this do? I run it in my terminal and nothing happens.

@MrChico
Copy link
Member

MrChico commented Sep 17, 2020

It installs the latest dapp

@MrChico
Copy link
Member

MrChico commented Sep 18, 2020

@adrianmcli closing this issue as it should be fixed by using a custom solc path. Reopen if there are still uncertainties

@MrChico MrChico closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants