You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only install git strangely when there is reason to do so
We install `git` in the `cross` container, intending that it come
from the git-core PPA and thus be of a recent version. If we can
find a Debian-style architecture name that is correct for the
`cross` target triple, then we install it for that architecture. In
principle we might find such a name without the PPA having a build
for that architecture, but that is in practice unlikely to occur
and, if it does, then either the `git` we do manage to install is
new enough, or we will get test failures due to absent features the
test suite needs (such as `GIT_CONFIG_{COUNT,KEY,VALUE}` support).
When we don't find such a name, we use the host architecture.
When we install `git` for the target architecture, its `perl` and
`liberror-perl` dependencies, which as declared must be of that
architecture as well, may not be installable. We run into this
problem in the container for `s390x-unknown-linux-gnu`. To solve
it, we install the dependencies except for those, as well as
ensuring those are installed for the host architecture, and then
install `git` while forcing it install even if those two
dependencies are considered unmet. This works because `git` doesn't
use `perl` as a library, but rather as an interpreter for some
scripts; and `libperl-error` is a library, but it is a Perl module
used from Perl scripts, not a shared library object any Git-related
binaries have to load. (Currently, direct dependencies of `git` are
hard-coded, which, as commented, may be worth changing to decrease
the likelihood of breakage in future versions.)
In order to test that the procedure really has a chance of working
on a variety of architectures (in case `cross` is to be used to
test others at some point), this complex procedure for installing
`git` is used whether it is being installed for the target or the
host architecture. But this doesn't provide much assurance; that
the procedure works when it is effectively just installing exactly
the same packages as would be installed anyway does not imply that
it works with other cross-target installations where it would be
installing different packages. More importantly, using this even
when it is known not to be needed obscures the cases where it is
not needed, and may create the impression that test failures are
due to the strange way `git` was installed, even when they are not.
Therefore, this modifies the `cross` container customization script
so we only take the strange semi-manual dependency installation
approach when there is a chance it might actually be needed, i.e.,
when we are installing `git` for the cross target rather than the
host target.
0 commit comments