dub
dub copied to clipboard
Add command-line switch --add-path
For the sake of reproducible builds, add a command-line flag, say --add-path=DIR, that does what dub add-path DIR does but without side-effects for other (subsequent or concurrent) dub invocations. The naming --add-path is just a suggestion on my side and could just as well be --package-path=DIR.
See https://dub.pm/commandline.html#add-path.
I don't think anything even remotely like add-path should be encouraged.
How does --add-path help with reproducible builds?
How does
--add-pathhelp with reproducible builds?
It wouldn't make any changes to the file system opposite to what dub add-path does. Thereby avoiding the risk for concurrent dub invocations to step on each others feet.
This could be an environment variable. In essence, it could be akin to pushd/popd.
It would also be a lot less work to add, since you don't have to deal with any of the process commands directives.
This could be an environment variable. In essence, it could be akin to pushd/popd.
It could but I believe command-line-switches should be preferred over environment variables as they are always visible.
add-path is only really for debugging purposes / locally working on a dependency and testing with other projects.
if you are working on something with an explicit path permanently (e.g. git submodule) you should specify dependencies with the path set to where to load them from.
Can you describe your use-case that you need something in-between these two options?
I don't think anything even remotely like
add-pathshould be encouraged.
If so why hasn't add-path already been removed from dub?
Non-functional ways, in this case add-path opposite to --add-path, is IMO the root of all evil in build systems.
How does
--add-pathhelp with reproducible builds?
It avoids file system side-effects which is the root of all evil in build systems.