dub icon indicating copy to clipboard operation
dub copied to clipboard

Add command-line switch --add-path

Open nordlow opened this issue 3 years ago • 8 comments
trafficstars

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.

nordlow avatar May 11 '22 08:05 nordlow

I don't think anything even remotely like add-path should be encouraged.

atilaneves avatar May 11 '22 08:05 atilaneves

How does --add-path help with reproducible builds?

dkorpel avatar May 11 '22 08:05 dkorpel

How does --add-path help 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.

nordlow avatar May 11 '22 08:05 nordlow

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.

rikkimax avatar May 11 '22 09:05 rikkimax

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.

nordlow avatar May 11 '22 09:05 nordlow

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?

WebFreak001 avatar May 11 '22 09:05 WebFreak001

I don't think anything even remotely like add-path should 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.

nordlow avatar Aug 19 '22 09:08 nordlow

How does --add-path help with reproducible builds?

It avoids file system side-effects which is the root of all evil in build systems.

nordlow avatar Aug 19 '22 09:08 nordlow