features icon indicating copy to clipboard operation
features copied to clipboard

Feature trigger installation of older / unwanted version of packages, i.e. rust install lldb default for ubuntu even when higher version installed

Open ykoehler opened this issue 1 year ago • 2 comments

This is not particular to rust feature, but I have a docker image using clang-18, lldb-18, etc. The default for Ubuntu 20.04 is clang-10, lldb-10, etc.

When I add the rust feature I get the wrong version installed because apt install lldb doesn't seem to be aware that lldb-18 already met that requirement.

I think this is more an apt issue than a devcontainer but I am hitting this issue most with devcontainer features since they are not aware of the pre-existing installation.

One potential solution is to have a LLVM version variable added to rust so that it tries to install the desired version (18 in this case) instead of the default lldb.

Another option would be for rust not to install lldb if not requested.

I was wondering if there was a solution at the apt level where I could tell apt that "lldb" is same as "lldb-18" as to preven this for non llvm recipe as well if I detect similar issue.

ykoehler avatar Jan 25 '24 19:01 ykoehler

I could also copy the rust feature as a local feature to my image to control the llvm version being installed, yet I may not be the only one having this issue which results in bigger image size than required.

ykoehler avatar Jan 25 '24 19:01 ykoehler

Hi 👋

Thanks for raising this issue, I can understand that apt reinstalling a package (which sometimes leads to downgrading) can be super problematic.

One potential solution is to have a LLVM version variable added to rust so that it tries to install the desired version (18 in this case) instead of the default lldb. Another option would be for rust not to install lldb if not requested.

These are great solutions, but I think we should avoid adding Feature options for such trivial purpose unless we think there's no other solution to fix it.

I was wondering if there was a solution at the apt level where I could tell apt that "lldb" is same as "lldb-18" as to preven this for non llvm recipe as well if I detect similar issue.

This makes sense to me, and I agree we should find a solution at a Feature level to avoid such downgrades.

In the meanwhile, @ykoehler would it be possible to take advantage of apt-mark hold command? I believe adding the following command 👇 in your Dockerfile should stop apt manager from reinstalling lldb and downgrading it.

sudo apt-mark hold lldb-18

Let us know if this works for you, in the meanwhile I will look into possible solutions to fix at Feature level.

samruddhikhandale avatar Jan 26 '24 19:01 samruddhikhandale