Inline apt source generation in rootfs script#14849
Conversation
|
These scripts are mainly for our own usage so if all of the distros we support can handle it I'm fine :) |
|
Yup, these days we can use this script to also setup a cross-builder image for nativeaot dotnet/runtime#97729 (comment). With this change, RUN mkdir /dev/arm; \
curl -sSL https://raw.githubusercontent.com/dotnet/arcade/main/eng/common/cross/arm/sources.list.jammy -o /dev/arm/sources.list.jammy; \
curl -sSL https://raw.githubusercontent.com/dotnet/arcade/main/eng/common/cross/build-rootfs.sh |\
bash /dev/stdin arm jammy llvm15 lldb15will shrink down to: RUN mkdir /dev/arm; \
curl -sSL https://raw.githubusercontent.com/dotnet/arcade/main/eng/common/cross/build-rootfs.sh |\
bash /dev/stdin arm jammy llvm15 lldb15 |
|
Testing in CI dotnet/dotnet-buildtools-prereqs-docker#1102. |
|
dotnet/dotnet-buildtools-prereqs-docker#1102 is green, so it's working as before. Needed to make some adjustments here to make it work. @akoeplinger, @janvorli, @sbomer, PTAL. |
|
@gbalykov, FYI. We can also inline Tizen script and using heredoc syntax, the patches could be inlined as well (to make this script completely freestanding). |
| fi | ||
| __UseDeb822Format=1 | ||
| if [[ -n "$__LLDB_Package" ]]; then | ||
| __LLDB_Package="liblldb-18-dev" |
There was a problem hiding this comment.
I don't really understand why and when we set __LLDB_Package for the various distros, would you mind explaining?
There was a problem hiding this comment.
When we invoke build-rootfs.sh <arch> <codename> lldbX, it uses liblldb-X-dev. When we don't provide lldbX, it uses the default 3.9. llvm/lldb v3.9 is not available in 24.04 (noble), so I'm changing its default. We have used noble branch only for riscv64 until now, where lldb is not yet available in debian/ubuntu packages.
The current approach of setting defaults, parsing args, overriding defaults based on arguments, then figuring out the "order" of args (what makes sense for overriding and when) is very twisted. I think we should refactor this script and define presets: combination of mandatory arguments. And remove all default/overriding handing. It will be a bit verbose, but it will make things readable for someone trying to work with it.
There was a problem hiding this comment.
Ok thanks, I agree we should refactor the defaults.
@am11 Thanks for sharing information! We'll probably work on this a bit later, busy with other tasks right now, cc @dotnet/samsung |
All our supported distros support deb822 format (circa 2015 onwards). Inline the contents of those redundant files and simplify code.
cc @akoeplinger @sbomer needs a few more tests on raspberry pi etc. help would be appreciated. :)