Git Product home page Git Product logo

blog-resources's Issues

`nix-shell` fails in `monad-bayes-series`

$ nix-shell
[...]
> /nix/store/98fqirs1dkvm240kn72jj1s2ifd5xx3y-nodejs-10.16.3/bin/npm pack jupyterlab-ihaskell
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/jupyterlab-ihaskell failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2019-11-04T13_21_51_057Z-debug.log

Errored, use --debug for full output:
ValueError: "jupyterlab-ihaskell" is not a valid npm package
builder for '/nix/store/y6adzmayqwy62h129jbndf8gvr6546r8-jupyterlab-extended.drv' failed with exit code 1
building '/nix/store/141dpbcn222c9j6vfkzk4x2kw3922z9n-SHA-1.6.4.4.drv'...
cannot build derivation '/nix/store/r5nhlzghk0jh0nds6rmj3h97bm07yqss-python3.7-jupyterlab-0.35.6.drv': 1 dependencies couldn't be built
error: build of '/nix/store/r5nhlzghk0jh0nds6rmj3h97bm07yqss-python3.7-jupyterlab-0.35.6.drv', '/nix/store/wvrkhr418k31gmhd16kf26094q800gaz-ihaskell-kernel.drv' failed

Note that this is probably an issue with jupyterWith or some other upstream library and not with monad-bayes-series. But I'm not sure what the root issue actually is, so I'm creating this issue here.

Unfortunately I don't know where /build/.npm/_logs/2019-11-04T13_21_51_057Z-debug.log can be found.

The only relevant information about this failure that I could find is this: https://logs.nix.samueldr.com/nixos/2019-02-24#1988813;

22:32 Something about DNS not working during mkDerivation.

`nix-shell` in `monad-bayes-series` fails on darwin

