asdf-vm / asdf-vm/asdf-plugins

Swift plugin

Open
#1,040 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
1.4k
Forks
552
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

The swift plugin (and it's fork) don't work, are unmaintained, and unusable especially on EL-compatible OSes (CentOS, RHEL, etc.).

### Steps to Reproduce

```
dnf install -y epel-release
crb enable
dnf install -y --allowerasing '@Development Tools' pipx python3-devel which curl coreutils libuuid libxml2 xz unzip xar libdispatch z3 libedit libbsd
pipx install ninja

export ASDF_DIR=$HOME/.asdf
git clone https://github.com/asdf-vm/asdf.git "$ASDF_DIR" --branch v0.14.1 --depth 1
. "$ASDF_DIR/asdf.sh"

asdf plugin add swift
# or the fork: asdf plugin add swift https://github.com/jfilling/asdf-swift
asdf install swift latest # which doesn't work
asdf install swift 5.10 # also doesn't work
swift --help # sanity test should it ever happen to work
```

### Expected Behaviour

Swift installs.

Might as well install the system package `swift-lang` from EPEL but that would defeat the whole point of ASDF.

### Actual Behaviour

Lack of error handling causes Swift to appear "installed" to asdf but it actually isn't.

The install process automatically installs ninja always and without user confirmation, even when it's already present.

Bizarre, unhelpful error messages.

Doesn't check the gpg signatures of artifacts apple provides.

### Environment

```shell
OS: CentOS 9 Stream (`docker run -it --rm quay.io/centos/centos:stream9`)
Architecture: aarch64

ASDF: Normal install per doc.

#### `asdf info`

OS:
Linux 5f92e6981867 6.10.4-linuxkit #1 SMP Mon Aug 12 08:47:01 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

SHELL:
GNU bash, version 5.1.8(1)-release (aarch64-redhat-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.1.8(1)-release

ASDF VERSION:
v0.14.1-f00f759

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/root/.asdf
ASDF_DIR=/root/.asdf
ASDF_CONFIG_FILE=/root/.asdfrc

ASDF INSTALLED PLUGINS:

swift https://github.com/fcrespo82/asdf-swift.git master 23dbd46
# or:
swift https://github.com/jfilling/asdf-swift master cbad3ac

```
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `asdf install swift latest` and `asdf install swift 5.10` with the Swift plugin on CentOS 9 Stream aarch64, then inspect the plugin's installation entry points. Done means Swift installs successfully, failures are reported instead of appearing successful, existing ninja is not installed without confirmation, errors are useful, and Apple artifact signatures are checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, swift
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.