redub icon indicating copy to clipboard operation
redub copied to clipboard

redub can't build some projects with envvars

Open p0nce opened this issue 1 month ago • 6 comments

Issue: redub doesn't seem to support envvar in recipes.

To repro: checkout this example https://github.com/AuburnSounds/Dplug/tree/master/tools/latency-check

How to repro:

$ git clone [email protected]:AuburnSounds/Dplug.git
cd Dplug
cd tools
cd latency-check
redub

Probable issue within Dplug's dub.json

"stringImportPaths": [ "$VST2_SDK/pluginterfaces/vst2.x" ],

VST2_SDK being the envvar.

(Works with dub.)

p0nce avatar Nov 24 '25 09:11 p0nce

Is the env var set? Maybe I should issue an error when it is not

MrcSnm avatar Nov 24 '25 12:11 MrcSnm

Yes it is set.

p0nce avatar Nov 24 '25 12:11 p0nce

Ah this example isn't the best since you will need a hard-to-find SDK.

p0nce avatar Nov 24 '25 12:11 p0nce

I think I found it: Basically redub is only parsing env for root projects (not dependencies)

MrcSnm avatar Nov 24 '25 12:11 MrcSnm

repro.zip

Simpler repro project (run repro.bat or equivalent)

p0nce avatar Nov 24 '25 12:11 p0nce

Oh right I found it: C:\Users\Marcelo\Documents\D\redub\tests\repro\C:\Users\Marcelo\Documents\D\redub\tests\repro\simport The env is indeed being parsed. The problem, however, is that the env variable is expanding to an absolute path after stirngImportPaths were expanded to absolutes, thus, making that strange looking path

MrcSnm avatar Nov 24 '25 12:11 MrcSnm

Fixed: Env pass for path absolutization only happens a single time and it only happens once, thus also making it a little bit faster and more correct

MrcSnm avatar Nov 24 '25 13:11 MrcSnm

THANKS!!!

p0nce avatar Nov 24 '25 14:11 p0nce