-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dub add-local
should affect dub run
#2706
Comments
and add-local beforehand and using |
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 ( |
The code was overly complicated and failed to do what it intended. If a version was provided, it would always call 'fetch' even though getBestPackage would have returned something. Assuming that sub-packages are always present is also not working, as the following would fail: $ rm -rf ~/.dub/packages/vibe-d && dub run vibe-d:data Warning Package 'vibe-d:data' was neither found locally nor online. The new code is both shorter and simpler, taking advantage of the various improvements made to the APIs over the year (for example, getBestPackage with VersionRange.Any does the right thing).
The code was overly complicated and failed to do what it intended. If a version was provided, it would always call 'fetch' even though getBestPackage would have returned something. Assuming that sub-packages are always present is also not working, as the following would fail: $ rm -rf ~/.dub/packages/vibe-d && dub run vibe-d:data Warning Package 'vibe-d:data' was neither found locally nor online. The new code is both shorter and simpler, taking advantage of the various improvements made to the APIs over the year (for example, getBestPackage with VersionRange.Any does the right thing).
@VPanteleev-S7 : Thanks for the test case. Fix is here: #2787 |
The code was overly complicated and failed to do what it intended. If a version was provided, it would always call 'fetch' even though getBestPackage would have returned something. Assuming that sub-packages are always present is also not working, as the following would fail: $ rm -rf ~/.dub/packages/vibe-d && dub run vibe-d:data Warning Package 'vibe-d:data' was neither found locally nor online. The new code is both shorter and simpler, taking advantage of the various improvements made to the APIs over the year (for example, getBestPackage with VersionRange.Any does the right thing).
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.The text was updated successfully, but these errors were encountered: