You are not logged in.

#1 2020-12-15 18:28:39

Magissia
Member
Registered: 2020-12-08
Posts: 4

[Solved] Wrong arch error for Visual Studio Code from aur

Hello,

Using yay, I have trouble installing Visual Studio Code, the repo provides a i686 packages, the correct archive is downloaded but this error is thrown at me :

package visual-studio-code-bin-1.52.0-1-i686 has no valid architecture

AUR URL https://aur.archlinux.org/packages/visu … -code-bin/

PKGBUILD file has a path for i686 as seen line 21
source_i686=(code_ia32_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-ia32/stable)

Is it a PKGBUILD issue, a yay issue, a pacman issue or a ArchLinux32 issue ?

Last edited by Magissia (2020-12-17 19:11:48)

Offline

#2 2020-12-15 20:41:25

levi
Moderator
From: Yorkshire, UK
Registered: 2018-06-16
Posts: 1,197

Re: [Solved] Wrong arch error for Visual Studio Code from aur

Most likely a PKGBUILD issue.  While it supports i686, I guess you're platform is probably actually of pentium4 architecture, or just conceivably i486.  Assuming you're pentium4 (check using 'pacman-conf Architecture'), you'll need to add that arch to the variable in the PKGBUILD, probably add a source_pentum4 variable, and define a condition to reset the _pkg variable assignment inside package(), although as far as I'm concerned you may as well reuse the VSCODE_linux_ia32 folder for that, as the pentium4 is an extension of the ia32 386 instruction set, and according to most sources therefore part of it.  I guess that whole switching mechanism is for build machines that build multiple architectures.


Architecture: pentium4, Testing repos: Yes, Hardware: EeePC 901+2GB RAM+OS half on the SD card.

Offline

#3 2020-12-16 18:02:27

abaumann
Administrator
From: Zurich
Registered: 2019-11-14
Posts: 1,027
Website

Re: [Solved] Wrong arch error for Visual Studio Code from aur

There are some adaptions needed:

# Maintainer: D. Can Celasun <can[at]dcc[dot]im>

pkgname=visual-studio-code-bin
_pkgname=visual-studio-code
pkgver=1.52.0
pkgrel=1
pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)"
arch=('x86_64' 'i686' 'pentium4' 'aarch64' 'armv7h')
url="https://code.visualstudio.com/"
license=('custom: commercial')
provides=('code')
conflicts=('code')
# lsof: need for terminal splitting, see https://github.com/Microsoft/vscode/issues/62991
depends=(libxkbfile gnupg gtk3 libsecret nss gcc-libs libnotify libxss glibc lsof)
optdepends=('glib2: Needed for move to trash functionality'
            'libdbusmenu-glib: Needed for KDE global menu')
