Skip to content

Commit 094fd74

Browse files
authored
feat: burrito (aka binary executable) (#144)
1 parent 5397c23 commit 094fd74

File tree

13 files changed

+192
-136
lines changed

13 files changed

+192
-136
lines changed

.formatter.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import_deps: [:gen_lsp],
1212
plugins: [Styler],
1313
inputs: [
14-
"{mix,.formatter}.exs",
14+
".formatter.exs",
1515
"{config,lib,}/**/*.{ex,exs}",
1616
"test/next_ls_test.exs",
1717
"test/test_helper.exs",

.github/workflows/ci.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
otp: [24.x, 25.x, 26.x]
15-
elixir: [1.13.x, 1.14.x, 1.15.x]
16-
exclude:
17-
- otp: 26.x
18-
elixir: 1.13.x
14+
otp: [26.0.2]
15+
elixir: [1.15.4]
1916

2017
steps:
2118
- uses: actions/checkout@v2
@@ -51,15 +48,15 @@ jobs:
5148

5249
formatter:
5350
runs-on: ubuntu-latest
54-
name: Formatter (1.15.x/26.x)
51+
name: Formatter
5552

5653
steps:
5754
- uses: actions/checkout@v2
5855
- uses: erlef/setup-beam@v1
5956
id: beam
6057
with:
61-
otp-version: 26.x
62-
elixir-version: 1.15.x
58+
otp-version: 26.0.2
59+
elixir-version: 1.15.4
6360
- uses: actions/cache@v3
6461
with:
6562
path: |
@@ -83,8 +80,8 @@ jobs:
8380
id: beam
8481
uses: erlef/setup-beam@v1
8582
with:
86-
otp-version: 26.x
87-
elixir-version: 1.15.x
83+
otp-version: 26.0.2
84+
elixir-version: 1.15.4
8885

8986
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
9087
# Cache key based on Elixir & Erlang version (also useful when running in matrix)

.github/workflows/release.yaml

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,55 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
otp: [25.3]
18-
elixir: [1.14.x]
17+
otp: [26.0.2]
18+
elixir: [1.15.4]
1919
steps:
2020
- uses: google-github-actions/release-please-action@v3
2121
id: release
2222
with:
2323
release-type: elixir
2424
package-name: next_ls
25-
extra-files: |
26-
bin/nextls
2725

28-
- uses: actions/checkout@v3
29-
if: ${{ steps.release.outputs.release_created }}
26+
# - uses: actions/checkout@v3
27+
# if: ${{ steps.release.outputs.release_created }}
3028

31-
- uses: erlef/setup-beam@v1
32-
with:
33-
otp-version: ${{matrix.otp}}
34-
elixir-version: ${{matrix.elixir}}
35-
if: ${{ steps.release.outputs.release_created }}
29+
# - uses: erlef/setup-beam@v1
30+
# with:
31+
# otp-version: ${{matrix.otp}}
32+
# elixir-version: ${{matrix.elixir}}
33+
# if: ${{ steps.release.outputs.release_created }}
3634

37-
- uses: actions/cache@v3
38-
id: cache
39-
if: ${{ steps.release.outputs.release_created }}
40-
with:
41-
path: |
42-
deps
43-
_build
44-
key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
45-
restore-keys: |
46-
${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-
35+
# - uses: actions/cache@v3
36+
# id: cache
37+
# if: ${{ steps.release.outputs.release_created }}
38+
# with:
39+
# path: |
40+
# deps
41+
# _build
42+
# key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
43+
# restore-keys: |
44+
# ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-
45+
46+
# - name: Install Dependencies
47+
# if: steps.release.outputs.release_created && steps.cache.outputs.cache-hit != 'true'
48+
# run: mix deps.get
49+
50+
# we can't publish to hex anymore because burrito is a git dependency
4751

48-
- name: Install Dependencies
49-
if: steps.release.outputs.release_created && steps.cache.outputs.cache-hit != 'true'
50-
run: mix deps.get
52+
# - name: publish to hex
53+
# if: ${{ steps.release.outputs.release_created }}
54+
# env:
55+
# HEX_API_KEY: ${{secrets.HEX_API_KEY}}
56+
# run: |
57+
# mix hex.publish --yes
5158

52-
- name: publish to hex
53-
if: ${{ steps.release.outputs.release_created }}
54-
env:
55-
HEX_API_KEY: ${{secrets.HEX_API_KEY}}
56-
run: |
57-
mix hex.publish --yes
59+
# figure out how to get an apple silicon runner
60+
# to be able to build the burritos on CI
61+
# I will manually build them and upload for now
5862

59-
- name: Upload Release Artifact
60-
if: ${{ steps.release.outputs.release_created }}
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
run:
64-
gh release upload ${{ steps.release.outputs.tag_name }} ./bin/nextls
63+
# - name: Upload Release Artifact
64+
# if: ${{ steps.release.outputs.release_created }}
65+
# env:
66+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
# run:
68+
# gh release upload ${{ steps.release.outputs.tag_name }} ./bin/nextls

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ next_ls-*.tar
2424

2525
# Temporary files, for example, from tests.
2626
/tmp/
27+
burrito_out

.rtx.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[tools]
2-
elixir = "1.15.2"
2+
elixir = "1.15.4"
33
erlang = "26.0.2"
4+
zig = "0.10.0"

bin/7z

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
7zz "$@"

bin/start

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# used for local development
44

5+
set -e
6+
57
cd "$(dirname "$0")"/.. || exit 1
68

7-
iex --sname "next-ls-$RANDOM" -S mix run --no-halt -e "Application.ensure_all_started(:next_ls)" -- "$@"
9+
MIX_ENV=dev mix release --overwrite
10+
11+
./burrito_out/next_ls_macos "$@"

lib/next_ls/application.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ defmodule NextLS.Application do
77

88
@impl true
99
def start(_type, _args) do
10+
Node.start(:"next-ls-#{System.system_time()}", :shortnames)
11+
1012
children = [NextLS.LSPSupervisor]
1113

1214
# See https://hexdocs.pm/elixir/Supervisor.html

lib/next_ls/lsp_supervisor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defmodule NextLS.LSPSupervisor do
3434
:ignore
3535
else
3636
{opts, _, invalid} =
37-
OptionParser.parse(System.argv(),
37+
OptionParser.parse(Burrito.Util.Args.get_arguments(),
3838
strict: [stdio: :boolean, port: :integer]
3939
)
4040

0 commit comments

Comments
 (0)