Skip to content

fix: assemble format issues #215

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

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions pkg/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package loader
import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -78,12 +76,8 @@ func loadLocal(base *source, name string) (*source, bool, error) {
func loadProgram(data []byte, into *types.Program, targetToolName string) (types.Tool, error) {
var (
ext types.Program
id string
)

summed := sha256.Sum256(data)
id = "@" + hex.EncodeToString(summed[:])[:12]

if err := json.Unmarshal(data[len(assemble.Header):], &ext); err != nil {
return types.Tool{}, err
}
Expand All @@ -93,15 +87,10 @@ func loadProgram(data []byte, into *types.Program, targetToolName string) (types
if builtinTool, ok := builtin.Builtin(k); ok {
v = builtinTool
}

for tk, tv := range v.ToolMapping {
v.ToolMapping[tk] = tv + id
}
v.ID = k + id
into.ToolSet[v.ID] = v
into.ToolSet[k] = v
}

tool := into.ToolSet[ext.EntryToolID+id]
tool := into.ToolSet[ext.EntryToolID]
if targetToolName == "" {
return tool, nil
}
Expand Down