Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Pipeline looks for temp folder env variable which is not present on *nix machines #168

Closed
suhasj opened this issue Jan 15, 2015 · 10 comments
Assignees
Milestone

Comments

@suhasj
Copy link
Contributor

suhasj commented Jan 15, 2015

The BufferingHelper tries to get the path to the temporary folder by reading the environmental variables 'ASPNET_TEMP' and 'TEMP'. Code
The issue is *nix machines don't have the mandatory 'TEMP' variable set by default.

@Tratcher @Praburaj discussed that Path.GetTempPath was not advised to be used while Environment.SpecialFolder is not present for Core CLR.

This leaves us with two options

  • Find a variable similar to 'TEMP' which is set by default and read the path value from there
  • Document this and have administrators set this variable on the machines.

The second one I am not comfortable with while the first one, I was not able to get a consistent variable that is similar to 'TEMP'. The OSX has 'TMPDIR' but this is not present in Linux machines. With the latest bits, running applications without either of these variables set results in error which are not very obvious either. Can we come at a consensus on what the guidelines should be ?

@davidfowl
Copy link
Member

Mono's implementation of Path.GetTempPath() - https://github.com/mono/mono/blob/master/mcs/class/corlib/System.IO/Path.cs#L468

@muratg
Copy link

muratg commented Mar 6, 2015

@Praburaj Can you have a look?

@Praburaj
Copy link
Contributor

Praburaj commented Mar 6, 2015

@muratg sure.

@akoeplinger
Copy link

To save everyone a few clicks, this is what Mono ends up doing: https://github.com/mono/mono/blob/effa4c07ba850bedbe1ff54b2a5df281c058ebcb/eglib/src/gmisc-unix.c#L132-L151

@Praburaj
Copy link
Contributor

Praburaj commented Mar 6, 2015

I have a proposal on this to check for folders in the following order (1 & 2 is what we have today).

  1. ASPNET_TEMP - User set location for ASP.NET apps
  2. TEMP - Works on windows points to appdata\local
  3. TMPDIR - works on Mac and some linux distributions like Ubuntu
  4. TMP
  5. /tmp Looks like this is a recommendation - http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES

Thoughts?

@davidfowl
Copy link
Member

I like it. I would file a bug on the corefx repository with this as well. Ideally we'd use Path.GetTempPath() and it would do the right thing.

ASPNET_TEMP can be used to override if course.

@Praburaj
Copy link
Contributor

Praburaj commented Mar 9, 2015

@Tratcher I remember you mentioning that Path.GetTemppath is not used here to avoid falling back to userprofile. Are you okay if I just change code to use Path.GetTempPath and just check for %ASPNET_TEMP% before?

@Tratcher
Copy link
Member

Tratcher commented Mar 9, 2015

Ask @GrabYourPitchforks

@Praburaj
Copy link
Contributor

@davidfowl - I talked with @GrabYourPitchforks on this. I think it is okay to use Path.GetTempPath as long as we check for ASPNET_TEMP first. I'll update the PR with this change.

@davidfowl
Copy link
Member

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants