Coder Social home page Coder Social logo

solc-select's Introduction

solc-select

A tool to quickly switch between Solidity compiler versions.

The tool is split into two CLI utilities:

  • solc-select: manages installing and setting different solc compiler versions
  • solc: wrapper around solc which picks the right version according to what was set via solc-select

The solc binaries are downloaded from https://binaries.soliditylang.org/ which contains official artifacts for many historial and modern solc versions for Linux and macOS.

The versioned binaries are stored in ~/.solc-select/artifacts/.

Quickstart

pip3 install solc-select

To automatically install and use a version, run solc-select use <version> --always-install.

Running on ARM (Mac M1/M2)

solc requires Rosetta to be installed. See the FAQ on how to install Rosetta.

Usage

By default, solc-select will install the most recent available Solidity file for your version. This will automatically be done when you run solc for the first time.

solc 

The global version of solc will automatically be set to to the latest version. You can reset this with the solc-select use <version> command:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.5.2+commit.1df8f40c.Linux.g++
$ solc-select use 0.4.24
Switched global version to 0.4.24
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++

Use SOLC_VERSION environment variable to override the global version:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++
$ SOLC_VERSION=0.5.2 solc --version
solc, the solidity compiler commandline interface
Version: 0.5.2+commit.1df8f40c.Linux.g++

By default, solc-select will halt if you try to use a version that you do not have installed already. Use the --always-install flags to bypass this.

solc-select use 0.8.1 --always-install
Installing '0.8.1'...
Version '0.8.1' installed.

You can list all available versions with solc-select install:

$ solc-select install
Available versions to install:
0.3.6
0.4.0
...
0.8.0
0.8.1

Getting Help

Feel free to stop by our Slack channel for help on using or extending solc-select.

FAQ

OSError: [Errno 86] Bad CPU type in executable

On newer solc-select versions, this might show as solc binaries for macOS are Intel-only. Please install Rosetta on your Mac to continue.

solc requires Rosetta to be installed. To see whether you have Rosetta installed on your Mac, run

pgrep -q oahd && echo Rosetta is installed || echo Rosetta is NOT installed

If it is not installed, it can be installed with the command

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

solc-version not changing after running solc-select use [version] or setting SOLC_VERSION

Uninstall other installations of solc on your machine. solc-select re-installs solc binaries for your operating system and acts as a wrapper for solc. With duplicate solc installations, this may result in your solc version not being up to date.

"Unsupported Platform" on Windows

The solc-select version that supports Windows is currently in beta. Uninstall solc-select through pip3 uninstall solc-select and run

pip install solc-select==1.0.0b1

Alternatively, for the most up-to-date version, clone this repository and run

pip install . --user

Known Issues

SSL: CERTIFICATE_VERIFY_FAILED on running solc-select commands [investigation ongoing]

OS X

pip3 install certifi
/Applications/Python\ 3.8/Install\ Certificates.command

Python distributions on OS X has no certificates and cannot validate SSL connections, a breaking change introduced in Python 3.6. See StackOverflow post for additional details.

Connection refused [investigation ongoing]

pip3 uninstall solc-select 
pip3 install solc-select==0.2.0
solc-select install 

Try downgrading to solc-select version 0.2.0.

Our 0.2.1 version of solc-select pulls older Linux binaries from crytic/solc which seems to have introduced unexpected behavior in certain instances.

solc-select version changes, but solc --version does not match

Users seem to be experiencing situations in which the following command is successful:

solc-select use <version> 

However, when running the following command, it points to an older version of Solidity.

solc --version

solc-select is intended to work with custom binaries. This means that Solidity installed through other means (i.e: brew install solidity) will not work!.

Uninstall other versions Solidity from your computer.

License

solc-select is licensed and distributed under the AGPLv3 license. Contact us if you’re looking for an exception to the terms.

solc-select's People

Contributors

0xalpharush avatar 0xicingdeath avatar 0xphaze avatar amitt98 avatar arcz avatar ardislu avatar azpwnz avatar b-m-f avatar damilolaedwards avatar dependabot[bot] avatar dev1644 avatar dguido avatar disconnect3d avatar elopez avatar esultanik avatar hacker-dom avatar ivanvpan avatar jeremyschlatter avatar kylebakerio avatar montyly avatar oldsj avatar pcowgill avatar samczsun avatar tiktock avatar tommyz7 avatar woodruffw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solc-select's Issues

Can't seem to remove solc-select

Tried to install solc-select but it didn't quite work out for me so I'd like to remove it. Prior to installation I had solc installed using snap. I've removed the docker container, however when I try to install solc again using snap sudo snap install solc the command seems to be invoking solc-select instead:

mount: mounting /usr/bin on /workdir/usr/bin failed: Permission denied
mount: mounting /bin on /workdir/bin failed: Permission denied
mount: mounting /dev on /workdir/dev failed: Permission denied
mount: mounting /proc on /workdir/proc failed: Permission denied
mount: mounting /sys on /workdir/sys failed: Permission denied
chroot: can't execute 'chroot.sh': No such file or directory

I've also removed all files and folders that match solc$ on this machine, but this still happens. I'm confused. In what ways is solc-select interacting with snap?

Automatically change solc version depending on pragma

When running solc <file> currently, users have to change the solc-select global version, then run the solc file:

solc-select install <version> 
solc-select use <version> 
solc <file to execute> 

Example file:

pragma solidity 0.4.15;
contract Foo {
        function Foo() {
        }
}

When changing the pragma, it requires users to run the solc-select use <version> in their terminal to use the correct solc version. It would speed up testing significantly if the tool had the ability to change the version automatically.

Update `solc-select install` to take a range of versions

The current API expects users to either provide all (which will install all versions) or specifically list out which versions they want to install.

It would be convenient for testing purposes to also allow users to provide a range of versions (i.e: 0.5.17-0.8.4)

Add python types

We should add python types everywhere.

The codebase is small and straightforward, but types will help in the long term, and ease third party integrations

Better user experience around setting solc-select version

Currently, if a user tries to set the global version to a version they don't have installed, the error message tells them to run the alternative command.

It would be more efficient to directly ask users if they want to install 0.4.14 then, and then set the global version afterward, so they don't need to copy-paste the command.

$ solc-select use 0.4.14
You need to install '0.4.14' prior to using it. Use `solc-select install 0.4.14`

mac docker install failed, nothing installed

run docker run --read-only -i --rm --entrypoint='/bin/sh' trailofbits/solc-select:latest -c 'cat /usr/bin/install.sh' | bash -e as README says, in mac osx 10.15.6, docker 19.03.13

nothing happend, no new container, no solc command found (even start a new termial tab)

image

Cannot use "use" in MacOS

I've followed the installation in readme for MacOS and used $PREFIX argument for not to overwite my original solc

$soclselect/bin/solc use   
Need to provide a version to use. To list all available versions use 'solc --versions'

$soclselect/bin/solc use 0.5.9
unrecognised option '--versions'
Version 0.5.9 not supported. List all available versions with 'solc --versions'

$soclselect/bin/solc --versions 0.5.9
0.4.11
0.4.12
0.4.13
0.4.14
0.4.15
0.4.16
0.4.17
0.4.18
0.4.19
0.4.20
0.4.21
0.4.22
0.4.23
0.4.24
0.4.25
0.5.0
0.5.1
0.5.10
0.5.11
0.5.12
0.5.13
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
nightly

STDOUT and STDERR are merged if STDIN is a TTY

solc-select uses docker run to execute solc inside a container. Docker has a known issue in which STDOUT and STDERR are merged if docker run is executed with the -t argument to create a new TTY. solc-select currently passes -t to docker run if STDIN is a TTY. solc does not ever need to execute in a TTY, so we should completely remove the -t logic from solc-select.

command "solc-select install" meets error

Ubuntu 18.04 and Ubuntu 20.04 on local virtual machine
When I use the command solc-select install or solc-select install A_SOLC_VERSION(e.g, 0.4.25), I meet with the error as follows:

Available versions to install:
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1007, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 947, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1414, in connect
    super().connect()
  File "/usr/lib/python3.8/http/client.py", line 918, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wy/.local/bin/solc-select", line 8, in <module>
    sys.exit(solc_select())
  File "/home/wy/.local/lib/python3.8/site-packages/solc_select/__main__.py", line 48, in solc_select
    for version in get_installable_versions():
  File "/home/wy/.local/lib/python3.8/site-packages/solc_select/solc_select.py", line 105, in get_installable_versions
    installable = list(set(get_available_versions()) - set(installed_versions()))
  File "/home/wy/.local/lib/python3.8/site-packages/solc_select/solc_select.py", line 115, in get_available_versions
    available_releases.update(get_additional_linux_versions())
  File "/home/wy/.local/lib/python3.8/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions
    github_json = urllib.request.urlopen(url).read()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

But these two commands indeed works on the inspur linux server(Ubuntu18.04). And I notice that there has been several identical issues published.

Automatically run `solc-select upgrade` on pip3 upgrades

To get the most up-to-date solc-select version, users have to run pip install solc-select --upgrade.

With the recent changes in refactoring, if solc-select detects the old architecture, it will print an error message and ask a user to run solc-select upgrade. As a result, users need to run these two commands to update solc-select, which is clunky:

pip install solc-select --upgrade
solc-select upgrade 

Before releasing the refactor and Windows support, find a way to automatically run the solc-select upgrade command on installations so users only need to run the first pip command.

When I run the 'Solc select Install' command, the following error occurs. How can I solve it?

(py36) lsw@lsw-virtual-machine:~/桌面$ solc-select install
Available versions to install:
Traceback (most recent call last):
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 1392, in connect
super().connect()
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/http/client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/socket.py", line 722, in create_connection
raise err
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lsw/anaconda3/envs/py36/bin/solc-select", line 8, in
sys.exit(solc_select())
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/site-packages/solc_select/main.py", line 48, in solc_select
for version in get_installable_versions():
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/site-packages/solc_select/solc_select.py", line 105, in get_installable_versions
installable = list(set(get_available_versions()) - set(installed_versions()))
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/site-packages/solc_select/solc_select.py", line 115, in get_available_versions
available_releases.update(get_additional_linux_versions())
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions
github_json = urllib.request.urlopen(url).read()
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/home/lsw/anaconda3/envs/py36/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
(py36) lsw@lsw-virtual-machine:~/桌面$

Introduce local solc version override

When we designed the initial solc-select architecture, we used a global-version file, which would be set when users run solc-select use <version>.

The current architecture easily supports the capturing of a different Solidity version in a set of smart contracts using a framework (i.e: Truffle/Hardhat), which should override the globally set version.

For example, even if the global version of a system is set with 0.8.4, the local solc version should be used over the global version. If nothing is set, then it should default to the global version:

global-version = 0.8.4 

local directory 1: 
  Truffle project Solidity version = 0.5.16 

local directory 2: 
   Hardhat project Solidity version = 0.4.25 

local directory 3: 
   nothing set; should use global-version 

Fails to download solc 0.8.x

$ ./solc-select/scripts/install.sh 
Detected Linux
Creating install dir /home/g/.solc-select
Installing solc versions into /home/g/.solc-select/usr/bin
[+] successfully downloaded solc 0.8.0
semver.sh: line 9: "tag_name":: syntax error: operand expected (error token is ""tag_name":")
semver.sh: line 9: "tag_name":: syntax error: operand expected (error token is ""tag_name":")
semver.sh: line 9: "tag_name":: syntax error: operand expected (error token is ""tag_name":")
[+] failed to download solc "tag_name":
semver.sh: line 9: "preview-0: syntax error: operand expected (error token is ""preview-0")
semver.sh: line 9: "preview-0: syntax error: operand expected (error token is ""preview-0")
semver.sh: line 9: "preview-0: syntax error: operand expected (error token is ""preview-0")

Other versions work fine.

Temporary directory not included in docker path

When trying to use solc-select with the automated integration tests for Manticore on Mac, there's an error that solc can't reach the working directory because it's in a temporary directory like

""/var/folders/<2_chars>/<uuid>/T/tmpzos1e1fn"" is not found

I have patched the bin/solc docker invocation to also include:

--mount type=bind,source="/private/`getconf DARWIN_USER_TEMP_DIR`",target=`getconf DARWIN_USER_TEMP_DIR`

which fixes it, but I'm not sure how best to apply this so that Linux hosts don't get an error.

Furthermore, Linux temporary directory can be retrieved using

TMPDIR=`dirname $(mktemp -u -t tmp.XXXXXXXXXX)`

which can then be add as a mount too.

Also, for users that don't want to always include their temporary files, maybe we could have an environment variable to choose when to include the temporary directory in docker?

solc-select versions

Displays out of order and .DS_Store here too:

0.8.0
[...]
0.6.12
0.6.11 (current, set by /Users/nataliechin/.solc-select/global-version)
0.6.10
0.6.1
0.6.0
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.17
0.5.16
0.5.15
0.5.14
0.5.13
0.5.12
0.5.11
0.5.10
0.5.1
0.5.0
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.26
0.4.25
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.2
0.4.19
0.4.18
0.4.17
0.4.16
0.4.15
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.1
0.4.0
0.3.6
.DS_Store

Add checksum

For every binary we should have a checksum and warn the user if it does not match

mac doesnt work

After I install the package completely in macosx 11.1 Beta and i restart the terminal for entering the solc-select and it doesn't find the command again. Now the only currently working way is installing the package on centos and they works without any workaround at all.

libreadline error when running solc

solc --version
Error loading shared library libreadline.so.8: No such file or directory (needed by /usr/bin/solc)
Error relocating /usr/bin/solc: unstifle_history: symbol not found
Error relocating /usr/bin/solc: rl_make_bare_keymap: symbol not found
Error relocating /usr/bin/solc: rl_bind_key_if_unbound_in_map: symbol not found
Error relocating /usr/bin/solc: rl_macro_dumper: symbol not found
Error relocating /usr/bin/solc: previous_history: symbol not found
Error relocating /usr/bin/solc: rl_vi_end_word: symbol not found
Error relocating /usr/bin/solc: rl_parse_and_bind: symbol not found
Error relocating /usr/bin/solc: rl_redisplay: symbol not found
Error relocating /usr/bin/solc: rl_push_macro_input: symbol not found
Error relocating /usr/bin/solc: rl_bind_key_in_map: symbol not found
Error relocating /usr/bin/solc: clear_history: symbol not found
Error relocating /usr/bin/solc: add_history: symbol not found
Error relocating /usr/bin/solc: rl_redraw_prompt_last_line: symbol not found
Error relocating /usr/bin/solc: rl_function_of_keyseq_len: symbol not found
Error relocating /usr/bin/solc: history_get: symbol not found
Error relocating /usr/bin/solc: rl_get_keymap: symbol not found
Error relocating /usr/bin/solc: rl_kill_text: symbol not found
Error relocating /usr/bin/solc: remove_history: symbol not found
Error relocating /usr/bin/solc: history_truncate_file: symbol not found
Error relocating /usr/bin/solc: rl_generic_bind: symbol not found
Error relocating /usr/bin/solc: rl_read_key: symbol not found
Error relocating /usr/bin/solc: read_history: symbol not found
Error relocating /usr/bin/solc: rl_add_defun: symbol not found
Error relocating /usr/bin/solc: history_expand: symbol not found
Error relocating /usr/bin/solc: rl_translate_keyseq: symbol not found
Error relocating /usr/bin/solc: rl_get_previous_history: symbol not found
Error relocating /usr/bin/solc: rl_forced_update_display: symbol not found
Error relocating /usr/bin/solc: rl_read_init_file: symbol not found
Error relocating /usr/bin/solc: rl_invoking_keyseqs: symbol not found
Error relocating /usr/bin/solc: append_history: symbol not found
Error relocating /usr/bin/solc: free_history_entry: symbol not found
Error relocating /usr/bin/solc: rl_unbind_key_in_map: symbol not found
Error relocating /usr/bin/solc: readline: symbol not found
Error relocating /usr/bin/solc: rl_variable_value: symbol not found
Error relocating /usr/bin/solc: history_set_pos: symbol not found
Error relocating /usr/bin/solc: rl_unbind_function_in_map: symbol not found
Error relocating /usr/bin/solc: read_history_range: symbol not found
Error relocating /usr/bin/solc: history_is_stifled: symbol not found
Error relocating /usr/bin/solc: stifle_history: symbol not found
Error relocating /usr/bin/solc: replace_history_entry: symbol not found
Error relocating /usr/bin/solc: rl_insert_text: symbol not found
Error relocating /usr/bin/solc: rl_get_keymap_by_name: symbol not found
Error relocating /usr/bin/solc: rl_set_screen_size: symbol not found
Error relocating /usr/bin/solc: rl_vi_bWord: symbol not found
Error relocating /usr/bin/solc: rl_get_termcap: symbol not found
Error relocating /usr/bin/solc: rl_ding: symbol not found
Error relocating /usr/bin/solc: where_history: symbol not found
Error relocating /usr/bin/solc: rl_delete_text: symbol not found
Error relocating /usr/bin/solc: rl_function_of_keyseq: symbol not found
Error relocating /usr/bin/solc: rl_bind_keyseq: symbol not found
Error relocating /usr/bin/solc: rl_reset_terminal: symbol not found
Error relocating /usr/bin/solc: history_tokenize: symbol not found
Error relocating /usr/bin/solc: rl_forward_word: symbol not found
Error relocating /usr/bin/solc: rl_function_dumper: symbol not found
Error relocating /usr/bin/solc: _rl_find_next_mbchar: symbol not found
Error relocating /usr/bin/solc: rl_vi_insertion_mode: symbol not found
Error relocating /usr/bin/solc: rl_variable_bind: symbol not found
Error relocating /usr/bin/solc: rl_named_function: symbol not found
Error relocating /usr/bin/solc: rl_initialize: symbol not found
Error relocating /usr/bin/solc: rl_vi_start_inserting: symbol not found
Error relocating /usr/bin/solc: rl_complete_internal: symbol not found
Error relocating /usr/bin/solc: history_list: symbol not found
Error relocating /usr/bin/solc: tilde_expand: symbol not found
Error relocating /usr/bin/solc: rl_funmap_names: symbol not found
Error relocating /usr/bin/solc: rl_set_keymap: symbol not found
Error relocating /usr/bin/solc: rl_variable_dumper: symbol not found
Error relocating /usr/bin/solc: rl_bind_keyseq_in_map: symbol not found
Error relocating /usr/bin/solc: write_history: symbol not found
Error relocating /usr/bin/solc: rl_on_new_line: symbol not found
Error relocating /usr/bin/solc: rl_clear_visible_line: symbol not found
Error relocating /usr/bin/solc: rl_completion_matches: symbol not found
Error relocating /usr/bin/solc: rl_completion_mode: symbol not found
Error relocating /usr/bin/solc: rl_add_undo: symbol not found
Error relocating /usr/bin/solc: rl_cleanup_after_signal: symbol not found
Error relocating /usr/bin/solc: rl_list_funmap_names: symbol not found
Error relocating /usr/bin/solc: using_history: symbol not found
Error relocating /usr/bin/solc: history_get_time: symbol not found
Error relocating /usr/bin/solc: remove_history_range: symbol not found
Error relocating /usr/bin/solc: rl_crlf: symbol not found
Error relocating /usr/bin/solc: rl_filename_completion_function: symbol not found
Error relocating /usr/bin/solc: rl_tilde_expand: symbol not found
Error relocating /usr/bin/solc: rl_newline: symbol not found
Error relocating /usr/bin/solc: rl_vi_editing_mode: symbol not found
Error relocating /usr/bin/solc: rl_username_completion_function: symbol not found
Error relocating /usr/bin/solc: rl_insert: symbol not found
Error relocating /usr/bin/solc: rl_tab_insert: symbol not found
Error relocating /usr/bin/solc: rl_menu_complete: symbol not found
Error relocating /usr/bin/solc: rl_yank_last_arg: symbol not found
Error relocating /usr/bin/solc: rl_complete: symbol not found
Error relocating /usr/bin/solc: history_length: symbol not found
Error relocating /usr/bin/solc: rl_completion_found_quote: symbol not found
Error relocating /usr/bin/solc: rl_completion_type: symbol not found
Error relocating /usr/bin/solc: rl_point: symbol not found
Error relocating /usr/bin/solc: history_lines_written_to_file: symbol not found
Error relocating /usr/bin/solc: history_max_entries: symbol not found
Error relocating /usr/bin/solc: history_write_timestamps: symbol not found
Error relocating /usr/bin/solc: rl_completion_suppress_quote: symbol not found
Error relocating /usr/bin/solc: rl_basic_word_break_characters: symbol not found
Error relocating /usr/bin/solc: rl_mark: symbol not found
Error relocating /usr/bin/solc: rl_directory_rewrite_hook: symbol not found
Error relocating /usr/bin/solc: rl_end: symbol not found
Error relocating /usr/bin/solc: rl_directory_completion_hook: symbol not found
Error relocating /usr/bin/solc: rl_completer_word_break_characters: symbol not found
Error relocating /usr/bin/solc: rl_dispatching: symbol not found
Error relocating /usr/bin/solc: rl_filename_quoting_desired: symbol not found
Error relocating /usr/bin/solc: history_search_delimiter_chars: symbol not found
Error relocating /usr/bin/solc: rl_executing_keyseq: symbol not found
Error relocating /usr/bin/solc: rl_key_sequence_length: symbol not found
Error relocating /usr/bin/solc: rl_filename_dequoting_function: symbol not found
Error relocating /usr/bin/solc: rl_filename_rewrite_hook: symbol not found
Error relocating /usr/bin/solc: rl_filename_stat_hook: symbol not found
Error relocating /usr/bin/solc: vi_insertion_keymap: symbol not found
Error relocating /usr/bin/solc: rl_prep_term_function: symbol not found
Error relocating /usr/bin/solc: rl_menu_completion_entry_function: symbol not found
Error relocating /usr/bin/solc: rl_attempted_completion_function: symbol not found
Error relocating /usr/bin/solc: history_comment_char: symbol not found
Error relocating /usr/bin/solc: rl_filename_completion_desired: symbol not found
Error relocating /usr/bin/solc: rl_done: symbol not found
Error relocating /usr/bin/solc: rl_completion_append_character: symbol not found
Error relocating /usr/bin/solc: rl_sort_completion_matches: symbol not found
Error relocating /usr/bin/solc: history_lines_read_from_file: symbol not found
Error relocating /usr/bin/solc: emacs_ctlx_keymap: symbol not found
Error relocating /usr/bin/solc: rl_deprep_term_function: symbol not found
Error relocating /usr/bin/solc: rl_editing_mode: symbol not found
Error relocating /usr/bin/solc: tilde_additional_prefixes: symbol not found
Error relocating /usr/bin/solc: history_subst_char: symbol not found
Error relocating /usr/bin/solc: rl_readline_state: symbol not found
Error relocating /usr/bin/solc: rl_attempted_completion_over: symbol not found
Error relocating /usr/bin/solc: vi_movement_keymap: symbol not found
Error relocating /usr/bin/solc: rl_filename_quote_characters: symbol not found
Error relocating /usr/bin/solc: rl_filename_quoting_function: symbol not found
Error relocating /usr/bin/solc: history_quotes_inhibit_expansion: symbol not found
Error relocating /usr/bin/solc: rl_readline_name: symbol not found
Error relocating /usr/bin/solc: rl_line_buffer: symbol not found
Error relocating /usr/bin/solc: emacs_meta_keymap: symbol not found
Error relocating /usr/bin/solc: rl_char_is_quoted_p: symbol not found
Error relocating /usr/bin/solc: rl_completion_entry_function: symbol not found
Error relocating /usr/bin/solc: rl_last_func: symbol not found
Error relocating /usr/bin/solc: rl_ignore_some_completions_function: symbol not found
Error relocating /usr/bin/solc: rl_completion_invoking_key: symbol not found
Error relocating /usr/bin/solc: rl_instream: symbol not found
Error relocating /usr/bin/solc: tilde_expansion_preexpansion_hook: symbol not found
Error relocating /usr/bin/solc: tilde_additional_suffixes: symbol not found
Error relocating /usr/bin/solc: rl_completion_suppress_append: symbol not found
Error relocating /usr/bin/solc: history_inhibit_expansion_function: symbol not found
Error relocating /usr/bin/solc: rl_completer_quote_characters: symbol not found
Error relocating /usr/bin/solc: rl_completion_quote_character: symbol not found
Error relocating /usr/bin/solc: history_base: symbol not found
Error relocating /usr/bin/solc: rl_terminal_name: symbol not found
Error relocating /usr/bin/solc: history_expansion_char: symbol not found
Error relocating /usr/bin/solc: rl_outstream: symbol not found
Error relocating /usr/bin/solc: emacs_standard_keymap: symbol not found
Error relocating /usr/bin/solc: rl_startup_hook: symbol not found
Error relocating /usr/bin/solc: history_quoting_state: symbol not found
Error relocating /usr/bin/solc: rl_signal_event_hook: symbol not found
Error relocating /usr/bin/solc: rl_special_prefixes: symbol not found
Error relocating /usr/bin/solc: rl_explicit_arg: symbol not found
Error relocating /usr/bin/solc: rl_num_chars_to_read: symbol not found
Error relocating /usr/bin/solc: rl_completion_mark_symlink_dirs: symbol not found

