test/goroot: update temporary GOPATH after module-path migration

Open Beginner friendly
#2,407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start in test/goroot.prepareCaseWorkspace and inspect go.mod for the migrated module path. Run the provided TestGoRootRunCases reproduction to confirm the current GOPATH failure, then add a unit test in test/goroot that verifies the generated workspace can reach the runtime package. Done means the link uses github.com/xgo-dev/llgo and the helloworld case no longer fails to resolve it.

Written by the indexing model from the issue text.

Description

main now declares module github.com/xgo-dev/llgo, but test/goroot.prepareCaseWorkspace still creates only this temporary GOPATH link:

$GOPATH/src/github.com/goplus/llgo -> <checkout>

As a result, every GOROOT case that reaches LLGo compilation fails before testing the case because the compiler cannot resolve the migrated runtime packages.

Minimal reproduction on current main:

go test ./test/goroot -run '^TestGoRootRunCases$' -count=1 -args \
  -goroot "$(go env GOROOT)" \
  -dirs . \
  -case '^helloworld\\.go$'

Representative error:

cannot find package "github.com/xgo-dev/llgo/runtime/internal/runtime" in any of:
    $GOROOT/src/github.com/xgo-dev/llgo/runtime/internal/runtime
    $GOPATH/src/github.com/xgo-dev/llgo/runtime/internal/runtime

prepareCaseWorkspace should create the checkout link under github.com/xgo-dev/llgo (or derive the module path from go.mod) and have a unit test which verifies that the runtime package is reachable from the generated GOPATH workspace.

Dominant language
LLVM
Stars
758
Forks
49
Avg merge
1d 6h
Merged PRs (30d)
138

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xgo-dev/llgo

All issues in xgo-dev/llgo

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.