epilgrim

epilgrim

Compile erlang dependency (fwknop) that is inside a subfolder of github repo

i’m trying to reuse an erlang implementation of a library that implements multiple language clients on their repo (eg /erlang, /perl, /python). Inside the erlang path, there is a rebar.config file

How am I supposed to include it and compile it?
To test it in my local computer, i did::

   {:fwknop_src, git: "https://github.com/mrash/fwknop.git", branch: "master", compile: false, app: false},
   {:fwknop, path: "deps/fwknop_src/erlang", runtime: false},

and it works.
then, i also tried moving it to the root, and it also works.

The problem is, none of this approaches work when going to prod.
Is there any way to configure mix to cope with the subpath?
if there is none, then i’m left with one of the following options

  1. Open a PR asking the fwknop to move the rebar.config file to the root. Looking at the repo, and the multiple implementations they have it’s unlikely that they will pollute the root directory. And in any case, i couldn’t find the right config for it, even setting src_dirs fails when compiling
  2. Create a new repo with a copy of the erlang folder
  3. Migrate the library to elixir, and publish it on it’s own repo.

None of this 3 options are really appealing. Therefore, if mix could be configured, then I would go with that one. If not, i would probably go with migrating it to elixir

Marked As Solved

NobbZ

NobbZ

The git source knows the :sparse option, perhaps that’s what you need?

:sparse - checkout a single directory inside the Git repository and use it as your Mix dependency. Search “sparse git checkouts” for more information.

Also Liked

epilgrim

epilgrim

ohh man!!! completely missed this!!!
i think I was reading the docs around path, and missed the git config. this is awesome

thank you for your help @gon782 and @NobbZ !! you rock

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
yawaramin
In the Dialyzer docs ( dialyzer — OTP 29.0.2 (dialyzer 6.0.1) ), there is a way to turn off a specific warning for a function: -dialyzer...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43806 214
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement