Skip to content

Commit c0006e2

Browse files
committed
Support Linux MUSL v3 and v4
1 parent 08629c8 commit c0006e2

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

CHANGELOG.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# CHANGELOG
22

3+
## v0.3.1
4+
5+
* Support correct target for Linux MUSL with Tailwind v3.
6+
37
## v0.3.0 (2025-02-26)
48

5-
Support Tailwind v4+. This release drops official support for Tailwind v3.
6-
If you want to continue using Tailwind v3, please pin the `tailwind` dependency to a 0.2 version:
9+
* Support Tailwind v4+. This release assumes Tailwind v4 for new projects.
710

8-
```elixir
9-
{:tailwind, "~> 0.2.0", only: :dev}`
10-
```
11+
Note: v0.3.0 dropped target code for handling Linux MUSL with Tailwind v3. Use v0.3.1+ instead.
1112

1213
## v0.2.4 (2024-10-18)
1314

README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,8 @@ Tailwind version of choice:
4242
config :tailwind, version: "4.0.9"
4343
```
4444

45-
Note that `:tailwind` 0.3+ supports Tailwind v4+. If you need to use Tailwind v3, use
46-
47-
```
48-
{:tailwind, "~> 0.2.0", only: :dev}
49-
```
50-
51-
instead, and refer to [the README in the 0.2 branch](https://github.com/phoenixframework/tailwind/blob/v0.2/README.md).
45+
Note that `:tailwind` 0.3+ assumes Tailwind v4+ by default. It still supports Tailwind v3, but some configuration options when setting up a new
46+
project might be different. If you use Tailwind v3, also have a look at [the README in the 0.2 branch](https://github.com/phoenixframework/tailwind/blob/v0.2/README.md).
5247

5348
Now you can install Tailwind by running:
5449

lib/tailwind.ex

+22-9
Original file line numberDiff line numberDiff line change
@@ -282,23 +282,36 @@ defmodule Tailwind do
282282
{{:unix, :freebsd}, arch, _abi, 64} when arch in ~w(x86_64 amd64) ->
283283
"freebsd-x64"
284284

285-
{{:unix, :linux}, "aarch64", "musl", 64} ->
286-
"linux-arm64-musl"
285+
{{:unix, :linux}, "aarch64", abi, 64} ->
286+
"linux-arm64" <> maybe_add_abi_suffix(abi)
287287

288-
{{:unix, :linux}, "aarch64", _abi, 64} ->
289-
"linux-arm64"
288+
{{:unix, :linux}, "arm", _abi, 32} ->
289+
"linux-armv7"
290290

291-
{{:unix, _osname}, arch, "musl", 64} when arch in ~w(x86_64 amd64) ->
292-
"linux-x64-musl"
291+
{{:unix, :linux}, "armv7" <> _, _abi, 32} ->
292+
"linux-armv7"
293293

294-
{{:unix, _osname}, arch, _abi, 64} when arch in ~w(x86_64 amd64) ->
295-
"linux-x64"
294+
{{:unix, _osname}, arch, abi, 64} when arch in ~w(x86_64 amd64) ->
295+
"linux-x64" <> maybe_add_abi_suffix(abi)
296296

297297
{_os, _arch, _abi, _wordsize} ->
298298
raise "tailwind is not available for architecture: #{arch_str}"
299299
end
300300
end
301301

302+
defp maybe_add_abi_suffix("musl") do
303+
# Tailwind CLI v4+ added explicit musl versions for Linux as
304+
# tailwind-linux-x64-musl
305+
# tailwind-linux-arm64-musl
306+
if Version.match?(configured_version(), "~> 4.0") do
307+
"-musl"
308+
else
309+
""
310+
end
311+
end
312+
313+
defp maybe_add_abi_suffix(_), do: ""
314+
302315
defp fetch_body!(url, retry \\ true) when is_binary(url) do
303316
scheme = URI.parse(url).scheme
304317
url = String.to_charlist(url)
@@ -339,7 +352,7 @@ defmodule Tailwind do
339352
The tailwind binary couldn't be found at: #{url}
340353
341354
This could mean that you're trying to install a version that does not support the detected
342-
target architecture.
355+
target architecture. For example, Tailwind v4+ dropped support for 32-bit ARM.
343356
344357
You can see the available files for the configured version at:
345358

0 commit comments

Comments
 (0)