Skip to content

Commit

Permalink
Merge pull request #11 from withtally/feat/remove-extra
Browse files Browse the repository at this point in the history
feat(revert): revert adding extra, restore getting solc based on arch
  • Loading branch information
jemilezzet authored Dec 22, 2023
2 parents a686e6c + ebbac83 commit a8b52b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions codegen/processor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions solc/solc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ var platforms = map[string]string{
"windows": "windows",
}

// var architectures = map[string]string{
// "wasm": "wasm32",
// "amd64": "amd64",
// }
var architectures = map[string]string{
"wasm": "wasm32",
"amd64": "amd64",
}

var (
cache = configdir.New("withtally", "ethgen").QueryCacheFolder()
Expand Down Expand Up @@ -86,8 +86,7 @@ func fetch(b Build) (Build, error) {
}

log.Printf("Fetching solc compiler: %s\n", b.Path)
uri.Path = filepath.Join(platforms[runtime.GOOS]+"-amd64", b.Path)
log.Printf("URI: %s", uri.String())
uri.Path = filepath.Join(platforms[runtime.GOOS]+"-"+architectures[runtime.GOARCH], b.Path)
res, err := http.Get(uri.String())
if err != nil {
return Build{}, fmt.Errorf("create solc get request: %w", err)
Expand Down Expand Up @@ -141,12 +140,12 @@ func resolve(vc *parser.VersionConstraint) (Build, error) {
return Build{}, fmt.Errorf("platform not supported: %s", runtime.GOOS)
}

// arch, ok := architectures["amd64"]
// if !ok {
// return Build{}, fmt.Errorf("architecture not supported: %s", runtime.GOARCH)
// }
arch, ok := architectures[runtime.GOARCH]
if !ok {
return Build{}, fmt.Errorf("architecture not supported: %s", runtime.GOARCH)
}

uri.Path = filepath.Join(platform+"-amd64", "list.json")
uri.Path = filepath.Join(platform+"-"+arch, "list.json")
res, err := http.Get(uri.String())
if err != nil {
return Build{}, fmt.Errorf("create solc list get request: %w", err)
Expand Down

0 comments on commit a8b52b6

Please sign in to comment.