Giter VIP home page Giter VIP logo

Comments (8)

andyl avatar andyl commented on June 24, 2024

FYI I posted a simple Elixir repo which recreates the issue. See https://github.com/andyl/zing

from muontrap.

fhunleth avatar fhunleth commented on June 24, 2024

I'm, unfortunately, not a user of Escripts so I don't know. I had the impression that libraries that supplied port binaries were incompatible with Escripts, but that doesn't sound like the error that you're running into. Hopefully someone lurking can provide a clue.

from muontrap.

fhunleth avatar fhunleth commented on June 24, 2024

Just a thought, but does Application.app_dir/2 work for other libraries with Escripts? I'm not sure what muontrap would have done to break this that would be unique to it.

from muontrap.

axelson avatar axelson commented on June 24, 2024

Yeah I think the issue is that Application.app_dir/2 doesn't work with escripts because there is no app directory for dependencies of an escript (although that may not be the 100% correct way of writing that). @andyl if it works for you maybe you could try using https://github.com/burrito-elixir/burrito instead of an script since I think deps will have an application directory then.

Although another alternative is to modify muontrap so it doesn't depend on Application.app_dir/2 and copy the binary manually and pass the path to the binary to muontrap. But that's rather invasive.

But for a partial example of what the calling code for that would look like you can take a look at how I handled it for erlexec:
https://github.com/axelson/ls_proxy/blob/6ae090620f4c1e9c95c403515cda3719f89862b2/ls_proxy/lib/erlexec_init.ex

A third alternative would be use erlexec (or its exexec wrapper) directly since it fulfills a similar goal to muontrap, unless what you needed was the cgroup support.

from muontrap.

fhunleth avatar fhunleth commented on June 24, 2024

+1 to use Burrito instead of Escripts. That will work since you'll be making and running an OTP release.

That's an interesting workaround to Escripts for erlexec. If the only change to muontrap is to add an option supplying a port binary path and using it in preference to calling Application.app_dir/2 in muontrap, then that doesn't sound like a big change. (Given that erlexec works already, though, that does sound like possibly the easiest change.)

from muontrap.

andyl avatar andyl commented on June 24, 2024

@axelson and @fhunleth - thanks for the guidance. I'll give it a try with Burrito and post here when I have some results.

from muontrap.

andyl avatar andyl commented on June 24, 2024

From my Linux dev box I couldn't get Burrito to cross compile. I expect because Burrito is new and not yet fully tested.

Other than that Burrito runs MuonTrap as expected & looks like a good workaround!

The MuonTrap / Burrito demo is at https://github.com/andyl/mt_demo

MuonTrap is super nice! Thanks again for the tips.

from muontrap.

fhunleth avatar fhunleth commented on June 24, 2024

Thanks for the update! Burrito is actively being worked on so, I expect it to get better. I really like the Burrito approach for this so I'm going to close this. Let me know if you have any other issues.

from muontrap.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.