Repository: electron-userland/electron-builder
File: packages/app-builder-lib/src/toolsets/linux.ts (TypeScript)

Code before:
}

export async function getAppImageTools(targetArch: Arch) {
  const override = process.env.APPIMAGE_TOOLS_PATH?.trim()
  const artifactPath =
    override ||
    (await downloadArtifact({
      releaseName: "appimage@1.0.2",
      filenameWithExt: "appimage-tools-runtime-20251108.tar.gz",
      checksums: {
        "appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0",
      },
      githubOrgRepo: "electron-userland/electron-builder-binaries",
    }))

  const runtimeArch =
    targetArch === Arch.armv7l
      ? "arm32"
      : targetArch === Arch.arm64
      ? "arm64"
      : targetArch === Arch.ia32
      ? "ia32"
      : "x64"

  const root = path.resolve(artifactPath)
  const binDir = path.join(root, "linux", runtimeArch)

  return {
    mksquashfs: path.join(binDir, "mksquashfs"),
    desktopFileValidate: path.join(binDir, "desktop-file-validate"),
    runtime: path.join(root, "runtimes", `runtime-${runtimeArch}`),
    runtimeLibraries: path.join(root, "lib", runtimeArch),
  }
}


Review comment (suggestion):
`linux` should be `process.platform` as `darwin` also is included in the package, but it seems like we only need `artifactPath = path.resolve(artifactPath)`.

Reason being is that the `mksquashfs` at root (and desktop-file-validate, obj_decompress as well) is supposed to autoroute to the correct platform+arch combination. Is this not occurring?
https://github.com/electron-userland/electron-builder-binaries/blob/96a936e905ad104340e16e579a85d0cfaefbefdc/packages/appimage/assets/bundle-and-compress.sh#L141-L165

Toolset contents:
```
tree ./appimage-tools-runtime-20251108 -L2
├── appimage-tool
├── darwin
│   ├── arm64
│   └── x64
├── desktop-file-validate -> appimage-tool
├── lib
│   ├── arm32
│   ├── arm64
│   ├── ia32
│   └── x64
├── linux
│   ├── arm32
│   ├── arm64
│   ├── ia32
│   └── x64
├── mksquashfs -> appimage-tool
├── opj_decompress -> appimage-tool
├── runtimes
│   ├── runtime-arm32
│   ├── runtime-arm64
│   ├── runtime-ia32
│   ├── runtime-x64
│   └── VERSION.txt
└── select-runtime.env

15 directories, 10 files
```

Code after:
}

export async function getAppImageTools(targetArch: Arch) {
  const override = process.env.APPIMAGE_TOOLS_PATH?.trim()
  let artifactPath =
    override ||
    (await downloadArtifact({
      releaseName: "appimage@1.0.2",
      filenameWithExt: "appimage-tools-runtime-20251108.tar.gz",
      checksums: {
        "appimage-tools-runtime-20251108.tar.gz": "a784a8c26331ec2e945c23d6bdb14af5c9df27f5939825d84b8709c61dc81eb0",
      },
      githubOrgRepo: "electron-userland/electron-builder-binaries",
    }))

  artifactPath = path.resolve(artifactPath)

  const runtimeArch =
    targetArch === Arch.armv7l
      ? "arm32"
      : targetArch === Arch.arm64
      ? "arm64"
      : targetArch === Arch.ia32
      ? "ia32"
      : "x64"

  return {
    mksquashfs: path.join(artifactPath, "mksquashfs"),
    desktopFileValidate: path.join(artifactPath, "desktop-file-validate"),
    runtime: path.join(artifactPath, "runtimes", `runtime-${runtimeArch}`),
    runtimeLibraries: path.join(artifactPath, "lib", runtimeArch),
  }
}