I’ve been toying with the idea using a confined snap as a fast way to set up a specific development environment (tool chain, dependencies, etc.) for particular pieces of work. E.g. for a workshop.
Snap packaging makes it easy to set up across distros and series, and confinement avoids it causing any issues on the host systems.
I had a brief try, but quickly found issues:
$ g++ hello_world.cpp
In file included from /snap/miroil-dev-env/x7/usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:482:0,
/snap/miroil-dev-env/x7/usr/include/x86_64-linux-gnu/c++/5/bits/os_defines.h:39:22: fatal error: features.h: No such file or directory
Before spending time investigating such problems and devising my own solutions, I wondered if anyone else has been down this road and what they might have found?
it ships a toolchain and all necessary/possible headers for npm to actually build modules inside the snap env. on the fly
Key are the env variables as well as managing the gcc symlink (that is usually set by update-alternatives which is omitted in stage-packages)