-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revamp appimage functionality #76
base: master
Are you sure you want to change the base?
Conversation
Update: my appimagekit PR was accepted into nixpkgs, so we can switch the input to nixos/nixpkgs. I'm moving today, so I might not have time for the next couple of days, but it's on my todo list. |
Alright, done. No dependencies on my fork of nixpkgs |
now this bundler can be used with `nix bundle` this is fully backward-compatible
Hi @Radvendii ! Thank you so much for all the effort put into this PR. I would really really love to get AppImage support working for my desktop + OpenGL app and I'm willing to help as much as needed to get this PR working. I have given it a try and sadly it is not working for me. The issues are the following:
Here are some details about my system:
{
rev ? "08ef0f28e3a41424b92ba1d203de64257a9fca6a",
sha256 ? "1mql1gp86bk6pfsrp0lcww6hw5civi6f8542d4nh356506jdxmcy",
nixpkgs ? builtins.fetchTarball {
name = "nixpkgs-${rev}";
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
sha256 = sha256;
}
}
let
nix-bundle-src = pkgs.fetchFromGitHub {
owner = "radvendii";
repo = "nix-bundle";
rev = "5e1e68dab10013871481d922038c6be57da92dc7";
sha256 = "08aypxfw7l2a648qpsmrk3f13k6f9rrlpmnippy755crf7mcp9yw";
};
nix-bundle_appimage = import "${nix-bundle-src}/appimage" { inherit pkgs; };
Again, thank you very much and let me know if there is anything I can try or any other way you think I can help. ❤️ Cheers! |
The first issue I guess it's because I was not using the glibc overlay. I'm, trying that now... building overnight... let's see how that goes :) |
Ok, that has failed as well 😢
|
Ok, I worked around that with this: arximboldi@8c27151 New error:
|
Ok, moved past that with this: arximboldi@b5ca53b Now it fails at
|
I've tried also downgrading I guess I'm having all these issues because I am using a more recent |
Progress!!! So I decided that glibc 2.24 was too old. The oldest Ubuntu LTS uses glibc 2.27. After a lot of fighting, I managed to make an overlay for glibc 2.27 build: But now I'm back at:
|
I suspect that the first error is due to using an unpatched |
@@ -74,7 +74,7 @@ NIX_PATH="nixpkgs=https://github.com/matthewbauer/nixpkgs/archive/nix-bundle.tar | |||
|
|||
This will create a file at Emacs-x86_64.AppImage which you can execute. | |||
|
|||
Notice that there is only one argument for nix2appimage.sh. This is because the target executable will be detected from the .desktop file in ```/share/applications/*.desktop```. As a side-effect, AppImage requires your package to have a .desktop file, so packages like "hello", "coreutils", etc. will not work. | |||
Notice that there is only one argument for nix2appimage.sh. This is because the target executable will be detected from the .desktop file in ```/share/applications/*.desktop```. If there is no .desktop file, nix2appimage will attempt to create one. If, however, there are more than one executable in the bin/ directory, we can't pick one, and there will have to be a .desktop file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there are multiple .desktop files?
Thank you, this looks like a huge improvement. I am still struggling with the usage of the command line tools though (similar to #55). I naively tried Edit: I got it working now by directly invoking the Nix expression. The CLI issue I had is just the shell script being weird in general and has nothing to do with the PR. (It definitely craves an overhaul too, but this is probably out of score for this PR) Now that I've built my AppImage, I can confirm the "undefined symbol: _dl_catch_error_ptr, version GLIBC_PRIVATE" error on Arch w/Nix. Could we maybe work around this by switching to the Go implementation of appimagetool, since IIRC that one does not depend on libc? |
@Radvendii... are there any news on this? Have you been managing to create appimages with OpenGL support via this or some other mechanism lately? I'm still shopping for a solution 😅 |
Not recently. https://github.com/Radvendii/MAR1D is the last I worked on this. |
Cool, thanks! I'll try build that project see what happens... |
I couldn't get the existing appimage part of nix-bundle working, so I went in and changed a bunch of stuff, and it now works for me.
Note that this pull request is not quite ready, for reasons I'll get to at the end.EDIT: It's ready!Overview of the changes:
Questions / Problems
My updated appimagekit package is not in nixpkgs yet, so for now I have the input pointed at my personal fork. Once it does go in, it will still be necessary to use a very up to date copy of nixpkgs. I noticed that currently it's set to an older, stable branch, so I'm not sure how you feel about this change or whether it would affect the regular nix-bundle at all.EDIT: Solved! I just made multiple inputs.
Style question: I found a list of libraries to exclude from appimages in the AppImage/pkg2appimage repo. Should I leave this as a file and parse it in the code, or should I turn it into a list in .nix file (this would also mean users could override it)EDIT: Solved! Not sure if this is the ideal solution, but I changed the file into a nix expression and then loaded it in as the default argument
The AppImages produced by this code can run on other distros (TBH I've only tested ubuntu so far). However, they have to be extremely up to date versions of the distros (Ubuntu 20.10 not Ubuntu 20.04). The reason for this is glibc. We have to use the system glibc at runtime, but nixpkgs builds using the most current glibc.Glibc is backwards compatible but not forwards, so the right thing to do is to build using an older version of glibc, or use the .symver assembler instruction to force linking against older versions of the glibc symbols.I tried many variations of both of these options and made significant progress, but could not get anything fully working. I don't think this is a strictly necessary part of the tool (firefox, for example, deals with this on it's own and the AppImage runs fine). But it would be extremely useful to include an overlay that users could apply to their nixpkgs to build packages that link against older glibc symbols so that their appimages can run on older distros.I would greatly appreciate some help getting this last piece of the puzzle to work. The easiest way would probably be to schedule a call so I can explain what I've tried and what's going wrong, but I can try writing it all out if that's easier.EDIT: Solved! It's available as
nix-bundle.overlays.glibc_2_24