MrcSnm / redub

Alternative implementation of dub, speed and consistency oriented
https://code.dlang.org/packages/redub
MIT License
37 stars 8 forks source link

Support redub -{q|v} {build|test|...} #31

Closed nordlow closed 6 days ago

nordlow commented 6 days ago

Currently

redub build|test -v

works whereas

redub -v build|test

fails as, for instance,

redub -v test 
Parsing ~/Work/gmp-d/dub.sdl at ~/Work/gmp-d with : -c 
Added project gmp-d to memory cache.
Dependencies resolved - 6 ms "debug" using /usr/bin/dmd v2.110.0-beta.1 [linux-x86_64] - no parallel
Project gmp-d Dirty Files: ["~/Work/gmp-d/src"]
Built: gmp-d [unittest] - 82ms

    /usr/bin/dmd '-color=on' -op -vcolumns '-checkaction=context' '-preview=dip1000' '-Xcc=-fuse-ld=lld' -debug -g '-version=gmp_test' '-version=Have_gmp_d' -I~/Work/gmp-d/src ~/Work/gmp-d/src/gmp/traits.d ~/Work/gmp-d/src/gmp/z.d ~/Work/gmp-d/src/gmp/f.d ~/Work/gmp-d/src/gmp/package.d ~/Work/gmp-d/src/gmp/q.d -lib '-of=/home/per/.dub/.redub/0617393430CB1BF5/0617393430CB1BF5/libgmp-d.a' 

Finished gmp-d - 82ms - To force a rebuild of up-to-date targets, run again with --force
Error Program exited with code 1

.

Both cases are supported by dub.

The same change should happen for

redub -q test

and maybe other flags.

MrcSnm commented 6 days ago

This one works for me, when I fixed that issue, I solved in a generic way

PS C:\Users\Marcelo\Documents\D\redub\package_manager> redub -v build
Parsing C:\Users\Marcelo\Documents\D\redub\package_manager\dub.json at C:\Users\Marcelo\Documents\D\redub\package_manager with : -c 
Added project package_manager to memory cache.
Parsing C:\Users\Marcelo\Documents\D\redub\hipjson\dub.json at C:\Users\Marcelo\Documents\D\redub\hipjson with : -c
Parsing C:\Users\Marcelo\Documents\D\redub\semver\dub.json at C:\Users\Marcelo\Documents\D\redub\semver with : -c
Dependencies resolved - 15 ms "debug" using C:\D\dmd2\windows\bin64\dmd.exe v2.110.0-beta.1 [win64-x86_64] - full parallel
Up-to-Date: package_manager; hipjson; semver;
Up-to-Date: package_manager, skipping linking
Finished package_manager - 3ms - To force a rebuild of up-to-date targets, run again with --force
nordlow commented 6 days ago

This one works for me, when I fixed that issue, I solved in a generic way

PS C:\Users\Marcelo\Documents\D\redub\package_manager> redub -v build
Parsing C:\Users\Marcelo\Documents\D\redub\package_manager\dub.json at C:\Users\Marcelo\Documents\D\redub\package_manager with : -c 
Added project package_manager to memory cache.
Parsing C:\Users\Marcelo\Documents\D\redub\hipjson\dub.json at C:\Users\Marcelo\Documents\D\redub\hipjson with : -c
Parsing C:\Users\Marcelo\Documents\D\redub\semver\dub.json at C:\Users\Marcelo\Documents\D\redub\semver with : -c
Dependencies resolved - 15 ms "debug" using C:\D\dmd2\windows\bin64\dmd.exe v2.110.0-beta.1 [win64-x86_64] - full parallel
Up-to-Date: package_manager; hipjson; semver;
Up-to-Date: package_manager, skipping linking
Finished package_manager - 3ms - To force a rebuild of up-to-date targets, run again with --force

I don't follow. Are you saying you can't or won't fix this?

MrcSnm commented 6 days ago

I've said that is working:

Parsing ~/Work/gmp-d/dub.sdl at ~/Work/gmp-d with : -c 
Added project gmp-d to memory cache.
Project gmp-d Dirty Files: ["~/Work/gmp-d/src"]

Those output are verbose from your code shared here, even the build command is supposed to show only in verbose mode. I don't understand what is the issue you're having

nordlow commented 6 days ago

I'm saying that, for instance, for gmp-d on commit 50f31285d709ad4957e7ecca6e1a1b615826b625,

redub test -q
3 modules passed unittests

whereas

redub -q test 
Error Program exited with code 1

. Both these cases are supported by dub and redub should support them both too for conformance.

MrcSnm commented 6 days ago

I have detected only a problem in the SDL -> JSON parser, which I'll fix, I'll release it under a new version. Feel free to try it

Check on version v1.16.1

nordlow commented 6 days ago

My wrapper scripts containing

DC="${DC:-$(command -v ldc2 >/dev/null 2>&1 && echo ldc2 || echo dmd)}"
exec dub -q run --build=release --compiler="${DC}" redub@~main -- "$@"

was running an old (1.14) version of redub. I've changed it to instead do

DC="${DC:-$(command -v ldc2 >/dev/null 2>&1 && echo ldc2 || echo dmd)}"
exec dub -q run --build=release --compiler="${DC}" redub -- "$@"

. Sorry for this.