Skip to content

windows: dub won't run if TEMP is unset or empty #2190

@huglovefan

Description

@huglovefan

System information

  • dub version: dub 1.27.0
  • OS Platform and distribution: Windows 7 64-bit
  • compiler version dmd 2.098.0

Bug Description

if the TEMP environment variable is missing or has an empty value, dub will error out with Environment variable not found on startup

How to reproduce?

in command prompt:

  1. set TEMP=
  2. dub --help

Expected Behavior

should work the same as with TEMP=. or with the proper value (C:\Users\qemu\AppData\Local\Temp)

Logs

i'm getting this when running dub through cygwin sshd:

% ssh qemu_win7 'dub --help'

object.Exception@std\process.d(217): Environment variable not found: TEMP
----------------
0x0033C37B
0x0033C132

i think this is the place it's failing:

https://github.com/dlang/dub/blob/4906205/source/dub/commandline.d#L396 (added in 4609540)

is that workaround still needed? i have no problems running rdmd inside cygwin with TEMP=/tmp (or unset) and all the paths printed by rdmd --dry-run are backslash-separated already

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomers to fix in a PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions