conda-forge / dotnet-feedstock

A conda-smithy repository for dotnet.
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Test if env vars are correctly set (unresolved for v5 & v6) #13

Open dhirschfeld opened 3 years ago

dhirschfeld commented 3 years ago

Something like:

if not "%DOTNET_ROOT%"=="%PREFIX%\dotnet" exit 1 
dhirschfeld commented 3 years ago

Possibly better:

if "%DOTNET_ROOT%" neq "%PREFIX%\dotnet" exit 1 
acesnik commented 3 years ago

I'm running into some issues on macOS with DOTNET_ROOT, which causes running dotnet to fail.

$ conda install -c conda-forge dotnet
$ dotnet
/opt/anaconda3/envs/test/bin/dotnet: line 2: /dotnet: No such file or directory
$ printenv | grep DOTNET
$ echo $?
1
acesnik commented 3 years ago

I made some pull requests with setting DOTNET_ROOT within the small executable script to get around this for now.

https://github.com/conda-forge/dotnet-feedstock/pull/23 https://github.com/conda-forge/dotnet-feedstock/pull/24 https://github.com/conda-forge/dotnet-feedstock/pull/25

acesnik commented 3 years ago

I think I figured out this issue!

macOS and linux have slightly different cp commands, so the environment variable scripts weren't actually making it into the right folders (https://twilblog.github.io/macos/linux/cp/copy/2017/02/03/macos-unix-cp-madness.html).

dhirschfeld commented 2 years ago

Examples testing for existence: https://github.com/conda-forge/dotnet-interactive-feedstock/blob/4a9aab82c93e921b6e751dd90e0a964dccb51339/recipe/meta.yaml#L27-L28

acesnik commented 2 years ago

Trying that out here, it doesn't look like it's working for osx, https://github.com/conda-forge/dotnet-feedstock/pull/44.

The bash command you used works on osx terminal, and the string in question certainly isn't length zero. Not sure what's going on. 😅

acesnik commented 2 years ago

For an update on this, I believe this is working for v3, but the solution doesn't work for v5 or v6 the last time I checked.

dhirschfeld commented 2 years ago

Thanks - sorry I haven't had time to dig into it (yet)!

acesnik commented 2 years ago

No worries!