dub
dub copied to clipboard
Querying dub with --print-builds or --print-configs builds the package
System information
- dub version: 1.32.1
- OS Platform and distribution: Manjaro/Arch x86_64
- compiler version ldc 1.32.1, dmd 2.104.0
Bug Description
It is not possible to query dub --print-builds nor --print-configs without it starting to build the package.
How to reproduce?
- Be someone unfamiliar with dub and do
dub --help, which faithfully displays the help screen without the build process starting - See mention of
--print-buildsand--print-configs, and invoke dub with either to learn more about the package and the build system to plan your build - The required information is displayed, but the default build configuration starts building while you're trying to read
- In the worst-case scenario, you're on a memory-constrained system, dub starts building a non
-lowmemconfiguration and the system is now dead to the world swapping to an sdcard until the OOM killer finally kicks in 20 minutes later (has happened on a Raspberry Pi and is why I'm filing this)
Expected Behavior
--print-configsand--print-buildsexhibits behaviour consistent with--help, and only prints the information requested before exiting
Logs
$ dub --print-configs
Available configurations:
application [default]
application-lowmem
lowmem
twitch
twitch-lowmem
dev
dev-lowmem
unittest
unittest-lowmem
Starting Performing "debug" build using /usr/bin/dmd for x86_64.
Building arsd-official:characterencodings 10.9.10: building configuration [library]
Building arsd-official:dom 10.9.10: building configuration [library]
Building arsd-official:http 10.9.10: building configuration [with_openssl]
Building lu 1.2.5: building configuration [library]
Deprecation: `-dip25` no longer has any effect
Building dialect 2.0.2: building configuration [bot]
Deprecation: `-dip25` no longer has any effect
Deprecation: `-dip25` no longer has any effect
Building automem 0.6.9: building configuration [library]
../../.dub/packages/automem-0.6.9/automem/source/automem/vector.d-mixin-211(211,7): Deprecation: cannot throw object of qualified type `immutable(BoundsException)`
../../.dub/packages/automem-0.6.9/automem/source/automem/vector.d-mixin-211(211,7): Deprecation: cannot throw object of qualified type `immutable(BoundsException)`
Building cachetools 0.4.1: building configuration [library]
Building requests 2.0.9: building configuration [std]
Building kameloso 3.9.0+commit.79.gb997750f5: building configuration [application]
Deprecation: `-dip25` no longer has any effect
Deprecation: `-dip25` no longer has any effect
Deprecation: `-dip25` no longer has any effect
Deprecation: `-dip25` no longer has any effect
Linking kameloso
Running kameloso
[...]
To perform a dry run use the flag: --annotate.
As to if the default behavior is correct for those flags, idk.
Disclaimer: I did not look at the source.
Is --annotate fully implemented? In many cases it seems ignored outright.
Trying with the various dub verbs:
run: silently exits, outputs nothingbuild: silently exits, outputs nothingtest: proceeds to test despite--annotatelint: silently exits, outputs nothinggenerate: silently exits, outputs nothingdescribe: proceeds to describe despite--annotateclean: proceeds to clean despite--annotatedustmite: proceeds to dustmite despite--annotatefetch: proceeds to fetch despite--annotateadd: proceeds to add despite--annotateremove: proceeds to remove despite--annotateupgrade: proceeds to upgrade despite--annotateadd-path: did not testremove-path: did not testadd-local: silently exits, outputs nothingremove-local: silently exits, outputs nothingsearch: proceeds to search despite--annotateadd-override: did not testremove-override: did not testlist-overrides: did not testclean-caches: did not testconvert: proceeds to convert despite--annotate
At no point did it say what would be done as the flag description suggests. In this limited testing --annotate only seemed to have any sort of use with things like --print-builds and --print-configs (that in turn do not make sense unless used with it).