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

Add onix-based flake, associated make task, and .envrc template #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

emeinhardt
Copy link

Prelude to a minor bugfix PR in imandra-document + low-stakes example of a simple onix-based flake.

@emeinhardt emeinhardt self-assigned this Nov 15, 2024
Copy link
Member

@actionshrimp actionshrimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - this looks handy for a quick testing setup as you say and nice one figuring out the onix setup here.

We briefly touched on this when we were disucssing on Friday, but I now realise that although pinning the ocaml version to 5.2.0 is fine for compiling imandra-document with dune, when imandra-document is loaded into imandra for reasoning purposes it will need to be compatible with Imandra's OCaml version, which is currently 4.12.1.

So it is probably a helpful test to keep this dev setup's ocaml version to 4.12.1 too, to ensure that any changes to imandra-document still work on older OCaml versions and therefore remain compatible with imandra.

Otherwise looks good!

@actionshrimp
Copy link
Member

actionshrimp commented Nov 18, 2024

Actually your point about LSP has made me reconsider this, pinning to 4.12 will give us a really old LSP version as they tend to enforce that newer LSPs build on newer ocaml versions which can be slightly annoying! So for a local setup, I think keeping to a newer ocaml version makes sense.

Ideally imandra-document would have a regular ocaml CI step (something like this) that actually installs it on the correct 4.12 version via opam, as that's what the imandra-installer does.

edit: nevermind, there already is one! we just need to add 4.12 to the list I believe.

@actionshrimp actionshrimp self-requested a review November 18, 2024 15:46
@emeinhardt
Copy link
Author

emeinhardt commented Nov 19, 2024

I've made the changes we discussed, [EDIT] and now nix run .#onix-lock-dev runs as expected. To do that I just needed to make sure the sed command explicitly sets a lockfile; without that, the default behavior of the onix CLI is to modify onix-lock.json.

flake-utils.url = "github:numtide/flake-utils";

onix = {
url = "github:rizo/onix/3740a2beb84bc21860385f8bbb0d5f557842de03";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the onix readme, the API might change, so I've pinned the version here.

flake.nix Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants