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

integration/rpctest: make exec path compatible with modules #1352

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

halseth
Copy link
Collaborator

@halseth halseth commented Nov 29, 2018

With the use of go modules, the btcdPkgPath will no longer be github.com/btcsuite/btcd, but end with a version string (e.g. btcd@v0.0.0-20181129140220-beb77e89572a).

This trips up build.ImportDir, which will return a ImportPath of ".", since this package cannot be found in the go path.

There are probably several ways of fixing this, by clever string magic, but seems easiest to just hardcode the btcd package name.

Relevant issue: golang/go#26504

With the use of go modules, the btcdPkgPath will no longer be `github.com/btcsuite/btcd`, but end with a version string (e.g. btcd@v0.0.0-20181129140220-beb77e89572a).

This trips up build.ImportDir, which will return a ImportPath of ".", since this package cannot be found in the go path.

There are probably several ways of fixing this, by clever string magic, but seems easiest to just hardcode the btcd package name.
@halseth
Copy link
Collaborator Author

halseth commented Nov 29, 2018

an alternative is to use the btcd executable found in path, which I see dcrd is doing: https://github.com/decred/dcrd/blob/bd3a416cae89d63342479aae5fc4e1c9aeb46fb9/rpctest/node.go#L55

@Roasbeef
Copy link
Member

It seems we should just go ahead and switch btcd over to using modules as well along the way?

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@Roasbeef Roasbeef merged commit b6c71b4 into btcsuite:master Nov 29, 2018
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.

2 participants