Closed cgrothaus closed 6 months ago
Hi @danielbraun89, any idea on how to proceed with this issue? What do you think of the two options?
@cgrothaus Apologies for my late response, I had a lot on my plate this month Also thank you for putting the options in a clear way. Between those two I think the choice is easy and would be definitely Option #2 (remove WX and openjdk entirely ) simply because selecting the specific packages for each distribution is just not scalable. However such an action will probably force a major version update for the feature (as people who used to rely on the feature for java installation will have a broken environment). Also the recommendation to add openJDK and WX installation in the dockerfile, while necessary and correct from design point of view, will be counter-intuitive to the devcontainer feature dogma (after all , if the user already tweaks his Dockerfile he may as well install elixir and be done with it.)
The important point however, like you said, is the feature as it is currently implemented is inherently flawed. It fits only apt-get supporting distros (the use of apt-get at all is a major constraint, but even the bash sheband on install.sh
as you mentioned, will break in alpine), so it seems like a whole refactor of this feature and many others is unavoidable.
As a short term middle ground I propose a use of apt-get wildcards as workaround that will keep the feature behaving in the same way in the short term. While I aware these will also break in the future no doubt, at least it buys more time for a deeper rethink about multi-distro support.
I have currently tested the following : libwxgtk3.*-dev
, libwxgtk-webview3.*-dev
and openjdk-1*-jdk
with the following: debian-11
, debian-12
, ubuntu-22.04
and ubuntu-20.04
and I seem to get a buildable environment in each
I have added these images as separate feature tests as well
please try ghcr.io/devcontainers-contrib/features/elixir-asdf:2.0.19
Thank you so much for taking the time to dig into this. Your intermediate solution of using apt-get wildcards sounds ok to me. Version 2.0.19
works for me 👍 .
Feature id and version
ghcr.io/devcontainers-contrib/features/elixir-asdf:2
Devcontainer base Image
mcr.microsoft.com/devcontainers/base:debian
What happened?
Summary
Installation of
elixir-asdf
feature fails on a Debian base image.Reason: it wants to install Ubuntu specific apt packages.
Details
This is the relevant line from the log output:
The command 'apt-get install -y --no-install-recommends build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk procps' failed. error: Return Code: 100.
When I execute that apt command manually in a shell inside a fresh dev container, I get this output:
So, the offending packages are
I searched around a bit:
From that output, I guess the relevant package names on Debian 12 are
Further steps
I don't know how to proceed best from here. I see at least two options.
1. Make the apt package names distro (and version) specific
This means to check whether we are on Ubuntu or on Debian. It also needs to take the version into account, as the package names are again different on Debian 11, for example.
Also, the current
install.sh
does not take Alpine base images into account, but that's another story.2. Omit wxWidgets and Java
This means to forgo installing these packages automatically. After all, they are marginal aspects IMHO.
It could be stated in the feature README that if you want to compile Erlang with wX or Java bindings, you have to add those packages to your Dockerfile.
Relevant log output