-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Avoid requiring Bazaar to compile #20870
Avoid requiring Bazaar to compile #20870
Conversation
Hi @bltavares! It looks like there are a lot of dependency changes here. Are all of these required to eliminate the Bazaar requirement, or would the I'm also a little concerned that using |
Hi @apparentlymart ! The only changes I've manually introduced was the I'm not quite versed on how vgo was supposed to work, and if that is the correct strategy, but I've noticed contributing to some plugins that if you remove I understand the concern regarding the amount of changes. The only needed directive is the two lines declaring I would be fine installing I'm not aware of the current state of the proposal of Go module caching, as I'm not used to write Go code, to comment if this is a viable long-term strategy, or if there is a better fix down the dependency tree. Let me know how to help. I could test alternative approaches on my setup later this week, for example. |
Hi again @bltavares! Thanks for the additional information. Based on my experience with Go Modules so far, I think the following steps should get the smallest possible result:
Hopefully that'll keep the set of dependency changes to a minimum. If the resulting set is relatively small then we can potentially devise some tailored tests for those dependencies to get some confidence that they don't cause regressions -- the changeset for the above will include changes to files in
Thanks for looking in to this! I'm sorry these indirect dependencies are causing trouble right now. I'm definitely keen to find a resolution here, just also want to minimize risk to the release already in progress. |
There are two transitive dependencies present on the current three which are hosted on `bzr`, which increases the tooling required to compile Terraform, and fails to compile the new version on Windwos. This affects plugin providers as well, making it harder to compile plugins on Winows. If `bzr` is not installed, fetching dependencies will fail: <details> <summary> Error when Bazaar is not installed</summary> ``` go: launchpad.net/gocheck@v0.0.0-20140225173054-000000000087: bzr branch --use-existing-dir https://launchpad.net/~niemeyer/gocheck/trunk . in C:\Users\bltav\go\pkg\mod\cache\vcs\f46ce2ae80d31f9b0a29099baa203e3b6d269dace4e5357a2cf74bd109e13339: exec: "bzr": executable file not found in %PATH% go: labix.org/v2/mgo@v0.0.0-20140701140051-000000000287: bzr branch --use-existing-dir https://launchpad.net/mgo/v2 . in C:\Users\bltav\go\pkg\mod\cache\vcs\ca61c737a32b1e09a0919e15375f9c2b6aa09860cc097f1333b3c3d29e040ea8: exec: "bzr": executable file not found in %PATH% go: error loading module requirements ``` </details> When bazaar is installed, but running on Windows, we have a different failure <details> <summary> Error executing Bazaar checkout on Windows </summary> ``` o: launchpad.net/[email blocked].0-20140225173054-000000000087: bzr branch --use-existing-dir https://launchpad.net/~niemeyer/gocheck/trunk . in c:\gopath\pkg\mod\cache\vcs\f46ce2ae80d31f9b0a29099baa203e3b6d269dace4e5357a2cf74bd109e13339: exit status 4: bzr: ERROR: httplib.IncompleteRead: IncompleteRead(34 bytes read) Traceback (most recent call last): File "bzrlib\commands.pyo", line 920, in exception_to_return_code File "bzrlib\commands.pyo", line 1131, in run_bzr File "bzrlib\commands.pyo", line 673, in run_argv_aliases File "bzrlib\commands.pyo", line 695, in run File "bzrlib\cleanup.pyo", line 136, in run_simple File "bzrlib\cleanup.pyo", line 166, in _do_with_cleanups File "bzrlib\builtins.pyo", line 1438, in run File "bzrlib\controldir.pyo", line 779, in open_tree_or_branch File "bzrlib\controldir.pyo", line 459, in _get_tree_branch File "bzrlib\bzrdir.pyo", line 1082, in open_branch File "bzrlib\branch.pyo", line 2375, in open File "bzrlib\controldir.pyo", line 687, in open File "bzrlib\controldir.pyo", line 716, in open_from_transport File "bzrlib\transport\__init__.pyo", line 1718, in do_catching_redirections File "bzrlib\controldir.pyo", line 704, in find_format File "bzrlib\controldir.pyo", line 1149, in find_format File "C:/Program Files (x86)/Bazaar/plugins\git\__init__.py", line 235, in probe_transport File "C:/Program Files (x86)/Bazaar/plugins\git\__init__.py", line 182, in probe_http_transport File "socket.pyo", line 348, in read File "httplib.pyo", line 522, in read File "httplib.pyo", line 565, in _read_chunked IncompleteRead: IncompleteRead(34 bytes read) bzr 2.5.1 on python 2.6.6 (Windows-post2008Server-6.2.9200) arguments: ['bzr', 'branch', '--use-existing-dir', 'https://launchpad.net/~niemeyer/gocheck/trunk', '.'] plugins: bzrtools[2.5.0], changelog_merge[2.5.1], colo[0.4.0], explorer[1.2.2], fastimport[0.14.0dev], git[0.6.8], launchpad[2.5.1], loom[2.3.0dev], netrc_credential_store[2.5.1], news_merge[2.5.1], pipeline[1.4.0], qbzr[0.22.3], rewrite[0.6.4dev], svn[1.2.2], upload[1.2.0dev], xmloutput[0.8.8] encoding: 'cp1252', fsenc: 'mbcs', lang: None *** Bazaar has encountered an internal error. This probably indicates a bug in Bazaar. You can help us fix it by filing a bug report at https://bugs.launchpad.net/bzr/+filebug including this traceback and a description of the problem. ``` </details> There are a couple of error reports starting to show up on GitHub and on the internet regarding those dependencies. The alternative here is to provide another path to resolve the dependencies, where `bzr` is not involved. This commit uses the `replace` directive to point the transitive dependencies to HTTPS and git mirrors of the dependencies, making it possible to resolve dependencies and compile again on Windows. The other changes are caused by running `go mod tidy`.
67e789b
to
6b70578
Compare
I've updated the changeset using the steps you've mentioned and that resulted in a much smaller change. I'm still able to compile, without hitting the errors with bazaar. The versions don't exactly match, as I had to find the corresponding I was really worried of the ripple effect it could cause on providers and plugin, making it harder to contribute there now that his new dependency exists. I'm not sure how to test, but I would expect that downstream plugins don't have the issue with |
I've just replacing Terraform version on a downstream provider, which only requires Terraform, pointing to my commit. Sadly, it used the
I'll try to find which dependency introduced this requirement, and try upgrading it. Hopefully, it will be an easy bump. 🤞 |
After removing the dependency, running `go mod vendor` and `go mod tidy`, there is no more troubling dependencies left. I'm not sure why, but `go mod why` didn't show any reason for the dependency to exist. Removing it still allows the code to compile.
After running Maybe I needed to run This version of the PR does compile a provider correctly, with no need to use |
Thanks, @bltavares! After looking at this again with fresh eyes I remembered that the I'm not really sure where these indirect dependencies originally came from, and it seems reasonable for us to remove them as you propose here. If one of our dependencies does still depend on them then they'll be installed at whatever minimum version satisfies those dependencies. If you find that these still show up after upgrading the vendored SDK in a provider, you may find that placing these same |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
There are two transitive dependencies present on the current three which
are hosted on
bzr
, which increases the tooling required to compileTerraform, and fails to compile the new version on Windwos. This
affects plugin providers as well, making it harder to compile plugins
on Winows.
If
bzr
is not installed, fetching dependencies will fail:Error when Bazaar is not installed
When bazaar is installed, but running on Windows, we have a different
failure
Error executing Bazaar checkout on Windows
There are a couple of error reports starting to show up on GitHub and on
the internet regarding those dependencies.
The alternative here is to provide another path to resolve the
dependencies, where
bzr
is not involved.This commit uses the
replace
directive to point the transitivedependencies to HTTPS and git mirrors of the dependencies, making it
possible to resolve dependencies and compile again on Windows.
The other changes are caused by running
go mod tidy
.