Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

chore(solc): use svm global_version if it exists and no SOLC_PATH is set #709

Merged
merged 4 commits into from
Dec 19, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Dec 19, 2021

Motivation

consider ~/svm/.global_version in Solc::default

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

#[cfg(not(target_arch = "wasm32"))]
{
if let Some(solc) = Solc::svm_global_version().filter(|p| p.exists()) {
return Solc::new(solc)
Copy link
Owner

@gakonst gakonst Dec 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.global-version returns only the version, not the path to the binary with that version. So we need an extra resolution from version to path - think there should be a function for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you're right, somehow I thought this was a copy

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we could have done if let Ok(...) instead of .ok() and doing if let Some(...)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants