Git Product home page Git Product logo

Comments (4)

ralismark avatar ralismark commented on September 28, 2024

Thanks for finding this issue, and for the simple reproduction instructions! Seems like it's from this assert in here: https://github.com/ralismark/nix-appimage/blob/main/flake.nix#L130

  let
    # use same auto-detect that <https://github.com/NixOS/bundlers> uses
    main =
      if drv?meta && drv.meta?mainProgram then drv.meta.mainProgram
      else (builtins.parseDrvName (builtins.unsafeDiscardStringContext drv.name)).name;
    mainPath = "${drv}/bin/${main}";
  in
  assert pkgs.lib.assertMsg (builtins.pathExists mainPath) "main program ${mainPath} does not exist"; # <-----
  mainPath;

I added it since if it didn't guess the right main program it would just silently create a broken AppImage, but I guess it doesn't work reliably in pure mode. Simple fix would be to remove the check, but I'd prefer there to still be some safeguard against that happening.

I'm not extremely familiar with nix but I can try figure something out over the next few days. Do you know any good ways of checking if a derivation has a specific file?

from nix-appimage.

lucasew avatar lucasew commented on September 28, 2024

Well, one workaround I can see right now is one is another derivation that depends on the first one and checks if the file exists, if Yes then create a folder in $out, if not raise an error. If that derivation is marked as a dependency to the final derivation it will run. In pure mode you cant access arbitrary nix paths, you must have that declared as some kind of dependency.

from nix-appimage.

ralismark avatar ralismark commented on September 28, 2024

I've pushed a fix to the develop branch that uses builtins.readDir instead, and it seems to work with your example:

nix bundle --bundler github:ralismark/nix-appimage?ref=develop github:lucasew/nixcfg#pkgs.wineApps.wine7zip

Can you try this and let me know if it fixes it?

from nix-appimage.

lucasew avatar lucasew commented on September 28, 2024

It works!!

Thank you, now it builds without --impure.

from nix-appimage.

Related Issues (15)

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.