I am having a problem setting up the environment in monad-bayes blog post series (https://github.com/tweag/blog-resources/blob/master/monad-bayes-series/shell.nix).

Describe the bug
nix-shell fails to install. The test session for ipython starts produces errors and fails.

...
Successfully installed ipykernel-5.1.2
/private/tmp/nix-build-python3.7-ipykernel-5.1.2.drv-0/ipykernel-5.1.2
Finished executing pipInstallPhase
post-installation fixup
strip is /nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/9bl1f5gxfp460l0w0kpsinp0b15s663v-python3.7-ipykernel-5.1.2/lib
patching script interpreter paths in /nix/store/9bl1f5gxfp460l0w0kpsinp0b15s663v-python3.7-ipykernel-5.1.2
running install tests
============================= test session starts ==============================
platform darwin -- Python 3.7.5, pytest-5.2.1, py-1.8.0, pluggy-0.13.0
rootdir: /private/tmp/nix-build-python3.7-ipykernel-5.1.2.drv-0/ipykernel-5.1.2
collected 106 items / 5 deselected / 101 selected                              

ipykernel/inprocess/tests/test_kernel.py .s..                            [  3%]
ipykernel/inprocess/tests/test_kernelmanager.py ....                     [  7%]
ipykernel/tests/test_async.py EEEE                                       [ 11%]
ipykernel/tests/test_connect.py .....                                    [ 16%]
ipykernel/tests/test_embed_kernel.py ...                                 [ 19%]
ipykernel/tests/test_eventloop.py E                                      [ 20%]
ipykernel/tests/test_heartbeat.py ...                                    [ 23%]
ipykernel/tests/test_io.py .                                             [ 24%]
ipykernel/tests/test_jsonutil.py .....                                   [ 29%]

Sometimes it hangs after test_jsonutil.py, after a fresh install of nix, it produces kernel died before replying.

To Reproduce
run nix-shell --option sandbox false.

Environment

  • OS name + version: macOS Catalina 10.15.5 (19F96)
  • Version of the code: Current master branch: c4521ad
  • Nix version: 2.3.5
    Happens on both single-user and multi-user mode, current user is in trusted-users.

Repo structure does not adhere to what README says

The README says:

The repository is structured as folders whose name is the same as the blog post file.
That is, the blog post `tweag.io/posts/2019-01-01-my-blog-post` will have a corresponding `2019-01-01-my-blog-post` folder with the desired files.

But the only two folders currently are mcmc-intro and monad-bayes-series, neither of which correspond to the path of the relevant blog posts.

I don't think that's a bad thing, necessarily. But it's not consistent with what the README says. So I suggest either

  • removing that paragraph from the README, or
  • renaming the directories so they adhere to what the README says.

[Monad-bayes] Running Notebook fails ValueError: "jupyterlab-ihaskell" is not a valid extension:

Describe the bug
Trying to run the notebook leads to

ValueError: "jupyterlab-ihaskell" is not a valid extension:
Missing extension module "lib/index.js"

To Reproduce
Follow https://github.com/tweag/blog-resources/tree/master/monad-bayes-series and

$ git clone https://github.com/tweag/blog-resources.git
$ cd blog-resources/

Install nix via https://nixos.wiki/wiki/Nix_Installation_Guide

$ sudo install -d -m755 -o $(id -u) -g $(id -g) /nix
$ curl -L https://nixos.org/nix/install | sh
$ source $HOME/.nix-profile/etc/profile.d/nix.sh

Install and run cachix

$ nix-env -iA cachix -f https://cachix.org/api/v1/install
$ cachix use jupyterwith

add username to trusted-users in ~/.config/nix/nix.conf
confirm with nix show-config | grep trusted-users

run nix-shell --option sandbox false

this fails because the root partition runs out of memory -> shut down pc, enlarge partition, restart. run nix-shell --option sandbox false again (without cachix use jupyterwith)
Eventual fail:

> /nix/store/sb3dfgiw8fgswvw0w8mhyghyqwxiar34-nodejs-10.17.0/bin/npm pack jupyterlab-ihaskell
/npm notice 
npm notice ๐Ÿ“ฆ  [email protected]
npm notice === Tarball Contents === 
npm notice 0     style/index.css
npm notice 1.2kB package.json   
npm notice 464B  README.md      
npm notice === Tarball Details === 
npm notice name:          jupyterlab-ihaskell                     
npm notice version:       0.0.12                                  
npm notice filename:      jupyterlab-ihaskell-0.0.12.tgz          
npm notice package size:  866 B                                   
npm notice unpacked size: 1.6 kB                                  
npm notice shasum:        2922b8d1c37b6376287744d97d2357ad228c5297
npm notice integrity:     sha512-FXE3KGNNRadi7[...]0FNX+8H/AalEg==
npm notice total files:   3                                       
npm notice 
jupyterlab-ihaskell-0.0.12.tgz

Traceback (most recent call last):

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 93, in start
    ans = self.run_task()

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 149, in run_task
    for i, arg in enumerate(self.extra_args)

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 149, in <listcomp>
    for i, arg in enumerate(self.extra_args)

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/commands.py", line 398, in install_extension
    return handler.install_extension(extension, pin=pin)

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/commands.py", line 611, in install_extension
    info = self._install_extension(extension, tempdir, pin=pin)

  File "/nix/store/40nff5mxfs1516z1axnfmlb1i1kklhps-python3.7-jupyterlab-1.2.2/lib/python3.7/site-packages/jupyterlab/commands.py", line 1508, in _install_extension
    raise ValueError(msg % (extension, '\n'.join(messages)))

ValueError: "jupyterlab-ihaskell" is not a valid extension:
Missing extension module "lib/index.js"

An error occured.
ValueError: "jupyterlab-ihaskell" is not a valid extension:
Missing extension module "lib/index.js"
See the log file for details:  /tmp/nix-build-jupyterlab-extended.drv-0/jupyterlab-debug-vces37h5.log
Exiting application: jupyter
builder for '/nix/store/h4kz1d6y15isglvmdm0q8fh16i4fyasv-jupyterlab-extended.drv' failed with exit code 1
cannot build derivation '/nix/store/bpwnk2kg37b39rwjfr6dhzczbd1gyysw-python3.7-jupyterlab-1.2.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7rgis0m1j5kvijjfz2bm30b3b969xwb5-ghci-monad-bayes.drv', '/nix/store/bpwnk2kg37b39rwjfr6dhzczbd1gyysw-python3.7-jupyterlab-1.2.2.drv', '/nix/store/ck9cs6amw1xiv8fcwbhkwbr9hrqkvlb2-ghc-monad-bayes.drv', '/nix/store/lz7lkj5s3gj2mvr7j1rajhc988x6zaag-ihaskell-kernel.drv' failed

try again with

cachix use jupyterwith
nix-shell --option sandbox false

Same error, slight variation:

....
See the log file for details:  /tmp/nix-build-jupyterlab-extended.drv-0/jupyterlab-debug-ae9up40y.log
Exiting application: jupyter
builder for '/nix/store/h4kz1d6y15isglvmdm0q8fh16i4fyasv-jupyterlab-extended.drv' failed with exit code 1
building '/nix/store/qz8s3wzi6wfws23s8ijsdl0qvvrjyri2-hlint-2.2.1.drv'...
...

Log file has different name, and like the first log file it doesn't exist. The last line of the above snippet building ... is new.

Expected behavior
Jupiter notebook should start up without errors

Environment

  • Ubuntu 20.04.2
  • nix-shell (Nix) 2.3.12
  • Version of the code: 1a101fa

Additional context
I'm not sure if the restart is necessary to reproduce the error. I don't know how to restore the state before ever calling
nix-shell --option sandbox false.

Why Liquid Haskell Matters syntax errors

In "Why Liquid Haskell Matters" (which is fantastically written by the way), there is an example of a refined data type:

{-@
data UExp
  = UVar {i:Int | 0 <= i} // indices are specified to be non-negative
  | ULam UExp
  | UApp UExp UExp
@-}
data UExp
  = UVar Int
  | ULam UExp
  | UApp UExp UExp

However, liquid haskell needs the value in the UVar data constructor to be wrapped in parentheses to parse it correctly:

data UExp
  = UVar ({i:Int | 0 <= i})
  | ...

At least, the latest liquid haskell does. This example may have worked fine when the blog post was originally written.

Network (sandbox?) problems during install

I get this far:

$ git clone [email protected]:tweag/blog-resources.git
$ cd blog-resources/monad-bayes-series/
$ nix-shell
these derivations will be built:
  /nix/store/20hirzhz0i127yzxmajc4lcybm0q5fkb-ihaskell-0.9.1.0.drv
  /nix/store/j73z0ladyq4yrw38m55k5pn7d4m9hcha-statistics-0.15.0.0.drv
  /nix/store/rx3mwb7zpds9k6ir5rzvfj3lcjxngd45-ihaskell-hvega-0.2.0.3.drv
  /nix/store/sibyb0yi8saw8bla0an844qza2d21xi4-monad-bayes-0.1.0.0.drv
  /nix/store/g49j5s00kn2yknv1g8151hs9ibf4ja48-ghc-8.4.4-with-packages.drv
  /nix/store/x0k9rww61qayljywdb4pyncxasmdb4al-ihaskell.drv
  /nix/store/26gr83zalnkrfjhciqdfxm3fnnbzhzr0-ihaskell-kernel.drv
  /nix/store/5x3wj8zijkffvwrrd7f39c88p5k5b8gg-jupyterlab-extended.drv
  /nix/store/9xbbdf7hcgh6sxil2vg6f1js6gfx8gjm-python3.7-jupyterlab-0.35.4.drv
building '/nix/store/5x3wj8zijkffvwrrd7f39c88p5k5b8gg-jupyterlab-extended.drv'...
building '/nix/store/20hirzhz0i127yzxmajc4lcybm0q5fkb-ihaskell-0.9.1.0.drv'...
building '/nix/store/j73z0ladyq4yrw38m55k5pn7d4m9hcha-statistics-0.15.0.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/rd5iasc26rbi07zmn41krzbpigk8ahzy-ghc-8.4.4.
unpacking sources
unpacking source archive /nix/store/9b8j5vbg94kz2cglzpdy73m2ysic5yc3-statistics-0.15.0.0.tar.gz
source root is statistics-0.15.0.0
setting SOURCE_DATE_EPOCH to timestamp 1539291821 of file statistics-0.15.0.0/tests/utils/Makefile
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.lhs, /build/Main.o )
installing
Linking Setup ...
Node v8.15.0