source=(${_pkgname}.desktop ${_pkgname}-url-handler.desktop)
source_x86_64=(code_x64_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-x64/stable)
source_aarch64=(code_arm64_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-arm64/stable)
source_armv7h=(code_armhf_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-armhf/stable)
source_i686=(code_ia32_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-ia32/stable)
source_pentium4=(code_ia32_${pkgver}.tar.gz::https://vscode-update.azurewebsites.net/latest/linux-ia32/stable)
# This generates cleaner checksums
sha256sums=('0deefcb638e06c35a52e7e9fb8e19b2dc393f01e5c1c122d2938cddeb22cf8de'
            'be3d123aacd575d8f836728266eb421ea70399d713d1fc30378dbc5602b519fb')
sha256sums_x86_64=('b7de5e6d4443ceb63661ea9d2ee321b741e163695a72eec34bbc2c701e7e84e4')
sha256sums_i686=('64360439cc2fa596838062f7e6f9757b79d4b775a564f18bad6cbad154bf850c')
sha256sums_pentium4=('64360439cc2fa596838062f7e6f9757b79d4b775a564f18bad6cbad154bf850c')
sha256sums_aarch64=('f1f4c1c553f12f201a3ddbc0140c291d68afd1ccdc403f2fc13caf102e5d90ea')
sha256sums_armv7h=('ec210e8d85cfb4bb86a84eec2e6fb0a30493a10615bed641a79d9108c0484b20')


package() {
  _pkg=VSCode-linux-x64
  if [ "${CARCH}" = "aarch64" ]; then
    _pkg=VSCode-linux-arm64
  fi
  if [ "${CARCH}" = "armv7h" ]; then
    _pkg=VSCode-linux-armhf
  fi
  if [ "${CARCH}" = "i686" ]; then
    _pkg=VSCode-linux-ia32
  fi
  if [ "${CARCH}" = "pentium4" ]; then
    _pkg=VSCode-linux-ia32
  fi

  install -d "${pkgdir}/usr/share/licenses/${_pkgname}"
  install -d "${pkgdir}/opt/${_pkgname}"
  install -d "${pkgdir}/usr/bin"
  install -d "${pkgdir}/usr/share/applications"
  install -d "${pkgdir}/usr/share/icons" 

  install -m644 "${srcdir}/${_pkg}/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf"
  install -m644 "${srcdir}/${_pkg}/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/icons/${_pkgname}.png"
  install -m644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
  install -m644 "${srcdir}/${_pkgname}-url-handler.desktop" "${pkgdir}/usr/share/applications/${_pkgname}-url-handler.desktop"

  cp -r "${srcdir}/${_pkg}/"* "${pkgdir}/opt/${_pkgname}" -R
  ln -s /opt/${_pkgname}/bin/code "${pkgdir}"/usr/bin/code
}

The package builds and works.

Online

#4 2020-12-17 19:11:16

Magissia
Member
Registered: 2020-12-08
Posts: 4

Re: [Solved] Wrong arch error for Visual Studio Code from aur

Architecture is pentium4, managed to install by forcing i686 instead of auto/pentium4 where applicable. (i'm using yay as aur helper)

As I understand, the proper fix is to add a pentium4 architecture to the PKGBUILD that would use the ia32 archive like i686.

Thank you both!

Offline

#5 2020-12-17 19:55:23

levi
Moderator
From: Yorkshire, UK
Registered: 2018-06-16
Posts: 1,197

Re: [Solved] Wrong arch error for Visual Studio Code from aur

Yes, the proper fix is to apply all of the fixes to the PKGBUILD or to use the helpful version with all of the fixes applied and tested that abumann posted.  But if yay allows you to override the architecture temporarily then as long as you keep rembering to do that every time you rebuild that package, then I guess that's almost as good.


Architecture: pentium4, Testing repos: Yes, Hardware: EeePC 901+2GB RAM+OS half on the SD card.

Offline

#6 2020-12-19 07:53:49

deep42thought
Administrator
From: Jena, Germany
Registered: 2017-06-17
Posts: 617

Re: [Solved] Wrong arch error for Visual Studio Code from aur

Magissia wrote:

Architecture is pentium4, managed to install by forcing i686 instead of auto/pentium4 where applicable.

I would not do that. You may end up installing i686 and pentium4 packages mixed - this may work, but may also break.
As you said: the proper fix is to edit the PKGBUILDs (or bother the aur publisher to add "pentium4")

Offline

#7 2020-12-19 08:59:30

levi
Moderator
From: Yorkshire, UK
Registered: 2018-06-16
Posts: 1,197

Re: [Solved] Wrong arch error for Visual Studio Code from aur

Well, in this instance the pentum4 code is identical to the i686 code, since both archs get the code denoted as ia32 alone.  I don't use yay personally and don't know how overriding the platform architecture works, but assuming it's possible to do this one individual occasions, and he remembers to do it every time microsoft publishes another version having fixed some heinous hole or other, then the code installed should be exactly the same.  The risk I guess is that this should also end up applied to other packages that actually build stuff from source and would then end up missing some of the newer instruction sets and therefore running slower and perhaps being bigger on disc, even if it doesn't actually break due to something I've not anticipated.


Architecture: pentium4, Testing repos: Yes, Hardware: EeePC 901+2GB RAM+OS half on the SD card.

Offline

#8 2020-12-19 09:06:15

deep42thought
Administrator
From: Jena, Germany
Registered: 2017-06-17
Posts: 617

Re: [Solved] Wrong arch error for Visual Studio Code from aur

There is no problem on the aur part - the risk, I see, is, that op forgets to put "pentium4" back into /etc/pacman.conf and then they will install for mixed architectures.

Offline

Board footer

Powered by FluxBB