Giter VIP home page Giter VIP logo

Comments (5)

giodamelio avatar giodamelio commented on June 14, 2024

Even with the fork I can't get it to work, since Judge uses declare-binscript.

from janet-nix.

turnerdev avatar turnerdev commented on June 14, 2024

Hey @giodamelio apologies for the late response, only just saw this. I actually ran into this same issue when trying to build with Judge recently, I'll take a look see what options are available

from janet-nix.

giodamelio avatar giodamelio commented on June 14, 2024

No worries at all. I am pretty new to Nix and brand new to Janet, so thanks for providing this project to hack on.

from janet-nix.

giodamelio avatar giodamelio commented on June 14, 2024

Thanks for the quick update! I will give it a shot this weekend.

from janet-nix.

turnerdev avatar turnerdev commented on June 14, 2024

I've added a new attribute extraDeps to pass dependencies directly to mkJanet, so it's possible to generate the sources in advance:

~/repos/judge $ jpm make-lockfile && nix run github:turnerdev/janet-nix
...
[
  { url = "https://github.com/ianthehenry/cmd"; rev = "7551225818a8a5f6665a918f1862db0c7704a1f4"; submodules = true; }
]

Unfortunately I still run into issues trying to build a working derivation for Judge. I got close with this:

{
  judge = janet-nix.packages.${system}.mkJanet {
    name = "judge";
    src = builtins.fetchGit {
      url = "https://github.com/ianthehenry/judge";
      rev = "c2a7eadf6cbf9ffad6f880c2ddbdbc03009a655f";
    };
    extraDeps = [{
      url = "https://github.com/ianthehenry/cmd";
      rev = "7551225818a8a5f6665a918f1862db0c7704a1f4";
    }];
    main = ''
      (import cmd)
      (import judge/runner)
      (defn main [& args]
        (put root-env :syspath (string (os/getenv "JANET_TREE") "/lib"))
        (setdyn *executable* "")
        (setdyn *args* (drop 1 (dyn *args*)))
        (cmd/main runner/main)
        (main))
    '';
  };
}

But it seems declare-binscript output expects to be interpreted as a script rather than run as a standalone binary. Passing a modified version of src/judge to the new main attribute gets it to build and run, but it still has issues.

After giving it more thought, it probably makes sense to just install Judge into the local environment via jpm install, since the tests (use judge) anyway. For an example see https://github.com/turnerdev/janet-nix/blob/main/templates/full/flake.nix#L71-L76

Thanks again for the feedback!

from janet-nix.

Related Issues (1)

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.