> /nix/store/35gq5y1l3b5fh0nf95h0izwaiyb7yvwi-nodejs-8.15.0/bin/npm pack jupyterlab-ihaskell
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/jupyterlab-ihaskell failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2019-09-30T13_46_59_160Z-debug.log

Errored, use --debug for full output:
ValueError: "jupyterlab-ihaskell" is not a valid npm package
builder for '/nix/store/5x3wj8zijkffvwrrd7f39c88p5k5b8gg-jupyterlab-extended.drv' failed with exit code 1
cannot build derivation '/nix/store/9xbbdf7hcgh6sxil2vg6f1js6gfx8gjm-python3.7-jupyterlab-0.35.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/26gr83zalnkrfjhciqdfxm3fnnbzhzr0-ihaskell-kernel.drv', '/nix/store/9xbbdf7hcgh6sxil2vg6f1js6gfx8gjm-python3.7-jupyterlab-0.35.4.drv' failed

I can access https://registry.npmjs.org/jupyterlab-ihaskell via wget and the browser. I don't have a proxy.

It has been suggested on IRC that one can only have network access inside a sandbox for fixed-output derivations. So possibly something here is not a fixed-output derivation and this is why it fails?

Error building Nix dependencies (HsInstances in monad-bayes-series)

Bug description
I get an error when executing $ nix show-config | grep trusted-users:

[179 of 205] Compiling HsInstances ( compiler/hsSyn/HsInstances.hs, dist/build/HsInstances.o )

/nix/store/fiaj00zrmb7dynd2q9xmcrh5rn0mjwj0-stdenv-linux/setup: line 1326: 173 Killed ./Setup build
builder for '/nix/store/00n4rqhj1n5m09anjh2y2vknjddfb90h-ghc-lib-parser-8.8.0.20190424.drv' failed with exit code 137
cannot build derivation '/nix/store/ly794v98kjbja9zyh63d4q8vfvcbh02p-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
building '/nix/store/ysn3j3y5n7paj6xy2rh44zaa1h0p3p11-python3.7-jupyter_nbextensions_configurator-0.4.1.drv'...
cannot build derivation '/nix/store/ck9cs6amw1xiv8fcwbhkwbr9hrqkvlb2-ghc-monad-bayes.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7rgis0m1j5kvijjfz2bm30b3b969xwb5-ghci-monad-bayes.drv', '/nix/store/bpwnk2kg37b39rwjfr6dhzczbd1gyysw-python3.7-jupyterlab-1.2.2.drv', '/nix/store/ck9cs6amw1xiv8fcwbhkwbr9hrqkvlb2-ghc-monad-bayes.drv', '/nix/store/hh7wwsq3bz0j5wb31xvhjah2svnbasyl-generate-directory.drv', '/nix/store/lz7lkj5s3gj2mvr7j1rajhc988x6zaag-ihaskell-kernel.drv' failed

Sometimes my computer freezes after running the command or it just kills the process (as above).

To Reproduce
I'm following the steps outlined in the monad-bayes-series README.md, precisely in step 4 that I run inside monad-bayes-series folder.

Expected behavior
I hope to build all the Nix dependencies to run the notebooks locally (step 5).

Environment
I'm running the last code-version (commit 37bd5b4) in Linux Mint 20 Xfce 64 bit
Linux Lenovo-G40-80 5.4.0-58-generic #64-Ubuntu SMP x86_64 GNU/Linux

Additional context
I ran the command from step 4 inside blog-resources/profiling (due to the redirect to default.nix, which is inside this folder).
I am a beginner to Nix and Haskell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.