Skip to content
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

Merged
merged 4 commits into from Dec 19, 2018
Merged

pharo: Simple fix for Iceberg #52466

merged 4 commits into from Dec 19, 2018

Conversation

rydnr
Copy link
Contributor

@rydnr rydnr commented Dec 18, 2018

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 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.

This PR is just adding libgit2 dependency and copying the libgit2.so file to the destination folder.

#52465

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -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/"
Copy link
Member

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?

Copy link
Member

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"

Copy link
Member

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.

Copy link
Member

@Mic92 Mic92 Dec 18, 2018

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.

Copy link
Contributor Author

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.

@Mic92
Copy link
Member

Mic92 commented Dec 18, 2018

cc @lukego

@rydnr
Copy link
Contributor Author

rydnr commented Dec 19, 2018

@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.

@lukego
Copy link
Contributor

lukego commented Dec 19, 2018

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.

@rydnr
Copy link
Contributor Author

rydnr commented Dec 19, 2018

@lukego You'll probably need to add libgit2 as well once you upgrade Pharo from 6.0 upwards.

@lukego
Copy link
Contributor

lukego commented Dec 19, 2018

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!

@Mic92 Mic92 merged commit 857853d into NixOS:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants