Giter Site home page Giter Site logo

nix-repl's People

Contributors

edolstra avatar ehmry avatar fkz avatar mbbx6spp avatar olejorgenb avatar orbekk avatar solson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nix-repl's Issues

Segmentation fault when using tarball in NIX_PATH

$ NIX_PATH=nixpkgs=http://nixos.org/channels/nixos-16.03/nixexprs.tar.xz nix-shell -p nix-repl --run nix-repl
/run/user/499/nix-shell.ZX0UGk/rc: line 1: 15369 Segmentation fault      nix-repl

$ nix-build -A nix-repl '<nixpkgs>'
/nix/store/3f0k61j9kr5l99156m0s8ydx101yymwa-nix-repl-1.11.2-8a2f5f0

--help is not implemented

$ nix-repl --help
error: unrecognised option ‘--help’
Try ‘nix-repl --help’ for more information.

This is true for nix-repl 1.8 and 1.9.

Crash on particular prompt

 ~  nix-repl    
Welcome to Nix version 1.7. Type :? for help.

nix-repl> builtins.readFile ""
error: boost::too_many_args: format-string refered to less arguments than were passed
 ~

Comment support

Now that nix-repl supports multiline expressions, I think it's a good time to add support for comments as well. So that when you copy multiline expressions that have comments, it doesn't message up the interpretation. It should be just like nix in files. With # ... \n|$ identified as a comment.

`nix-repl` crashes with recent Nix

When using nix-repl built against nix commit 6519f06f397448c3f1677e87e385012e2507164b:

$ nix-repl '<nixpkgs>'
nix-repl: src/libexpr/eval.cc:266: nix::EvalState::EvalState(const Strings&): Assertion `gcInitialised' failed.
Aborted (core dumped)

bad input to bultins.toPath crashes nix-repl

To reproduce...

nix-repl> builtins.toPath "a"
error: boost::too_many_args: format-string refered to less arguments than were passed

Exits to shell. Seems like a harsh penalty :-)

Crash when faking derivation

simple like that (nix-repl-1.7-1734e8a)

nix-repl> { type = "derivation"; drvPath = "crash me please"; }
error: boost::too_many_args: format-string refered to less arguments than were passed
«derivation 

Missing man page

A man page describing what the program is all about, how it works and how to work with it would be nice to have.

show-trace doesn't work

The show-trace option is accepted, but it doesn't seem to do anything, at least there's no trace displayed.
Simple example:

$ nix-build --eval --expr "let a = z: 7 ++ 7; in a 0" --show-trace
error: while evaluating ‘a’ at (string):1:9, called from (string):1:23:
value is an integer while a list was expected, at (string):1:12

whereas

$ nix-repl --show-trace
nix-repl> let a = z: 7 ++ 7; in a 0
error: value is an integer while a list was expected, at (string):1:12

(the while evaluating ... is missing)

Nix-repl aborts on displaying the result of a __functor

See the trace below.

[maarten@maarten-laptop:~/nixpkgs]$ nix-repl 
Welcome to Nix version 1.11.2. Type :? for help.

nix-repl> builtins.tail (({ __functor = self: arg: [(self.x) arg]; x=1; }) "a")
[ "a" ]

nix-repl> builtins.head (({ __functor = self: arg: [(self.x) arg]; x=1; }) "a")
1

nix-repl> ({ __functor = self: arg: [(self.x) arg]; x=1; }) "a"
[ Aborted

segfault with http:// URLs on the nix path

How to reproduce:

$ nix-env -iA nixpkgs.nix-repl
replacing old ‘nix-repl-1.8-f924081’
installing ‘nix-repl-1.10-8a2f5f0’
$ NIX_PATH="nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-15.09.tar.gz" nix-repl
Segmentation fault

Unfree license blocks me from querying an attribute

Welcome to Nix version 1.11.6. Type :? for help.

nix-repl> :l <nixpkgs>
Added 6646 variables.

nix-repl> mendeley.name
error: Package ‘mendeley-1.16.3-stable_amd64’ in ‘/nix/store/lwmgp564z0bl06svlnw21gg3qy8kw3vb-nixos-16.09.1512.6b28bd0/nixos/pkgs/applications/office/mendeley/default.nix:62’ has an unfree license (‘unfree’), refusing to evaluate.
a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.nixpkgs/config.nix.

I feel that turning nixpkgs.config.allowUnfree to true just to see the name of the package is a bit much to ask. But of course, this might not be easy to fix...

I stumbled upon this issue while trying to use nix-repl to tweak my allowUnfreePredicate. Needless to say I did not get very far.

Multiline repl

The current REPL doesn't seem to support expressions over multiple lines. This would make it easier to test how Nix understands an expression that has newlines in between certain areas.

installing on nixos 14.12

Im getting the following error after following the install instructions.

~/c/nix-repl git:master ❯❯❯ nix-repl
nix-repl: src/libexpr/eval.cc:266: nix::EvalState::EvalState(const Strings&): Assertion `gcInitialised' failed.
[1] 23753 abort nix-repl

