mpope
I have a rebar3 project that I am adding some Elixir deps. I want to keep the deps minimal, and that includes not fetching optional deps. It seems that the libraries that I have tried to use, rebar3_hex, and rebar3_elixir namely, fetch deps that are listed as optional in a project’s mix.exs file. An example is Jason: the decimal dep is fetched. It doesn’t seem as though rebar3 supports optional deps, and it doesn’t look like the mix.lock file contains the relevant metadata to declare that a top level dep is optional. I think the plugins fetch deps by parsing the mix.lock file and constructing a rebar.lock file. Is there any rebar3 plugin or convention that I could be missing that could support this functionality?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 5 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tristan
I think it might be acceptable to just change https://github.com/erlang/rebar3/blob/master/src/rebar_packages.erl#L232-L235 to:
ericmj
The optional information is in the registry so rebar3 has the information before fetching the package.
mpope
Is the package info fetched from hex used anywhere? All I see if a check for errors and printing in rebar_prv_packages.erl from the result of this call rebar3/src/rebar_packages.erl at f23e5a423347c0b04d8513410132a875f3767340 · erlang/rebar3 · GitHub
mpope
Would an optional field need to be added here: https://github.com/erlang/rebar3/blob/master/src/rebar_app_info.erl#L79
then checked in
maybe_fetchhere: https://github.com/erlang/rebar3/blob/master/src/rebar_prv_install_deps.erl#L330 ?Optional would be set to false if the dep is a top-level dep in the current list?
Looks like hex returns the metadata with the Fetch a Release endpoint according to their docs:
tristan
The
rebar_mixplugin work by using the list of dependencies from the hex metadata.My guess is
rebar3would need to be updated to ignore deps marked as optional.This was never done because it currently, and may always, mean nothing to Erlang projects because unlike Mix the deps list and the
.appfile are completely separate. I could see that changing since we already have a.app.srcit would be possible to add a feature of parsing theapplicationslist and if the app is{app, optional}drop it or change it to justappdepending on if the app is included in the final dependencies of the project.Anyway… got off topic there, tldr: rebar3 needs to learn to ignore dependencies marked as
optionalin the hex metadata.