Compiler cannot resolve third party packages. #7

Closed
opened 2025-12-28 17:11:55 +00:00 by sami · 1 comment
Owner

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.

schermafbeelding 2018-02-24 om 09 21 45

*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.

note: currently refactoring the build process to solve this problem.

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. <img width="1261" alt="schermafbeelding 2018-02-24 om 09 21 45" src="https://user-images.githubusercontent.com/4670056/36627516-4ea66360-1944-11e8-9b98-0fae0d594857.png"> ### *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. > note: currently refactoring the build process to solve this problem.
sami 2025-12-28 17:11:55 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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.

@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](https://github.com/golang/example/tree/master/gotypes). 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#7
No description provided.