:l <nixos> doesn't load the same thing in 16.09 as it does in 16.03.

Something has changed which it appears from a conversation in #nixos would imply that we actually want to load <nixpkgs/nixos> instead in 16.09 to get the config set and related fields.

# nix-repl
Welcome to Nix version 1.11.4. Type :? for help.

nix-repl> :l <nixos>
Added 6637 variables.

nix-repl> :l <nixpkgs>
Added 6637 variables.

Feature request for a :c

Something that clears the screen.

Also I noticed that all the builtins are available as __getEnv instead of builtins.getEnv. Which one should I be using?

Fails to build against `nixUnstable`

Curious to the new floating-point support I found out that nix-repl fails to build against nixUnstable with NixOS/nixpkgs@7215118

$ nix-shell -p 'nix-repl.override{nix=nixUnstable;}'  -I nixpkgs=.
these derivations will be built:
  /nix/store/4qgb5zg3yrwa90i2fly58167bgs69qgj-nix-repl-1.12pre4911_b30d1e7-2016-02-28.drv
building path(s) ‘/nix/store/5cvngz9clyqb906pp96w4h7q2plpy7ds-nix-repl-1.12pre4911_b30d1e7-2016-02-28’
unpacking sources
unpacking source archive /nix/store/q8h2ng6wzgxsqrsczyam6szms15icg8k-nix-repl-a1ea85e92b067a0a42354a28355c633eac7be65c-src
source root is nix-repl-a1ea85e92b067a0a42354a28355c633eac7be65c-src
patching sources
configuring
no configure script, doing nothing
installing
nix-repl.cc: In constructor 'NixRepl::NixRepl(const Strings&)':
nix-repl.cc:78:44: error: no matching function for call to 'nix::EvalState::EvalState(const Strings&)'
     , staticEnv(false, &state.staticBaseEnv)
                                            ^
In file included from nix-repl.cc:10:0:
/nix/store/nx8gzz0aqk755ixmijzw8q1i0aql6qfm-nix-1.12pre4911_b30d1e7-dev/include/nix/eval.hh:103:5: note: candidate: nix::EvalState::EvalState(const Strings&, nix::ref<nix::Store>)
     EvalState(const Strings & _searchPath, ref<Store> store);
     ^
/nix/store/nx8gzz0aqk755ixmijzw8q1i0aql6qfm-nix-1.12pre4911_b30d1e7-dev/include/nix/eval.hh:103:5: note:   candidate expects 2 arguments, 1 provided
/nix/store/nx8gzz0aqk755ixmijzw8q1i0aql6qfm-nix-1.12pre4911_b30d1e7-dev/include/nix/eval.hh:63:7: note: candidate: nix::EvalState::EvalState(const nix::EvalState&)
 class EvalState
       ^
/nix/store/nx8gzz0aqk755ixmijzw8q1i0aql6qfm-nix-1.12pre4911_b30d1e7-dev/include/nix/eval.hh:63:7: note:   no known conversion for argument 1 from 'const Strings {aka const std::__cxx11::list<std::__cxx11::basic_string<char> >}' to 'const nix::EvalState&'
nix-repl.cc: In member function 'bool NixRepl::processLine(std::__cxx11::string)':
nix-repl.cc:337:31: error: 'store' was not declared in this scope
         if (drvPath == "" || !store->isValidPath(drvPath))
                               ^
nix-repl.cc: In lambda function:
nix-repl.cc:648:9: error: 'store' was not declared in this scope
         store = openStore();
         ^
builder for ‘/nix/store/4qgb5zg3yrwa90i2fly58167bgs69qgj-nix-repl-1.12pre4911_b30d1e7-2016-02-28.drv’ failed with exit code 1
error: build of ‘/nix/store/4qgb5zg3yrwa90i2fly58167bgs69qgj-nix-repl-1.12pre4911_b30d1e7-2016-02-28.drv’ failed
/run/current-system/sw/bin/nix-shell: failed to build all dependencies

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.