gofed / go-macros

Rpm mechanics for Go packaging
4 stars 7 forks source link

Add a flag to exclude Go packages that import a specific import path #35

Closed nim-nim closed 5 years ago

nim-nim commented 6 years ago

For bootstrapping it is usually necessary to disable everything that relies on other import paths, that are not available yet (but need the built package for their own build)

Likewise part of a Go project may use an import path, we don't want to exist in the distribution

Therefore, I'd like golist to support an -x --exclude-import-path that removes from its output any element that imports the excluded import path.

At least for checks and maybe for install and requires

Repeatable flag like the others

ingvagabund commented 6 years ago

For bootstrapping it is usually necessary to disable everything that relies on other import paths, that are not available yet (but need the built package for their own build)

Do you have a real-life example? In what context do you interpret "not available yet"? Can you more elaborate on the first paragraph?

nim-nim commented 6 years ago

For example you want to build docker-x that tests docker-y but the docker-y package itself has docker-x as buildrequires

So you do a bootstrap, where you exclude all tests in docker-x that import docker-y to build a limited version of docker-x, use it to build the docker-y package, and then rebuild docker-x in full mode

There are lots of such bootstrap examples in the specs I posted to the list.

nim-nim commented 5 years ago

Migrated to https://pagure.io/golist/issue/11