Elixir

Elixir

Elixir Core Team

1. Bug fixes

Logger

  • [Logger.Translator] Fix logger crash when :gen_statem’s format_status/2 returns non-tuple

Mix

  • [mix deps.get] Fix regression when fetching a git repository with a :ref
  • [mix release] Validate RELEASE_MODE and set ERRORLEVEL on .bat scripts
  • [mix release] Fix invalid example in code comment inside the generated vm.args.eex

Showing Posts 1 to 10

rhcarvalho

rhcarvalho

I found Fix regression when fetching repo with a ref · elixir-lang/elixir@786f959 · GitHub.

Does anyone have more details on what the problem was with setting both ref and depth?

josevalim

josevalim

Creator of Elixir

Fetch a :ref was not working at all and, once I addressed the :ref bug, I could not make it work together with :ref. If you can figure it out, a PR is welcome. :slight_smile:

rhcarvalho

rhcarvalho

I could not reproduce it. I’m probably not trying to do the thing that is broken?!

Here’s what I’ve done:

  1. Fresh Elixir 1.17.1 env:
$ cat Dockerfile
FROM docker.io/hexpm/elixir:1.17.1-erlang-27.0-debian-bookworm-20240701-slim

RUN apt-get update && apt-get install -y git vim && rm -rf /var/lib/apt/lists/*

RUN mix new app

WORKDIR /app
$ podman build -t elixir-1.17.1 .
$ podman run --rm -it elixir-1.17.1
  1. Configure deps using ref and depth:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
  defp deps do
    [
      {:heroicons,
       github: "tailwindlabs/heroicons",
       ref: "c1b192b8cd0f1b3c569d25ba995d170f3db86039",
       sparse: "optimized",
       app: false,
       compile: false,
       depth: 1},
    ]
  end
  1. Fetch first time:
$ mix deps.get
* Getting heroicons (https://github.com/tailwindlabs/heroicons.git - c1b192b8cd0f1b3c569d25ba995d170f3db86039)
remote: Enumerating objects: 2405, done.        
remote: Counting objects: 100% (2405/2405), done.        
remote: Compressing objects: 100% (2178/2178), done.        
remote: Total 2405 (delta 277), reused 1905 (delta 217), pack-reused 0 
  1. Sanity checks:
$ cat mix.lock 
%{
  "heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "c1b192b8cd0f1b3c569d25ba995d170f3db86039", [ref: "c1b192b8cd0f1b3c569d25ba995d170f3db86039", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
c1b192b (grafted, HEAD) 2.1.4
  1. Downgrade to a previous commit:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
  defp deps do
    [
      {:heroicons,
       github: "tailwindlabs/heroicons",
       ref: "01c786b0353c7e51b86bc903a329e81d7578333d",
       sparse: "optimized",
       app: false,
       compile: false,
       depth: 1},
    ]
  end
  1. Fetch second time, updating repo:
$ mix deps.get
* Updating heroicons (https://github.com/tailwindlabs/heroicons.git - 01c786b0353c7e51b86bc903a329e81d7578333d)
remote: Enumerating objects: 2405, done.        
remote: Counting objects: 100% (2405/2405), done.        
remote: Compressing objects: 100% (2179/2179), done.        
remote: Total 2405 (delta 277), reused 1901 (delta 216), pack-reused 0 
  1. Sanity checks:
$ cat mix.lock
%{
  "heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "01c786b0353c7e51b86bc903a329e81d7578333d", [ref: "01c786b0353c7e51b86bc903a329e81d7578333d", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
01c786b (grafted, HEAD) 2.1.3
  1. Upgrade to an intermediate commit:
$ vim mix.exs
$ sed -n '/defp deps/,/end/p' mix.exs
  defp deps do
    [
      {:heroicons,
       github: "tailwindlabs/heroicons",
       ref: "cafc7d6cb6c2233b07667ae1fb77a43866a333e3",
       sparse: "optimized",
       app: false,
       compile: false,
       depth: 1},
    ]
  end
$ mix deps.get
* Updating heroicons (https://github.com/tailwindlabs/heroicons.git - cafc7d6cb6c2233b07667ae1fb77a43866a333e3)
remote: Enumerating objects: 2405, done.        
remote: Counting objects: 100% (2405/2405), done.        
remote: Compressing objects: 100% (2179/2179), done.        
remote: Total 2405 (delta 277), reused 1902 (delta 216), pack-reused 0
  1. Sanity checks:
$ cat mix.lock
%{
  "heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "cafc7d6cb6c2233b07667ae1fb77a43866a333e3", [ref: "cafc7d6cb6c2233b07667ae1fb77a43866a333e3", sparse: "optimized", depth: 1]},
}
$ git -C /app/deps/heroicons log --oneline
cafc7d6 (grafted, HEAD) use `size-*` instead of `w-* h-*` (#1182)

All of the above seems to be working as expected for me. The deps.get works and the repository has the correct commit with depth 1.

I wonder what did I miss in the steps above?

josevalim

josevalim

Creator of Elixir

What is your git --version?

The issue was that Mix.install [{:flame, github: "phoenixframework/flame", ref: "4600277"}] was not working on v1.17.

rhcarvalho

rhcarvalho

In the Debian bookworm container from above:

$ git --version
git version 2.39.2

What is the version where cloning flame fails?

josevalim

josevalim

Creator of Elixir

git version 2.39.3 (Apple Git-145), so theoretically it is not the git version, unless the Apple Git has modifications.

rhcarvalho

rhcarvalho

Do you have an error report somewhere? What was the error message from mix deps.get / Git?

josevalim

josevalim

Creator of Elixir
iex(1)> Mix.install [{:flame, github: "phoenixframework/flame", ref: "4600277"}]
* Getting flame (https://github.com/phoenixframework/flame.git - 4600277)
fatal: couldn't find remote ref 4600277
** (Mix.Error) Command "git --git-dir=.git fetch --force --quiet --progress origin 4600277" failed
    (mix 1.17.2) lib/mix.ex:588: Mix.raise/2
rhcarvalho

rhcarvalho

Did you try the full ref? 46002774775fa5be947a970d7ff5aeefc0dd6707

rhcarvalho

rhcarvalho

This is not even using :depth :slight_smile:

Maybe the problem is just the ref itself!

Where Next? Top

Trending in News Top

ericmj
Release: Release v2.6.0 · hexpm/hex · GitHub Announcement: Hex v2.6 released | Hex Backwards incompatible changes Require --key in mix...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews