dub icon indicating copy to clipboard operation
dub copied to clipboard

--bare only reads packages in subdirectories, not the current directory

Open tofuninja opened this issue 8 years ago • 3 comments

For example, if you do "dub list --bare" in a package directory it lists nothing instead of listing the package in the current directory.

tofuninja avatar Jan 26 '17 20:01 tofuninja

Works for me:

$ dub add-path .
$ dub list --bare

Make sure that your package are in the package search path (such path can be added with dub add-path).

AntonMeep avatar Sep 13 '17 13:09 AntonMeep

I'm trying to come to term with what bare is supposed to be doing. Currently, as the implementation stands, --bare means: "use CWD as the root path for our PackageManager". This means that if you are in the vibe-d folder, dub --bare build will not work. You need to cd ../ && dub --bare build vibe-d for it to work. Which is IMO pretty weird.

The --bare option seems to stems from two needs source:

  • Need for an isolated environment;
  • Need for fast startup times;

Regarding fast startup times, it's a problem we need to solve anyways. Regarding the isolated environment, we have a plethora of options on how to specify suppliers / package path. I think unifying all of those under the same umbrella makes more sense, and would remove the need for --bare itself.

Geod24 avatar Jul 28 '22 14:07 Geod24

I think we only really need documentation on what bare really does. I think having a tool for building in isolated environments with manually fetched dependencies is a good idea and should not be removed.

For the directory layout how bare works right now I always instead used to use the dub dustmite --test-package=x command, which is only really designed to be used by dub dustmite as the command that runs a build for the dustmite test. I think knowing about dub build --bare for this instead opens up more possibilities. (can test, can manipulate dub build flags, etc)

The fast startup times are really only a nice side effect I think. When you know exactly what your dependencies are and provide them yourself, a lot of checks aren't needed.

I could see there being a bunch of programs which rely on the current --bare flag to do custom build things in an isolated environment, e.g. for testing for differences between builds. So I think how the bare flag works right now is fine and should be kept in.

WebFreak001 avatar Jul 28 '22 14:07 WebFreak001