Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update burrito #367

Merged
merged 9 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ldkfj
  • Loading branch information
mhanberg committed Feb 13, 2024
commit f3b3f2d28dea4b23894876c3422cb1a354a20530
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 66 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,62 @@

# Helper to provide system-specific attributes
forAllSystems = f:
nixpkgs.lib.genAttrs (builtins.attrNames burritoExe) (system: let
lib.genAttrs (builtins.attrNames burritoExe) (system: let
pkgs = nixpkgs.legacyPackages.${system};
beamPackages = pkgs.beam_minimal.packages.erlang_26;
elixir = beamPackages.elixir_1_15;
beam = fetchTarball {
url = "https://beam-machine-universal.b-cdn.net/OTP-26.2.1/linux/x86_64/any/otp_26.2.1_linux_any_x86_64_ssl_3.1.4.tar.gz?please-respect-my-bandwidth-costs=thank-you";
sha256 = "11z50xrmngsn0bzg7vn7w5h76iwmhscx01vij9ir2ivybjc8niky";
};
musl = builtins.fetchurl {
url = "https://beam-machine-universal.b-cdn.net/musl/libc-musl-17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd.so?please-respect-my-bandwidth-costs=thank-you";
sha256 = "1g9x5l7jybjr3wl15v3jjka3mvdvqn2hfxg60zlybacs7p0kwq8p";
};
beam = fetchTarball beams.${system};
rawmusl = musls.${system};
musl = lib.optionals nixpkgs.legacyPackages.${system}.stdenv.isLinux (builtins.fetchurl (nixpkgs.lib.attrsets.getAttrs ["url" "sha256"] musls.${system}));
in
f {inherit system pkgs beamPackages elixir beam musl;});
f {inherit system pkgs beamPackages elixir beam rawmusl musl;});

burritoExe = {
"aarch64-darwin" = "darwin_arm64";
"x86_64-darwin" = "darwin_amd64";
"x86_64-linux" = "linux_amd64";
"aarch64-linux" = "linux_arm64";
};

beams = {
"aarch64-darwin" = {
url = "https://beam-machine-universal.b-cdn.net/OTP-26.2.1/macos/universal/otp_26.2.1_macos_universal_ssl_3.1.4.tar.gz?please-respect-my-bandwidth-costs=thank-you";
sha256 = "0sdadkl80pixj9q3l71zxamh9zgmnmawsc4hpllgvx9r9hl30f40";
};
"x86_64-darwin" = {
url = "https://beam-machine-universal.b-cdn.net/OTP-26.2.1/macos/universal/otp_26.2.1_macos_universal_ssl_3.1.4.tar.gz?please-respect-my-bandwidth-costs=thank-you";
sha256 = "0sdadkl80pixj9q3l71zxamh9zgmnmawsc4hpllgvx9r9hl30f40";
};
"x86_64-linux" = {
url = "https://beam-machine-universal.b-cdn.net/OTP-26.2.1/linux/x86_64/any/otp_26.2.1_linux_any_x86_64_ssl_3.1.4.tar.gz?please-respect-my-bandwidth-costs=thank-you";
sha256 = "11z50xrmngsn0bzg7vn7w5h76iwmhscx01vij9ir2ivybjc8niky";
};
"aarch64-linux" = {
url = "https://beam-machine-universal.b-cdn.net/OTP-26.2.1/linux/aarch64/any/otp_26.2.1_linux_any_aarch64_ssl_3.1.4.tar.gz?please-respect-my-bandwidth-costs=thank-you";
sha256 = "0ich3xkhbb3sb82m7sncg0pr1d3z92klpwrlh8csr8i1qjhg40h5";
};
};

musls = {
"x86_64-linux" = {
url = "https://beam-machine-universal.b-cdn.net/musl/libc-musl-17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd.so?please-respect-my-bandwidth-costs=thank-you";
sha256 = "1g9x5l7jybjr3wl15v3jjka3mvdvqn2hfxg60zlybacs7p0kwq8p";
file = "libc-musl-17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd.so";
};
"aarch64-linux" = {
url = "https://beam-machine-universal.b-cdn.net/musl/libc-musl-939d11dcd3b174a8dee05047f2ae794c5c43af54720c352fa946cd8b0114627a.so?please-respect-my-bandwidth-costs=thank-you";
sha256 = "0yk22h0qpka6m4pka33jajpl6p2cg6pg4ishw3gahx5isgf137ck";
file = "libc-musl-939d11dcd3b174a8dee05047f2ae794c5c43af54720c352fa946cd8b0114627a.so";
};
};
in {
packages = forAllSystems ({
pkgs,
system,
beamPackages,
beam,
musl,
rawmusl,
elixir,
}: let
aliased_7zz = pkgs.symlinkJoin {
Expand Down Expand Up @@ -72,20 +100,27 @@
src = self.outPath;
inherit version elixir;
pname = "next-ls-deps";
hash = "sha256-JJbiJhVqeRrJseyDyxaUOmTDmSQTfOXuMLEHLhETJek=";
hash = "sha256-U5d8DftG0i1c4JiutUentNlRsefFgR4Mfc3eKqnKR3U=";
mixEnv = "prod";
};

BURRITO_ERTS_PATH = "/tmp/beam/";
BURRITO_TARGET = lib.optional localBuild burritoExe.${system};

preBuild = ''
export HOME="$TEMPDIR"
mkdir -p /tmp/beam/otp
cp -r --no-preserve=mode,ownership,timestamps ${beam}/. /tmp/beam/otp
cp --no-preserve=ownership,timestamps ${musl} /tmp/libc-musl-17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd.so
chmod +x /tmp/libc-musl-17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd.so
'';
preBuild =
''
export HOME="$TEMPDIR"
mkdir -p /tmp/beam/otp
cp -r --no-preserve=ownership,timestamps ${beam}/. /tmp/beam/otp
''
+ (
if (pkgs.stdenv.isLinux)
then ''
cp --no-preserve=ownership,timestamps ${musl} /tmp/${rawmusl.file}
chmod +x /tmp/${rawmusl.file}
''
else ""
);

postInstall = ''
chmod +x ./burrito_out/*
Expand Down Expand Up @@ -117,7 +152,19 @@
}: {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = [pkgs.zsh beamPackages.erlang elixir pkgs.xz pkgs.zig_0_11 pkgs._7zz pkgs.starship pkgs.ncurses5 pkgs.autoconf pkgs.automake pkgs.openssl];
packages = [
beamPackages.erlang
elixir
pkgs._7zz
pkgs.autoconf
pkgs.automake
pkgs.ncurses5
pkgs.openssl
pkgs.starship
pkgs.xz
pkgs.zig_0_11
pkgs.zsh
];
};
});
};
Expand Down
10 changes: 2 additions & 8 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ defmodule NextLS.MixProject do
[
{:exqlite, "~> 0.13.14"},
{:gen_lsp, "~> 0.7"},
{:req, "~> 0.4.0"},
{:req, "~> 0.3"},
{:schematic, "~> 0.2"},

{:opentelemetry, "~> 1.3"},
{:opentelemetry_api, "~> 1.2"},
{:opentelemetry_exporter, "~> 1.4"},
{:opentelemetry_process_propagator, "~> 0.2.2"},
{:opentelemetry_telemetry, "~> 1.0"},
{:burrito, github: "mhanberg/burrito", branch: "jdkfas", only: [:dev, :prod]},
{:burrito, "~> 1.0", only: [:dev, :prod]},
{:bypass, "~> 2.1", only: :test},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev},
Expand Down Expand Up @@ -96,12 +96,6 @@ defmodule NextLS.MixProject do

erts_path = System.get_env("BURRITO_ERTS_PATH", "")

dbg File.ls("/tmp")

dbg erts_path
dbg File.exists?(erts_path)
dbg File.ls(erts_path)

Enum.map(targets, fn {target_name, target_conf} ->
case erts_path do
"" -> {target_name, target_conf}
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
"acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"},
"burrito": {:git, "https://github.com/mhanberg/burrito.git", "53a5ef10be07691d3cf45180aa66867d1463a293", [branch: "jdkfas"]},
"burrito": {:hex, :burrito, "1.0.2", "f1233414d38e7c4b9f7a883de0f0c5546b3704cff5b0369e63756c126d434e4c", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:req, "0.4.0", [hex: :req, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.2.0 or ~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "62206c1401f36bf5eeb9a2e64e4e2ed9cb778d249f2c2eec26bafd31744858e5"},
"bypass": {:hex, :bypass, "2.1.0", "909782781bf8e20ee86a9cabde36b259d44af8b9f38756173e8f5e2e1fabb9b1", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "d9b5df8fa5b7a6efa08384e9bbecfe4ce61c77d28a4282f79e02f1ef78d96b80"},
"castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"},
"cc_precompiler": {:hex, :cc_precompiler, "0.1.8", "933a5f4da3b19ee56539a076076ce4d7716d64efc8db46fd066996a7e46e2bfd", [:mix], [{:elixir_make, "~> 0.7.3", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "176bdf4366956e456bf761b54ad70bc4103d0269ca9558fd7cee93d1b3f116db"},
Expand Down
Loading