mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-04 04:29:01 +00:00
Compiler cannot resolve third party packages. #7
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anthdm on GitHub (Feb 24, 2018).
Originally assigned to: @anthdm on GitHub.
Problem
The compiler cannot resolve third-party packages (github.com, ..). Some of the compilers internal tests refer to some packages of itself, which are considered "third-party" as the imported path prefix is also "github.com. Hence all those tests that have those dependencies are not passing.
*update with the solution
After reading through this [awesome document] (https://github.com/golang/example/tree/master/gotypes) it was clear to use the go/loader package for building and type checking the source files, instead of the default tools the AST package gives us.
@anthdm commented on GitHub (Feb 24, 2018):
After some reading through a whole lot of Go's internal documentation, I found why this error occurs. This has nothing to do with CircleCI neither with dependencies. The default importer which the compiler is using to resolve package imports, cannot resolve "github.com" paths. A very good document for this can be found here.
I'm currently working on a refactoring on how to the compiler imports and resolves the initial smart contract file and all its imported packages.