Closed loopyd closed 5 months ago
This part of the PR helps address stability issues with package installation during dependency autoresolution, such as 404 errors and down endpoints.
_install_pkg
and _remove_pkg
now retry up to 3 times, triggering some additional functionality on the repeat attempts to attempt to resolve the problem.
This can help if your internet happens to have a hiccup, or on the repo maintainer's side, someone trips a cable. ;)
Inclusion of mirror autoresolution with apt-smart
on debuntu systems with language code autodetection for the closest mirror using LANGUAGE
, LANG
and LC_ALL
. The code contains forks for the other OS's to perform automatic update of the mirrors, but no functionality is implemented for those distros yet. Mirror update is triggered during the second and third retry installation of a dependency to try to attempt to find a working mirror that contains the package that was missing or not found.
This stability improvement actually got the build working again in ubuntu:jammy
when canonical broke some things in jammy's main repo this morning (missing packages in security when going for docbook-utils
), and can help with that in the future by using mirrors to download packages when they 404 out.
The build now aborts from build.sh
and from nonmakepkg_build.sh
when if specified, properly when _nonmakepkg_dependency_autoresolver="true"
, the operation fails and prompts the user to check the output.
Getting happy with the stability of the results, I stop for the day when I have a build success. Suggestion to add conditional dependency installation as done in PKGBUILD for arch to populate the arrays by checking the user's provided config. (for example, include libwayland-dev
when _wayland_driver="true"
. This will introduce additional complexity so is up to the project maintainers.
Let's go! Thanks loopyd ! :frog: :heart:
PR Tier: Feature
Issue
_ci_build
is intended to offer unattended build functionality for ci pipelines. It currently doesn't as the package manager stops and prompts the user for confirmation.The dependency resolver is just spaghetti in
deps
and lacking distro-agnostic functionality. It really should handle a lot more edge cases, especially with priviledge escalation and package management options. Because we have a lot of users on different system configurations. We live in a nix world where everyone has preferences so our code has to react dynamically to that. It did not before this PR.What's changed?
The dependency resolver now continues without prompting the user if they set the
_ci_build
parameter to"true"
, offering the intended functionality of an unattended installation. It is at this point that the user has acknowledged that installation should continue without providing them warnings, and they know what they are doing.The
-y
flag is inserted for apt on debuntu systems, and dnf on OpenSUSE-based systems. pacman based distros get they
flag added onto their command line.A slight modification passes
_ci_build
as a function parameter to avoid circularly sourcing theprepare.sh
script.A heavy cleanup has been done. I tried to leave these changes little. But they where indentation issues and
shellcheck
warnings I felt needed a skilled touch._nonmakepkg_dependency_resolve_distro
is now a boolean"true"
/"false"
flag named_nonmakepkg_dependency_autoresolver
because OS autodetection is done by improved logic in rhedeps
script.The
deps
script gains dynamic function calling where package dependencies per distro and arch is managed by simple bash arrays. Making it easily maintainable. A single public wrapping functionsinstall_deps
andremove_deps
wraps everything.Auto making decisions for package manager and priviledge escalation options in
deps
. Supportsapt
,dnf
,rpm
,pacman
and for priviledge escalationsudo
,gosu
anddoas
Integration and fix up of logic in
build.sh
andprepare.sh
for dependency resolution done right.Noticed and fixed the fact that you only get warned to fully understand what options you are enabling if you are in a debuntu distro running
nonmakepkg_build.sh
interactively. Now this warning appears properly for everyone. Because not only debuntu users are guilty of skipping the steps to read and understand responsibility of setting_ci_build
to"true"
. ;)You may notice that I restored
customization.cfg
back to its original self from a symlink, I'd done this in testing when running this project in a docker container. Nothing has actually changed, just placing this back so the PR runs smoothly.Added mirror autoresolution (currently only works in debuntu systems) and retry functionality that helps improve dependency installation success for packages like
docbook-utils
andlibgstreamer0-dev:i386
on debuntu systems.Goals of this PR
I just want working clean code for autoresolution of build dependencies that will not destroy system state and do things cleanly on every distro the project supports.
I want to make it easier for other developers to contribute support for building wine in other distros by making the code more modular and maintainable.
My lillypad
I plan to also support Nala for debuntu based distros where that functionality forks from choosing between apt and Nala. Because Nala is just better at dependency resolution and has rollback options where apt doesn't. That however is a bit out of scope so I am leaving that out of this PR
Ribbit
If you like this PR, don't like it or have feedback on room for improvement leave that for me. I wanna hear those croaks.