Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Sonoma: OTP 26 downloading but not actually installing #289

Closed
Nezteb opened this issue Nov 6, 2023 · 5 comments
Closed

macOS Sonoma: OTP 26 downloading but not actually installing #289

Nezteb opened this issue Nov 6, 2023 · 5 comments

Comments

@Nezteb
Copy link

Nezteb commented Nov 6, 2023

EDIT: See resolution comment tldr at the very bottom of this thread.

macOS Sonoma 14.1.1
asdf 0.13.1
Nushell 0.86.0 (also zsh 5.9)

Here's my relevant config:

# https://github.com/asdf-vm/asdf-erlang/issues/207#issuecomment-883216342
let openssl = (brew --prefix openssl)
let wx = (brew --prefix wxwidgets)

# Disable JIT is only needed for OTP 25: https://github.com/erlang/otp/issues/7687#issuecomment-1737297515
$env.KERL_CONFIGURE_OPTIONS = $"--with-ssl=($openssl) --with-wx-config=($wx)/bin/wx-config --without-javac --disable-jit"

# For asdf-erlang to install with docs
$env.KERL_BUILD_DOCS = "yes"
$env.KERL_DOC_TARGETS = "man html chunks"

# https://asdf-vm.com/guide/getting-started.html#_3-install-asdf
const asdf_nu_dir = /opt/homebrew/opt/asdf/libexec
$env.ASDF_NU_DIR = $asdf_nu_dir
const asdf_nu_file = ($asdf_nu_dir | path join "asdf.nu")
source $asdf_nu_file

The commands I'm running:

❯ asdf install erlang 26.1.2
asdf_26.1.2 is not a kerl-managed Erlang/OTP installation
The asdf_26.1.2 build has been deleted
Extracting source code
Building Erlang/OTP 26.1.2 (asdf_26.1.2), please wait...
APPLICATIONS DISABLED (See: /Users/noah/.asdf/plugins/erlang/kerl-home/builds/asdf_26.1.2/otp_build_26.1.2.log)
 * jinterface     : Java compiler disabled by user
 * odbc           : ODBC library - link check failed

DOCUMENTATION INFORMATION (See: /Users/noah/.asdf/plugins/erlang/kerl-home/builds/asdf_26.1.2/otp_build_26.1.2.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Building docs...
Erlang/OTP 26.1.2 (asdf_26.1.2) has been successfully built

otelephant ❯ asdf local erlang 26.1.2
version 26.1.2 is not installed for erlang

otelephant ❯ ls ~/.asdf/downloads/erlang/26.1.2/OTP-26.1.2.tar.gz
╭───┬─────────────────────────────────────────────────────────────┬──────┬──────────┬────────────────╮
│ # │                            name                             │ type │   size   │    modified    │
├───┼─────────────────────────────────────────────────────────────┼──────┼──────────┼────────────────┤
│ 0 │ /Users/noah/.asdf/downloads/erlang/26.1.2/OTP-26.1.2.tar.gz │ file │ 107.4 MB │ 12 minutes ago │
╰───┴─────────────────────────────────────────────────────────────┴──────┴──────────┴────────────────╯

otelephant ❯ ls ~/.asdf/installs/erlang/
╭───┬──────────────────────────────────────────┬──────┬───────┬─────────────╮
│ # │                   name                   │ type │ size  │  modified   │
├───┼──────────────────────────────────────────┼──────┼───────┼─────────────┤
│ 0 │ /Users/noah/.asdf/installs/erlang/25.1.1 │ dir  │ 576 B │ 2 weeks ago │
╰───┴──────────────────────────────────────────┴──────┴───────┴─────────────╯

Note that the OTP tarball exists in the ~/.asdf/downloads directory but despite the implication that asdf-erlang has successfully installed OTP 26.1.2

@sevenseacat
Copy link

sevenseacat commented Nov 14, 2023

Yeah I'm seeing the same thing - with only one of my projects though.

I have a project using 26.1.2 that's totally fine, but now I'm getting this error with a different project using 26.0.2.

Also using macOS Sonoma
asdf version v0.13.1-8fbf9a3
asdf-erlang up to date with master

.: ~/P/w/a/spark : refactor/cheat-sheet-tables (8a987a3) : 12:13am :.
$ asdf install
==> Checking whether specified Elixir release exists...
==> Downloading 1.15.4-otp-26 to /Users/rebecca/.asdf/downloads/elixir/1.15.4-otp-26/elixir-precompiled-1.15.4-otp-26.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6642k  100 6642k    0     0  2369k      0  0:00:02  0:00:02 --:--:-- 2374k
==> Copying release into place
asdf_26.0.2 is not a kerl-managed Erlang/OTP installation
The asdf_26.0.2 build has been deleted
Extracting source code
Building Erlang/OTP 26.0.2 (asdf_26.0.2), please wait...
APPLICATIONS DISABLED (See: /Users/rebecca/.asdf/plugins/erlang/kerl-home/builds/asdf_26.0.2/otp_build_26.0.2.log)
 * jinterface     : No Java compiler found
 * odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /Users/rebecca/.asdf/plugins/erlang/kerl-home/builds/asdf_26.0.2/otp_build_26.0.2.log)
 * wx             : Can not link wx program are all developer packages installed?

DOCUMENTATION INFORMATION (See: /Users/rebecca/.asdf/plugins/erlang/kerl-home/builds/asdf_26.0.2/otp_build_26.0.2.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Erlang/OTP 26.0.2 (asdf_26.0.2) has been successfully built

.: ~/P/w/a/spark : refactor/cheat-sheet-tables (8a987a3) : 12:14am :.
$ erl -v
No erl executable found for erlang 26.0.2

I'm not seeing the same error on my other machine running the exact same project, so I'm not sure what's going on...

@Nezteb
Copy link
Author

Nezteb commented Nov 17, 2023

I found the cause of the problem as well as a decent-enough workaround.

Listing all directories/files that match "erl" or "otp" in the asdf directory:

❯ tree ~/.asdf -L 5 --matchdirs --ignore-case -P 'erl|otp' --prune -f
/Users/noah/.asdf
├── /Users/noah/.asdf/installs
│   └── /Users/noah/.asdf/installs/erlang
│       ├── /Users/noah/.asdf/installs/erlang/25.1.1
│       │   └── /Users/noah/.asdf/installs/erlang/25.1.1/bin
│       │       └── /Users/noah/.asdf/installs/erlang/25.1.1/bin/erl
│       └── /Users/noah/.asdf/installs/erlang/26.1
│           └── /Users/noah/.asdf/installs/erlang/26.1/bin
│               └── /Users/noah/.asdf/installs/erlang/26.1/bin/erl
└── /Users/noah/.asdf/shims
    └── /Users/noah/.asdf/shims/erl

8 directories, 3 files

The biggest things to note:

  • asdf list all erlang lists Erlang 26.1.1 as an installable version.
  • I have been telling asdf to install version 26.1.1
    • However, I don't have any erlang/26.1.1 directories.
    • I do however have erlang/26.1.
      • For some reason the semver patch version is being truncated in the local directory name?

If I run the following, everything works as expected:

❯ asdf global erlang 26.1
❯ asdf local erlang 26.1
❯ erl
Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Eshell V14.1 (press Ctrl+G to abort, type help(). for help)
1> 

After this, trying to install 26.1.1 complains that an install already exists at the path ~/.asdf/installs/erlang/26.1.1, but that is not true:

❯ asdf install erlang 26.1.1
Install version: 26.1.1
Install path: /Users/noah/.asdf/installs/erlang/26.1.1
asdf_26.1.1 is not a kerl-managed Erlang/OTP installation
The asdf_26.1.1 build has been deleted
Extracting source code
Building Erlang/OTP 26.1.1 (asdf_26.1.1), please wait...
Building docs...
Erlang/OTP 26.1.1 (asdf_26.1.1) has been successfully built
ERROR: Installation (asdf_26.1.1) already registered for this location (/Users/noah/.asdf/installs/erlang/26.1.1)

❯ ls -al ~/.asdf/installs/erlang
25.1.1
26.1

I'm not sure if this is specific to the 26.1.x family of Erlang/OTP versions or not.

@Nezteb
Copy link
Author

Nezteb commented Nov 17, 2023

I'm thinking this might be a kerl issue.

For now I'll close this issue, open an issue there, and possible re-open this one later.

EDIT: Just kidding, trying to replicate this with vanilla kerl poses no problems. This is an asdf-erlang issue I believe. Still investigating.

@Nezteb Nezteb closed this as completed Nov 17, 2023
@Nezteb Nezteb reopened this Nov 17, 2023
@Nezteb
Copy link
Author

Nezteb commented Nov 17, 2023

I'm thinking this is related to kerl/kerl#236 actually, which has been mentioned here before: #143

I have threse files:

# ~/.asdf/plugins/erlang/kerl-home/otp_installations

asdf_25.3 /Users/noah/.asdf/installs/erlang/25.3
asdf_22.3.4.26 /Users/noah/.asdf/installs/erlang/22.3.4.26
asdf_25.2.2 /Users/noah/.asdf/installs/erlang/25.2.2
asdf_25.3.2 /Users/noah/.asdf/installs/erlang/25.3.2
asdf_25.2.1 /Users/noah/.asdf/installs/erlang/25.2.1
asdf_26.0.2 /Users/noah/.asdf/installs/erlang/26.0.2
asdf_26.1.1 /Users/noah/.asdf/installs/erlang/26.1.1
asdf_26.1.2 /Users/noah/.asdf/installs/erlang/26.1.2
asdf_25.3.2.7 /Users/noah/.asdf/installs/erlang/25.3.2.7
asdf_25.1.1 /Users/noah/.asdf/installs/erlang/25.1.1

# ~/.asdf/plugins/erlang/kerl-home/otp_builds
25.3,asdf_25.3
22.3.4.26,asdf_22.3.4.26
25.2.2,asdf_25.2.2
25.3.2,asdf_25.3.2
25.2.1,asdf_25.2.1
26.0.2,asdf_26.0.2
25.3.2.7,asdf_25.3.2.7
25.1.1,asdf_25.1.1
26.1.2,asdf_26.1.2
26.1.1,asdf_26.1.1

As I noted earlier though:

❯ ls -al ~/.asdf/installs/erlang
25.1.1
26.1

tldr

kerl cleanup should fix this. For asdf-erlang, you may need to fully qualify the path to kerl, like: ~/.asdf/plugins/erlang/kerl cleanup.

At some point I was manually doing rm -rf ~/.asdf/installs/erlang/*; I didn't realize this causes so many issues for kerl. It looks like this might be fixed soon via PR to kerl though!

@Nezteb Nezteb closed this as completed Nov 17, 2023
@sevenseacat
Copy link

The steps outlined in that resolved the issue for me also 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants