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

Update flake and potery deps #569

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

Update flake and potery deps #569

wants to merge 6 commits into from

Conversation

anpin
Copy link
Contributor

@anpin anpin commented Feb 13, 2025

This PR:

  • updates flake and poetry dependencies
  • fixes broken evaluation for ocaml
  • updates deprecated bits such as cargo fetchers and poetry dev-deps groups
  • updates documentation for custom kernel as it was misleading

Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for tweag-jupyterwith ready!

Name Link
🔨 Latest commit 2bee175
🔍 Latest deploy log https://app.netlify.com/sites/tweag-jupyterwith/deploys/67ae9154544f950008d0ba7f
😎 Deploy Preview https://deploy-preview-569--tweag-jupyterwith.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@anpin
Copy link
Contributor Author

anpin commented Feb 14, 2025

fixing ocaml kernel requires knowledge of some deep magic beyond my current understanding

[I 2025-02-13 21:47:20.765 ServerApp] Kernel started: 24b40db1-ce0c-4f76-ba46-5b3bf34dc4bb
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[I 2025-02-13 21:47:23.754 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[I 2025-02-13 21:47:26.769 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[I 2025-02-13 21:47:29.782 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (3/5), new random ports
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[I 2025-02-13 21:47:32.795 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (4/5), new random ports
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[I 2025-02-13 21:47:35.808 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (5/5), new random ports
/nix/store/p2s5ccpqgzgcq16b277rmfqg5bv0aflx-extra-ocaml-path: line 2: declare: BASHOPTS: readonly variable
[W 2025-02-13 21:47:38.823 ServerApp] AsyncIOLoopKernelRestarter: restart failed

@anpin
Copy link
Contributor Author

anpin commented Feb 14, 2025

hey @balsoft, pinging you since you are opam-nix maintainer. maybe you can help with this one?

@anpin
Copy link
Contributor Author

anpin commented Feb 14, 2025

I tried this very crude fix and it got me further

diff --git a/modules/kernels/ocaml/default.nix b/modules/kernels/ocaml/default.nix
index a023be6..ed17a50 100644
--- a/modules/kernels/ocaml/default.nix
+++ b/modules/kernels/ocaml/default.nix
@@ -76,6 +76,15 @@
         name = "extra-ocaml-path";
         packages = ocamlPackageDerivations ++ allRuntimePackages;
       };
+      patchedRuntimeEnv = pkgs.runCommand "patched-extra-ocaml-path" {
+        inherit runtimeEnv;
+      } ''
+        sed -e '/^declare -r BASH/d'\
+            -e '/^declare -ar BASH/d'\
+            -e '/^declare -ir/d'\
+            -e '/^declare -r/d'\
+            ${runtimeEnv.inputDerivation} > $out
+      '';
       ocamlinit = ''
         #use "${scope.ocamlfind}/lib/ocaml/${scope.ocaml.version}/site-lib/topfind";;
         Topfind.log:=ignore;;
@@ -93,7 +102,7 @@
             #     This is not the case with the nix store, so we have to point it to
             #     the corresponding store paths manually.
             wrapProgram $out/bin/$filename \
-              --run 'source ${runtimeEnv.inputDerivation}; source $stdenv/setup' \
+              --run 'source ${patchedRuntimeEnv}; source $stdenv/setup' \
               --suffix CAML_LD_LIBRARY_PATH : "$CAML_LD_LIBRARY_PATH"
           done
         '';
(END)
[I 2025-02-13 22:28:29.516 ServerApp] Kernel started: 4b8410a2-46c7-4989-a372-e42ee0a2b9b6
install: cannot create regular file '/build/env-vars': No such file or directory
2025-02-14T01:28:29  STDOUT>> Findlib has been successfully loaded. Additional directives:
2025-02-14T01:28:29  STDOUT>>   #require "package";;      to load a package
2025-02-14T01:28:29  STDOUT>>   #list;;                   to list the available packages
2025-02-14T01:28:29  STDOUT>>   #camlp4o;;                to load camlp4 (standard syntax)
2025-02-14T01:28:29  STDOUT>>   #camlp4r;;                to load camlp4 (revised syntax)
2025-02-14T01:28:29  STDOUT>>   #predicates "p,q,...";;   to set these predicates
2025-02-14T01:28:29  STDOUT>>   Topfind.reset();;         to force that packages will be reloaded
2025-02-14T01:28:29  STDOUT>>   #thread;;                 to enable threads
2025-02-14T01:28:29  STDOUT>>

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.

1 participant