Closed PlumpMath closed 2 years ago
nbb is basically an npm library you can install if you have node.js / npm. is there a good reason to do this via nix - do other npm packages also get built specifically for nix?
Perhapa @jlesquembre has some thoughts about this too.
Of course, about nix.. there is nothing special other than provisioning that is set up in advance the result, Just to make the commands simpler and easier in my personal terminal (and furthermore, I see value in nbb to make nodejs-cljs-related development easier with nbb).
OK, I can see the benefit of setting up node / npm with nix, but is there a reason to build nbb instead of just installing it as a library when you already have node / npm in your nix environment?
Engineer. I'm not about gaining eternal life. haha -_-;;
makeWrapper '${pkgs.nodejs}/bin/node' "$out/bin/nbb" \
--prefix NODE_PATH : "${NODE_PATH}" \
--add-flags "$out/lib/nbb_main.js" \
--add-flags "--classpath ${classp}"
NODE_PATH="$HOME/.config/yarn/global/node_modules:${nodejs}/lib/node_modules:${js-react}/lib/node_modules:${js-aws-sdk_client-s3}/lib/node_modules:${js-execa}/lib/node_modules:${js-ffi-napi}/lib/node_modules:${nodePackages.gulp}/lib/node_modules:${js-babel_core}/lib/node_modules:${js-babel_preset-env}/lib/node_modules:${js-react-pdf_renderer}/lib/node_modules:${js-react-dom}/lib/node_modules:${js-rqlite-js}/lib/node_modules:${js-vega}/lib/node_modules:${js-vega-lite}/lib/node_modules:${js-tinyhttp_app}/lib/node_modules:${js-tinyhttp_logger}/lib/node_modules:${js-sqlite}/lib/node_modules:${js-sqlite3}/lib/node_modules:${js-showdown}/lib/node_modules:${nodePackages.rimraf}/lib/node_modules:${pouchdb}/lib/node_modules:${js-pdfkit}/lib/node_modules:${js-svg-to-pdfkit}/lib/node_modules:${js-pdfjs-dist}/lib/node_modules:${js-node-ical}/lib/node_modules:${js-jimp}/lib/node_modules:${js-exceljs}/lib/node_modules:${js-dockerode}/lib/node_modules:${js-zeromq}/lib/node_modules:${js-rhino3dm}/lib/node_modules:${js-lumino_widgets}/lib/node_modules:${js-nosferatu500_react-sortable-tree}/lib/node_modules:${js-nosferatu500_theme-file-explorer}/lib/node_modules:${js-yarn}/lib/node_modules:${js-playwright}/lib/node_modules:${js-puppeteer}/lib/node_modules";
# :${js-argparse}/lib/node_modules:${js-chalk}/lib/node_modules:${js-axios}/lib/node_modules:${js-cheerio}/lib/node_modules:${js-asciidoctor}/lib/node_modules:${js-import-meta-resolve}/lib/node_modules:${js-got}/lib/node_modules:${js-ink-select-input}/lib/node_modules:${js-handlebars}/lib/node_modules:${js-better-sqlite3}/lib/node_modules:${js-luxon}/lib/node_modules:${js-express}/lib/node_modules:${js-nbb}/lib/node_modules:${js-node-fetch}/lib/node_modules:${js-uuid}/lib/node_modules:${js-gulp-babel}/lib/node_modules:${if stdenv.isDarwin then js-itypescript else js-zeromq}/lib/node_modules:${js-zx}/lib/node_modules:${js-ink}/lib/node_modules
# :${js-leveldown}/lib/node_modules:${js-playwright}/lib/node_modules:${js-puppeteer}/lib/node_modules
like this? recently I Have been run all the examples as you made in nbb. Due to the nodejs ecosystem problem of nix, there were still some problem that could not be done, anyway I wourld like to enjoy nbb.
It's not that urgent. It doesn't matter if you tell me slowly. well. Personally, I have a busy day, but We are all clojure & nbb~~ :)) Thanks
Looking at the logs, it looks like clojure is still trying to fetch its dependencies from the network at build-time, and it fails because sandboxing is enabled:
repo1.maven.org: Temporary failure in name resolution
For reference, all hydra builds run with the Nix sandbox enabled.
Strangely, my custom nix works fine without errors on my nixos linux. I'm confusing because it only throws an error in borg build.
Did you disable sandboxing in your own? For example by setting nix.settings.sandbox = false;
in /etc/nixos/configuration.nix
?
In your derivation, you get a precomputed classpath from clj2nix
and pass it to the nodejs wrapper, but I don't think you ever use it in the buildPhase
. I think that may be why tools.deps is trying to fetch jars at that point.
I wrote some comments on the nixpkgs issue: https://github.com/NixOS/nixpkgs/pull/173452
I think we should continue the conversation there, since is nix specific and has not much to do with nbb itself.
Closing as something that's not worked on for nbb maintainers, but feel free to continue.
hello. I am uploading nbb to nixos nixpkgs. I'm getting an error when building, and I'm not sure how to handle this. Help me. Strangely, my custom nix works fine without errors on my nixos linux. I'm confusing because it only throws an error in borg build.
It seems that bb needs the jar file when building nbb as release , but it seems that the ci remote computer cannot find the jar file.
nbb derivation code: https://github.com/PlumpMath/nixpkgs/blob/nbb/pkgs/development/interpreters/clojure/nbb/default.nix
nixpkgs PR : https://github.com/NixOS/nixpkgs/pull/173452
Error Failed Log: https://logs.nix.ci/?key=nixos/nixpkgs.173452&attempt_id=af4306e5-c40b-4346-b497-8b5679ed039c
Thanks.