spatial-shell icon indicating copy to clipboard operation
spatial-shell copied to clipboard

Package for Debian 12

Open spwhitton opened this issue 2 years ago • 12 comments

Hello,

I would very much like to try Spatial Shell. I run the latest release of Debian, "bookworm". I have no OCaml experience. When I try to use your build instructions, this is what happens:

swhitton@zephyr:~/src/spatial-shell>eval $(opam env --switch=default)
swhitton@zephyr:~/src/spatial-shell>make build-deps

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml-system"]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-system.4.13.1
∗ installed ocaml-config.2
∗ installed ocaml.4.13.1
Done.
# Run eval $(opam env) to update the current shell environment

<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from https://opam.ocaml.org
[spatial-shell.6] synchronised (file:///home/swhitton/src/spatial-shell)
spatial-shell is now pinned to git+file:///home/swhitton/src/spatial-shell#main (version 7-dev)

<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[spatial-shell.7-dev] synchronised (git+file:///home/swhitton/src/spatial-shell#main)

[ERROR] Package conflict!
  * Incompatible packages:
- (invariant) → ocaml-system
- spatial-shell >= 7-dev → ocaml >= 5.0.0 → ocaml-base-compiler < 5.0.2~
You can temporarily relax the switch invariant with `--update-invariant'
  * Missing dependency:
- spatial-shell >= 7-dev → ocaml >= 5.0.0 → ocaml-variants < 5.2.1~ → ocaml-beta
unmet availability conditions: 'enable-ocaml-beta-repository'

No solution found, exiting
make: *** [Makefile:46: build-deps] Error 20
2 swhitton@zephyr:~/src/spatial-shell>ocaml --version
The OCaml toplevel, version 4.13.1

I would be grateful for any input.

I am a Debian Developer, and so if I find I like Spatial Shell, I would be interested in getting it into the official Debian and Ubuntu repositories. But got to try it out locally first :)

spwhitton avatar Jan 10 '24 12:01 spwhitton

Alright, I was able to get it the static build to work by passing -j1 to make, and hacking --update-invariants into the Makefile. I wonder if OCaml 5 is absolutely required for this project to build. Unfortunately, Debian seems to be still on OCaml 4.

spwhitton avatar Jan 10 '24 21:01 spwhitton

Hi @spwhitton and thanks for opening this issue! I have to admit, I’m pretty exciting by your message. Let’s make sure we can make it work locally indeed!

I won’t bother you too much with the details, but basically, using ocaml-system by default was a mistake. I’ve pushed a patch to default to the latest version of OCaml, and make build-deps should work this time.

I’ve also amend the build instruction in order to be sure it works with users not familiar with OCaml. In particular, running eval $(opam env) after make build-dev-deps.

If you ran into another issue, don’t hesitate to report it! I really want Spatial Shell to be usable and having it packaged in Debian and Ubuntu would be… well, awesome to say the least.

Something I can suggest if you ran into an issue: use the scripts/prepare-release-artifacts.sh script first. This will build an archive containing static binaries (build with musl). It’s used in the CI on ubuntu, so that’s reassuring.

lthms avatar Jan 11 '24 00:01 lthms

I didn’t see your message before posting mine, sorry about that. I’ll take the liberty to reopen, just to clear a specific related question. The dependency to OCaml 5 is really not necessary, and I can lift it pretty easily I think, I now exactly why I need that and it’s a bad reason. If you think it’s better for, eventually, packaging Spatial Shell for Debian (if Opam local switches are not a proper solution), I’ll definitely spend the necessary (and small) time to remove it. It was bothering me in any case.

lthms avatar Jan 11 '24 00:01 lthms

Hello,

Thanks for your replies. To package for Debian, the most significant requirement is that any libraries you depend on will need to be packaged separately, rather than vendored into the source tree. We also can't download anything at package build time. And we'll need to target the version of OCaml that Debian has.

These are a bit onerous, I admit. But if you're not depending on anything too exotic, then hopefully it is already packaged in Debian. You can search to see what's already there by visiting https://packages.debian.org/libfoo-ocaml-dev and seeing if there are results. Are there actually any external deps beyond ocaml itself?

-- Sean Whitton

spwhitton avatar Jan 11 '24 09:01 spwhitton

Thanks for the explanation! I don’t have a lot of dependencies, but some are missing from Debian repo. I’ll try to get the list of missing packages and could even give a try to package them myself at first (I’ve always been curious about Debian packaging (: ).

lthms avatar Jan 11 '24 12:01 lthms

Oh, I was a bit too hasty in pushing my latest changes. It looks like Bookworm still provides OCaml 4.13, not the latest LTS.

I think I’ll add a CI change to check that we can still build Spatial Shell on Debian stable without having to specify the OCAML_COMPILER manually :sweat_smile:

lthms avatar Jan 11 '24 14:01 lthms

Hello,

I'd be very happy to do what I can to help you get those deps, and then indeed spatial-shell, into Debian. In particular, I can sponsor the uploads.

In this context, may I suggest renaming the main binary spatial->spatial-shell? 'spatial' is such a generic noun I think that it might be perceived as a namespace-grab.

-- Sean Whitton

spwhitton avatar Jan 11 '24 15:01 spwhitton

I'd be very happy to do what I can to help you get those deps, and then indeed spatial-shell, into Debian. In particular, I can sponsor the uploads.

That’s good to know, thanks!

'spatial' is such a generic noun I think that it might be perceived as a namespace-grab.

Would spatiald work better, you think?

lthms avatar Jan 11 '24 22:01 lthms

Let’s repurpose the issue. Having Debian packages (even not added to the official repositories) was on my todo list.

I am currently in the process in trying to have less dependencies and less constraints. Once this PR is merged Spatial Shell will be compatible with OCaml 4.13 (packaged in debian stable).

lthms avatar Jan 14 '24 12:01 lthms

According to the CI, here are the OCaml libs installed by make build-deps

lthms avatar Jan 14 '24 19:01 lthms

I'd be very happy to do what I can to help you get those deps, and then indeed spatial-shell, into Debian. In particular, I can sponsor the uploads.

That’s good to know, thanks!

I have a confession to make: I reimplemented most of Spatial Shell in Perl over the weekend. As such, I'm no longer willing to invest significant effort into packaging it for Debian. I hope this is not too disappointing.

'spatial' is such a generic noun I think that it might be perceived as a namespace-grab.

Would spatiald work better, you think?

Hmm, still quite generic. I thought of spatialshd.

spwhitton avatar Jan 15 '24 14:01 spwhitton

I have a confession to make: I reimplemented most of Spatial Shell in Perl over the weekend.

No worries. If you have any valuable lessons you are willing to share from this journey, I would welcome them very much!

I’ll keep this issue to try to track my progress on this matter nonetheless.

lthms avatar Jan 15 '24 14:01 lthms