Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.16k stars 539 forks source link

Suggestion: Add flag to disable "auto subpackage resolving" #1063

Open lorenmh opened 4 years ago

lorenmh commented 4 years ago

I am trying to install github.com/elastic/go-elasticsearch, which uses go modules. In their go.mod file, they name their package github.com/elastic/go-elasticsearch/v7 (note the added v7 for namespacing).

However, this does not work with glide.

When I try to get glide to install github.com/elastic/go-elasticsearch to vendor/github.com/elastic/go-elasticsearch/v7 (note the v7 in the install path), with the following in glide.yaml:

- package: github.com/elastic/go-elasticsearch/v7
  repo: git@github.com:elastic/go-elasticsearch
  version: v7.4.1

This magically is changed to the following in the glide.lock:

- name: github.com/elastic/go-elasticsearch
  version: d8acaa5faade05290d8b500b8f3892a378f2d2e7
  repo: git@github.com:elastic/go-elasticsearch
  subpackages:
  - v7

However, I do not want the name to change. I want it to stay as github.com/elastic/go-elasticsearch/v7. Ie, I want the following in my glide.lock:

- name: github.com/elastic/go-elasticsearch/v7
  version: d8acaa5faade05290d8b500b8f3892a378f2d2e7
  repo: git@github.com:elastic/go-elasticsearch

Suggestion: please allow us to disable the automatic path-to-subpackage behavior. Ie, maybe the following glide.yaml should keep the name field the same in the lock file:

- package: github.com/elastic/go-elasticsearch/v7
  repo: git@github.com:elastic/go-elasticsearch
  version: v7.4.1
  subpackages: []

or

- package: github.com/elastic/go-elasticsearch/v7
  repo: git@github.com:elastic/go-elasticsearch
  version: v7.4.1
  auto_subpackage_resolution: false