Skip to content
Snippets Groups Projects

feat: allow building for unsupported architecture

Open Felix Yan requested to merge felixonmars/devtools:unsupported-arch into master
1 unresolved thread
+ 7
2
@@ -124,6 +124,7 @@ pkgctl_build() {
local RELEASE=0
local DB_UPDATE=0
local INSTALL_TO_HOST=none
local UNSUPPORTED_ARCH=0
local REPO=
local PKGVER=
@@ -165,7 +166,8 @@ pkgctl_build() {
BUILD_ARCH=("${DEVTOOLS_VALID_ARCHES[0]}")
elif ! in_array "${2}" "${BUILD_ARCH[@]}"; then
if ! in_array "${2}" "${DEVTOOLS_VALID_ARCHES[@]}"; then
die 'invalid architecture: %s' "${2}"
warning 'unsupported architecture: %s' "${2}"
UNSUPPORTED_ARCH=1
fi
BUILD_ARCH+=("${2}")
fi
@@ -312,6 +314,9 @@ pkgctl_build() {
# Update pacman cache for auto-detection
if [[ -z ${REPO} ]]; then
if (( UNSUPPORTED_ARCH )); then
die "Unsupported architecture specified, cannot auto-detect repository"
    • I don't really know much about the current riscv setup, but maybe you can help me understand why you have no pacman repositories that can be fetched and the repo detected? Is this a cross-platform build?

      • Author Contributor

        The obvious problem here is that we don't have [multilib] in the RISC-V port (should also be the case for any new architectures that don't really need to enable 32-bit support), so the following command to fetch and update [multilib] will fail.

        Edited by Felix Yan
      • I see, so as we need to fix this anyway, I'd need to think a bit how we want to approach this for different architectures. It would be more future proof variant instead of more special cases around code :slight_smile:

      • Please register or sign in to reply
Please register or sign in to reply
fi
update_pacman_repo_cache multilib
# Check valid repos if not resolved dynamically
elif ! in_array "${REPO}" "${DEVTOOLS_VALID_REPOS[@]}"; then
@@ -343,7 +348,7 @@ pkgctl_build() {
fi
# fail if an existing package specifies --repo
if [[ -n "${repo}" ]] && [[ -n ${pkgrepo} ]]; then
if [[ -n "${repo}" ]] && [[ -n ${pkgrepo} ]] && (( ! UNSUPPORTED_ARCH )); then
# allow unstable to use --repo
if [[ ${pkgrepo} == *unstable ]]; then
repo=${pkgrepo}
Loading