Skip to content
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

Introduce Go modules #219

Merged
merged 6 commits into from
Apr 17, 2019
Merged

Introduce Go modules #219

merged 6 commits into from
Apr 17, 2019

Conversation

bzz
Copy link
Contributor

@bzz bzz commented Apr 8, 2019

This fixes #170 by adding Modules support.

  • go.sum and go.mod added
  • github import path used instead of gopkg.in
  • CI forced to use modules \w 2 latest Go versions, no go get
  • go test all failure 1 heuristics.go
  • go test all failure 2 TestCrashDumpsAllThreads
  • CI: fix cgo profiles for newer go compiler versions
  • update to newest release of fixed compiler
  • bump major version to /v2

@bzz bzz self-assigned this Apr 8, 2019
@bzz
Copy link
Contributor Author

bzz commented Apr 8, 2019

$ go test all

# github.com/src-d/enry/internal/code-generator/generator
internal/code-generator/generator/heuristics.go:54:17: Errorf format %q has arg patterns[ext] of wrong type []*github.com/src-d/enry/internal/code-generator/generator.LanguagePattern

FAIL	github.com/src-d/enry/internal/code-generator/generator [build failed]

--- FAIL: TestCrashDumpsAllThreads (0.03s)
    crash_unix_test.go:70: building source: exit status 1
        go: cannot find main module; see 'go help modules'
FAIL
FAIL	runtime	161.287s

Although these are not sorted out yet, early feedback is very appreciated!

@bzz bzz requested review from dennwc and creachadair April 8, 2019 22:13
@bzz bzz force-pushed the go-mod branch 6 times, most recently from 33a58ac to 5485aa2 Compare April 9, 2019 13:26
@bzz
Copy link
Contributor Author

bzz commented Apr 9, 2019

The only failure on go test all is now a

--- FAIL: TestCrashDumpsAllThreads (0.04s)
    crash_unix_test.go:70: building source: exit status 1
        go: cannot find main module; see 'go help modules'
FAIL
FAIL	runtime	162.087s

which does not seem relevant.

One last thing left is - fix a CGO profiles on CI that seems to fail due to what seems to be some compiler/linker version missmatch

# github.com/src-d/enry.test
/home/travis/.gimme/versions/go1.12.3.linux.amd64/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-029942625/000006.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

@creachadair
Copy link
Contributor

which does not seem relevant.

It looks relevant to me—the error is from a module-aware build, not being able to identify the main module. It is probably a configuration issue rather than a code bug, though. This is typical of what you get if either (a) you build inside $GOPATH with modules not enabled (e.g., Go 1.11.x without GO111MODULE=on), or (b) you build outside $GOPATH with no go.mod file in $PWD.

@bzz
Copy link
Contributor Author

bzz commented Apr 9, 2019

CI is going to be fixed on master in separate PR #221.
Scope in this PR's description was updated to include last module-related test failure instead.

@bzz bzz changed the title Introduce Go modules WIP Introduce Go modules Apr 9, 2019
@bzz
Copy link
Contributor Author

bzz commented Apr 11, 2019

Needs to be rebased on master, after #222 lands:

  • resolve conflicts
  • drop last 2 commits
  • bump versions as Go 1.12.4 and Go 1.11.9 were just released

bzz added 3 commits April 12, 2019 11:47
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Apr 12, 2019

As discussed, consensus is that go test all failures in third-party dependencies might happen but do not block this work as soon as our tests pass.

Looking into code generator test fail with \w oniguruma:

$ go test -tags 'oniguruma' ./internal/code-generator/... -run Test_GeneratorTestSuite -testify.m TestGenerationFiles

@bzz bzz changed the title WIP Introduce Go modules Introduce Go modules Apr 12, 2019
@bzz
Copy link
Contributor Author

bzz commented Apr 12, 2019

CI fails due to #225 that should be investigated and fixed in a separate profile.

This is ready to be merged as soon as /v2 is added!

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
 - update go.mod \w v2
 - update all import paths

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Apr 14, 2019

This is ready to be merged now - v2 was added in 6a5f37e

CI will be taken care of under #225 before v2.0.0 release

@bzz bzz merged commit ae43e1a into src-d:master Apr 17, 2019
@bzz bzz deleted the go-mod branch April 17, 2019 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Go modules
3 participants