Lost support for solc < 0.4.10

With the new python refactoring, we lost the support for solc < 0.4.10

We are now using https://binaries.soliditylang.org/, which does not list versions that are too old, while in the past we used:

curl -s -f -L "https://github.com/ethereum/solidity/releases/download/${1}/solc-static-linux" -o "$solc" && chmod +x "$solc" && echo "Installed solc-${1}"

Alternatively, we could get the missing binaries from: https://github.com/crytic/solc

solc --upgrade will not work for source installation setup

solc --upgrade is meant to update the list of available solc.

The current script pull the latest version on dockerhub:

solc-select/bin/solc

Lines 4 to 7 in c96e3e7

if [[ "$1" == "--upgrade" ]]; then
echo "Upgrading solc-select..."
docker pull trailofbits/solc-select:latest
else

As a result, local changes (ex: using a branch) will be erased.

I see two solutions:
1 - Update the source installation documentation, to mention that update must be done through docker build -t trailofbits/solc-select:latest .
2 - Somehow detect that the installation is a git version, and switch the command accordingly

I can submit a PR for solution 1, solution 2 seems more tricky.

Any thoughts?

Can not install solc on the Mac.

I am trying to install solc following our document,

docker pull trailofbits/solc-select
docker run --read-only -i --rm --entrypoint='/bin/sh' trailofbits/solc-select:latest -c 'cat /usr/bin/install.sh' | bash -e

when I run first command, it can pull some images, but for the second commands, nothing happens, so what should I do?

exec user process caused "exec format error"

I'm trying to run docker run --read-only -i --rm --entrypoint='/bin/sh' trailofbits/solc-select:latest -c 'cat /usr/bin/install.sh' | bash -e on Ubuntu arm 64 bit, but keep getting standard_init_linux.go:207: exec user process caused "exec format error". I was wondering if this is architecture related issue. Most of the answers I get from googling say add #!/bin/bash at the top of the script, but I'm guessing the presence of --entrypoint flag will cover that. Any idea?

Solc version not being switched

I am attempting to switch my solc version from 0.8.3 to 0.4.24, but this does not seem to be working as shown when I check the version, and when I try and build contracts using 0.4.24.
solc

How to add older versions to the script?

Hello,

in the README.md, when typing --version, the oldest version is 0.4.11
However, when I type it, the oldest version is 0.0.24.
How can I tell the script to also add all the old versions?

Thank you,

Lukas

Unsupported platform

I am using Win10. When I run solc-select install, it returns Available versions to install: Unsupported platform.

pip3 install solc-select

Sorry to bother you, while I am using the command 'pip3 install solc-select', it runs fast. Does this mean that all versions have been installed? But when I use the command solc-selct install ,its output:(the environment is the Linux server,and what I am using the version of solc-select is 0.2.1)
Available versions to install:
Traceback (most recent call last):
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1350, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 1417, in connect
super().connect()
File "/home/rb/anaconda3/lib/python3.8/http/client.py", line 921, in connect
self.sock = self._create_connection(
File "/home/rb/anaconda3/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/home/rb/anaconda3/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/rb/anaconda3/bin/solc-select", line 8, in
sys.exit(solc_select())
File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/main.py", line 48, in solc_select
for version in get_installable_versions():
File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 105, in get_installable_versions
installable = list(set(get_available_versions()) - set(installed_versions()))
File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 115, in get_available_versions
available_releases.update(get_additional_linux_versions())
File "/home/rb/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 123, in get_additional_linux_versions
github_json = urllib.request.urlopen(url).read()
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/home/rb/anaconda3/lib/python3.8/urllib/request.py", line 1353, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

install problem

Sorry to bother you. Why I use the command "pip3 install solc-select" and then use "solc-select install 0.8.1 ",it shows "solc-select: not found"

solc-select doesn't recognize already install solc version

solc was installed on my system. Before installing the solc-select, it showed:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.8.6+commit.11564f7e.Darwin.appleclang

Once I installed solc-select, it didn't recognize my local version:

$ solc --version
No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.

While trying to use the local version:

$ solc-select use 0.8.6
You need to install '0.8.6' prior to using it. Use `solc-select install 0.8.6`

So I have to again install and use a solc version using solc-select

Add native, docker-less support for Linux

This should also resolve #12.

Task Description

There is no reason why solc-select would need to use Docker on Linux, since solc distributes statically linked Linux binaries.

The goal is to update the solc-select install script to:

  • Detect whether it is being installed on Linux
  • If so, run the scripts that are typically used to provision the Docker image

This may require modifying the install scripts such that they can both provision the Docker image (for non-Linux users) and install the scripts natively in Linux. The scripts that are installed in the Docker image are in the scripts/ directory.

There is currently a development branch that provides interim support for Ubuntu, but it uses Docker, which should not be necessary.

Acceptance criteria

  • solc-select can install and upgrade itself on Ubuntu 18.04.2 LTS
  • solc-select can install and upgrade itself on macOS
  • solc-select behaves identically regardless of the OS on which it is run
  • Documentation is updated to reflect the new capabilities, as well as any changes to the installation instructions

It would be nice to have solc-select packaged in a more standard way (e.g., Homebrew for macOS and Apt for Linux), but this is not necessary.

Required Skill

  • Experience with Bash scripting
  • Experience with Docker
  • Experience with Linux

No experience with solc or smart contracts is required.

Feel free to ask questions here, or join our slack (#ethereum)

/usr/local/bin/solc: Permission denied

I tried to install solc-select as specified in the "Quickstart" description. When asked to overwrite /usr/local/bin/solc, the error, described in the title, occurs. Using -privileged flag in the Docker call does not solve this problem.

Validate inputted versions

Print out error message for user if they enter a solc version too large or too small. Both commands currently fail silently.

~$ solc-select install 0.9.1
~$
solc-select install 0.2.1
~$

Maximum is in the list.json with latestRelease tag

"latestRelease": "0.8.2"

Minimum is different for each distribution:

SSL certificate verify failed

Ubuntu 18.04

When I use the command solo-select install

I met with this error:

Traceback (most recent call last):
  File "/usr/local/bin/solc-select", line 11, in <module>
    sys.exit(solc_select())
  File "/usr/local/lib/python3.6/dist-packages/solc_select/__main__.py", line 48, in solc_select
    for version in get_installable_versions():
  File "/usr/local/lib/python3.6/dist-packages/solc_select/solc_select.py", line 105, in get_installable_versions
    installable = list(set(get_available_versions()) - set(installed_versions()))
  File "/usr/local/lib/python3.6/dist-packages/solc_select/solc_select.py", line 112, in get_available_versions
    list_json = urllib.request.urlopen(url).read()
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 1368, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.6/urllib/request.py", line 1327, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>

solc-runner ERROR

This error occurs when I run solc -- version

.solc-select/usr/bin/solc-runner:line 11: $BIN_DIR/solc-v$SOLC_VERSION $@

what should i do?

Add flag to `solc-select use` to install and change version

Convenience feature – but would be nice to add an option to run solc-select use <version> --some_flag, which installs and changes the solc version without the user needing to run solc-select install <version && solc-select use <version>

switch to the expected solc version automatically

I am using docker slighter and trying to use solc-select automatically. How it should be configured?

Currently it does not work even if I specify multiple versions using --solc-solcs-select

Any help would be appreciated.

Support for Windows v0.4.1 – v0.4.4

According to the json,0.4.3, 0.4.4 are missing for Windows, which is why they fail to install:

    "0.4.5": "solc-windows-amd64-v0.4.5+commit.b318366e.zip",
    "0.4.2": "solc-windows-amd64-v0.4.2+commit.af6afb04.zip",
    "0.4.1": "solc-windows-amd64-v0.4.1+commit.4fc6fc2c.zip"

Originally posted by @NatalieChin80 in #54 (comment)

Also, 0.4.1 and 0.4.2 are not the stable release builds, so this produces errors when trying to compile a file that expects version 0.4.1.

Add option to only install a single or range of versions

Similar to #27, it would be nice to provide an option on the install script to specify which versions you would like to install, rather than the entire fetch list of releases.

This is useful in CI platforms, where you are generally only interested in one or a few specific versions at most.

For older versions, we can either bump up the ?per_page parameter on the Github API, or try to search for more versions using the pagination API if a specified version was not found. At the moment, 0.4.24 has been cut off from the list of versions, now that is it is not in the 25 most recent releases.

Persistent contract files

Solidity files appear to persist within the docker image between runs, so any changes on the local disk do no affect what dockerized compiler actually processes after the first time. Restarting Docker helps fix the issue.

chroot: can't execute 'chroot.sh': No such file or directory

My dev machine is Ubuntu 18.04 and Docker version 18.09.5

I tried to install solc-select from source. The installation went through correctly. But when I tried to check the versions I had the following error:
$ solc --version

mount: mounting /usr/bin on /workdir/usr/bin failed: Permission denied
mount: mounting /bin on /workdir/bin failed: Permission denied
mount: mounting /dev on /workdir/proc failed: Permission denied
mount: mounting /proc on /workdir/dev failed: Permission denied
mount: mounting /sys on /workdir/sys failed: Permission denied
chroot: can't execute 'chroot.sh': No such file or directory

I uninstalled my solc installation and tried this again but had the same result.

Next, I uninstalled solc-select and ran the docker version. I had to update chmod for solc. But even after that I ran into the above errors when I tried to check the version again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.