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
pharo: Simple fix for Iceberg #52466
Conversation
@@ -92,6 +92,9 @@ stdenv.mkDerivation rec { | |||
LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:$libs" exec $out/pharo "\$@" | |||
EOF | |||
chmod +x "$out/bin/${cmd}" | |||
cp ${libgit2}/lib/libgit2.so.0.26.6 "$out/" | |||
cp ${libgit2}/lib/libgit2.so.26 "$out/" | |||
cp ${libgit2}/lib/libgit2.so "$out/" |
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.
Would a symlink work here too?
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.
ln -s ${libgit2}/lib/libgit2.so* "$out"
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.
Why does libgit2
have to be linked/copied and not added to buildInputs
, unlike all the other libs?
Maybe add a comment.
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.
The explanation can be copied from the pr message.
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.
This is needed because Iceberg assumes it'll be using the libgit2 bundled by Pharo, which is expected to be in the same folder as the VM itself. Even if libgit2 dependency is resolved at runtime, Iceberg performs that check and would fail if the file is not where Iceberg expects it to be.
cc @lukego |
@Mic92 I need libgit2 in the first line of pkgs/development/pharo/vm/vms.nix since I need it to patch the ELF and for the symlinks. |
Sorry, I am not really maintaining the Pharo package, and we should take my name off. I was not able to find a Git workflow that works for me and nixpkgs - because I want to work on the stable branch but packaging updates have to be based on master - and so I created a separate out-of-tree packaging of Pharo for my own needs over at https://github.com/studio/studio/tree/master/backend/pharo/vm. |
@lukego You'll probably need to add |
Thanks for the tip @rydnr. I made some attempts to try Iceberg about a year ago but I always ended up with segfaults related to libgit and so I put that aside. Great that you have made better progress on that! |
Motivation for this change
Pharo now includes a tool called Iceberg, capable of managing source code repositories from within the Pharo image. For git repositories, it relies upon
libgit2
.For it to work in NixOS, we need to patch the Pharo elf to provide the path of
libgit2.so
dependency, and also add it to the same folder as the Pharo VM. This is needed because Iceberg assumes it'll be using thelibgit2
bundled by Pharo, which is expected to be in the same folder as the VM itself. Even iflibgit2
dependency is resolved at runtime, Iceberg performs that check and would fail if the file is not where Iceberg expects it to be.This PR is just adding
libgit2
dependency and copying thelibgit2.so
file to the destination folder.#52465
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)