Closed VPanteleev-S7 closed 8 months ago
dub fetch package@1.2.3
dub run package@1.2.3
and add-local beforehand and using dub run package@1.2.3
should also work, did it not?
dub fetch package@1.2.3
How to do this step without Internet access, if we have a copy of the package?
no need to run it at all, just only do the add-local one and it should work.
Sorry, I don't understand what you mean. It doesn't work.
$ mkdir some-temp-directory && cd some-temp-directory
$ wget https://code.dlang.org/packages/dpp/0.5.5.zip
...
$ unzip 0.5.5.zip
...
$ HOME=$PWD dub add-local dpp-0.5.5 0.5.5
Registered package: dpp (version: 0.5.5)
$ HOME=$PWD bwrap --dev-bind / / --unshare-net dub run dpp@0.5.5
Warning Package dpp not found for registry at https://code.dlang.org/ (fallbacks registry at https://codemirror.dlang.org/, registry at https://dub.bytecraft.nl/, registry at https://code-mirror.dlang.io/): Failed to download https://code.dlang.org/api/packages/infos?packages=%5B%22dpp%22%5D&include_dependencies=true&minimize=true
Error No package dpp was found matching the dependency 0.5.5
(HOME=$PWD
makes Dub use a fresh ~/.dub
, bwrap --dev-bind / / --unshare-net
effectively disables Internet access)
@VPanteleev-S7 : Thanks for the test case. Fix is here: https://github.com/dlang/dub/pull/2787
Awesome, thank you!
Consider the situation:
dub run
run
)So, if the script runs
dub run some-package@1.2.3
, we should be able to usedub add-local path/to/our/version/of/package 1.2.3
first to make the former command use the version specified in the latter command.Alternatively, a hypothetical
dub install --version=1.2.3
could install the package from the current directory into Dub's cache, so thatdub run
would then use it.