version-fox / vfox-erlang

Erlang/OTP vfox plugin. Use the vfox to manage multiple Erlang/OTP versions in Linux/Darwin MacOS, also Windows!!!
Apache License 2.0
5 stars 1 forks source link

Erlang docs not building #4

Closed ccavolt closed 5 months ago

ccavolt commented 5 months ago

I moved from asdf to vfox-erlang to build erlang in my project. In asdf, I was able to build the erlang docs with the KERL_BUILD_DOCS=yes environment variable, however I haven't been able to do so with vfox, with or without the environment variable. The readme in this repo says the docs should build by default, but that hasn't been my experience. Any idea what I might be doing wrong, or if there's a bug here?

image
yeshan333 commented 5 months ago

I moved from asdf to vfox-erlang to build erlang in my project. In asdf, I was able to build the erlang docs with the KERL_BUILD_DOCS=yes environment variable, however I haven't been able to do so with vfox, with or without the environment variable. The readme in this repo says the docs should build by default, but that hasn't been my experience. Any idea what I might be doing wrong, or if there's a bug here?

image

I released a version v1.0.1 to fix this problem. You can update vfox-erlang plugin, then reinstall Erlang/OTP and try again.

eg:

# 1、update plugin
vfox update erlang
# 2、remove the old version
vfox uninstall erlang@xxx
# 3、reinstall it
vfox install erlang@xxx

use erl to test your installation has the EEP48, for example:

image

@ccavolt

yeshan333 commented 5 months ago

BTW. It is different from asdf-erlang internal implementation that uses kerl to manage versions.

vfox-erlang, GNU make is directly used for installation in Unix-like systems. You can use most environment variables mentioned in official documents to control the installation process.

for an example, speed up your installation:

export MAKEFLAGS=-j8
vfox install erlang@xxx

reference: https://github.com/erlang/otp/blob/master/HOWTO/INSTALL.md#building-3

ccavolt commented 5 months ago

Thanks for that tip! I've been lamenting the speed of the builds and that definitely helps!

Unfortunately, regarding the docs, that hasn't fixed the issue. I'm using a devcontainer to build erlang, so I don't have to really do much to ensure I have a clean environment. You can see how I'm building it here.

image
yeshan333 commented 5 months ago

I looked at the logs for GitHub Actions, and it seems that the version of the plugin used is incorrect.

image

@ccavolt

yeshan333 commented 5 months ago

Can you offer a sample devcontainer.json for me. I want to test it.

Thanks for that tip! I've been lamenting the speed of the builds and that definitely helps!

Unfortunately, regarding the docs, that hasn't fixed the issue. I'm using a devcontainer to build erlang, so I don't have to really do much to ensure I have a clean environment. You can see how I'm building it here.

image
ccavolt commented 5 months ago
{
  "name": "erlang-docs-test",

  "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",

  "features": {
    "ghcr.io/ccavolt/devcontainer-features/vfox:0.4.0": {
      "version": "0.5.1",
      "user": "vscode",
      "shell": "zsh"
    },
    "ghcr.io/ccavolt/devcontainer-features/vfox-erlang:0.4.1": {
      "version": "26.2.5"
    },
    "ghcr.io/ccavolt/devcontainer-features/vfox-elixir:0.4.0": {
      "version": "1.16.2",
      "locale": "en_US.UTF-8",
      "defaultMixCommands": "yes"
    }
  },

  "customizations": {
    "vscode": {
      "extensions": [
        "JakeBecker.elixir-ls",
        "phoenixframework.phoenix"
      ]
    }
  }
}
ccavolt commented 5 months ago

I cut out a lot of things that aren't relevant to the example; let me know if you have any issues.

yeshan333 commented 5 months ago

image

(QAQ~😣)Can not reproduce in my machine.

❯ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.6 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

yeshan333 commented 5 months ago

I directly used an ordinary Docker container to do the experiment, and the problem did not appear.

image

Dockerfile:

FROM ubuntu:22.04

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk git

RUN echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | tee /etc/apt/sources.list.d/versionfox.list \
    && apt-get update \
    && apt-get install vfox

RUN vfox add erlang && vfox install erlang@26.2.5
ccavolt commented 5 months ago

I'm in the process of creating a reproduction...in the meantime, I updated my devcontainer feature to build the docs itself, with the following lines:

export VFOX_CACHE=/opt/vfox
cd "${VFOX_CACHE}/erlang/v-${VERSION}/erlang-${VERSION}"
make docs DOC_TARGETS=chunks

Which works in my elixir project that uses that feature. I'm able to run the erl h(lists). command and don't get any complaints from ElixirLS, so I'm not sure what's going on at the moment.

ccavolt commented 5 months ago

I think I messed up somewhere in here. I can't build a reproduction that doesn't build the docs now, so I'm just going to close this unless I find something more concrete later. Thanks so much for the fix and sorry for the wild goose chase afterwards! 😅