conda-forge / arrow-cpp-feedstock

A conda-smithy repository for arrow-cpp.
BSD 3-Clause "New" or "Revised" License
10 stars 62 forks source link

Activating read-only conda environment with arrow installed #1126

Closed costrouc closed 1 year ago

costrouc commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

When we create a conda environment with this package installed in a read-only environment I get the following error when I attempt to activate the environment.

mkdir: cannot create directory ‘/home/conda/rag-llm/envs/rag-llm-ai-toolbox/share/gdb/auto-load//home/conda/rag-llm/envs’: Permission denied
ln: failed to create symbolic link '/home/conda/rag-llm/envs/rag-llm-ai-toolbox/share/gdb/auto-load//home/conda/rag-llm/envs/rag-llm-ai-toolbox/lib/libarrow.so.1100.0.0-gdb.py': No such file or directory
/home/conda/rag-llm/envs/rag-llm-ai-toolbox/etc/conda/activate.d/libarrow_activate.sh ERROR: Failed to create symlink from '/home/conda/rag-llm/envs/rag-llm-ai-toolbox/share/gdb/auto-load/replace_this_section_with_absolute_slashed_path_to_CONDA_PREFIX/lib/libarrow.so.1100.0.0-gdb.py' to '/home/conda/rag-llm/envs/rag-llm-ai-toolbox/share/gdb/auto-load//home/conda/rag-llm/envs/rag-llm-ai-toolbox/lib/libarrow.so.1100.0.0-gdb.py'

Installed packages

Not relevant.

Environment info

Not relevant.
h-vetinari commented 1 year ago

Can you try if arrow 12 works for you? If so, we just have to backport some of the fixes for the activation script to 11.0.x

kcpevey commented 1 year ago

@h-vetinari The same thing is happening with pyarrow 12.0.0 when I run conda activate.

conda activate argo
mkdir: cannot create directory ‘/home/conda/argo/share/gdb/auto-load//home/conda/envs’: Permission denied
ln: failed to create symbolic link '/home/conda/argo/share/gdb/auto-load//home/conda/argo/lib/libarrow.so.1200.1.0-gdb.py': No such file or directory
/home/conda/argo/etc/conda/activate.d/libarrow_activate.sh ERROR: Failed to create symlink from 'argo/share/gdb/auto-load/replace_this_section_with_absolute_slashed_path_to_CONDA_PREFIX/lib/libarrow.so.1200.1.0-gdb.py' to '/home/conda/argo/share/gdb/auto-load//home/conda/argo/lib/libarrow.so.1200.1.0-gdb.py'
h-vetinari commented 1 year ago

@maresb, this sounds similar to your #1032. Since you did all the work on #1033 & #1065, perhaps you'd be interested/able to help on this?

maresb commented 1 year ago

Given the current setup, I don't see any way that a read-only environment can be supported for first-time activation.

Maybe a workaround could be to activate the environment once before making it read-only?

h-vetinari commented 1 year ago

Given the current setup, I don't see any way that a read-only environment can be supported for first-time activation.

If you remove the requirement to create the symlink, we should be able to make it work I think? Few people will use gdb, probably fewer than those stuck in read-only environments. I'd prefer to remove gdb-integration before breaking the latter. But if we can just bail out when we have no rights, that would be the best of both worlds.

h-vetinari commented 1 year ago

I think this is what we were doing with 7c0287a84ba8303b12c97e397f2b24a0239b6b46, but that got removed in 5f86221f52fe439eec67d703ed5305e15a82f86d

h-vetinari commented 1 year ago

@maresb if you have a moment, please take a look at #1127 :)

costrouc commented 1 year ago

Thanks everyone!

h-vetinari commented 1 year ago

We also backported to 11.x and 10.x. :)