Skip to content

Is Rambo incompatible with escript? #14

Open

Description

@mmower

I'm trying to use Rambo from a CLI tool built using MIX_ENV=prod mix escript.build.

The problem I am having is an error thrown from inside Rambo, see: https://gist.github.com/mmower/caea6d7b0f669a24f4f8ac01c8609a53

Note that the code works fine when run interactively via IEx.

Digging in a little the error seems to arise from:

def find_rambo do
  Path.join(:code.priv_dir(:rambo), @filename)
end

There's a whole load of stuff going on in compile_rambo.ex that I don't understand, but it looks like it builds the shim binary Rambo uses for handling input termination. Based on what I read I think the problem may be that the :priv folder isn't included in escript builds.

Anyway, something about this isn't seeming very happy in the escript context.

Can you help me, please?

Matt

Activity

  1. mmower commented on Oct 7, 2021

    @mmower
    Author

    Further to the above, I have found in the documentation:

    https://hexdocs.pm/mix/master/Mix.Tasks.Escript.Build.html

    Note: escripts do not support projects and dependencies that need to store or read artifacts from the priv directory.

    Unfortunately, Rambo's use of the priv folder means it can't be used with any application intended to be compiled to an escript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions