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

Other Trending Topics Top

halostatue
AshVersioned provides resource versioning for Ash using Slowly Changing Dimension (type 2). There are multiple approaches to SCD type 2, ...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews