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

Cannot use nix-shell as shebang interpreter #1227

Closed
ttuegel opened this issue Feb 9, 2017 · 5 comments
Closed

Cannot use nix-shell as shebang interpreter #1227

ttuegel opened this issue Feb 9, 2017 · 5 comments
Assignees

Comments

@ttuegel
Copy link
Member

ttuegel commented Feb 9, 2017

I cannot use nix-shell as an interpreter. For instance, this example from the manual:

#! /usr/bin/env nix-shell
#! nix-shell -i python -p python pythonPackages.prettytable

import prettytable

# Print a simple table.
t = prettytable.PrettyTable(["N", "N^2"])
for n in range(1, 10): t.add_row([n, n * n])
print t

produces this output:

$ ./example.py
error: not an absolute path: ‘././example.py’

Any other example produces the same output.

I am using this version

$ nix-shell --version
nix-shell (Nix) 1.12pre4911_b30d1e7
@dtzWill
Copy link
Member

dtzWill commented Apr 11, 2017

This is a big deal! Is there plans for addressing this or creating a special tool for shebangs? They're awfully useful :3.

@phunehehe
Copy link
Contributor

This appears to work fine for me.

@therealpxc
Copy link

therealpxc commented Apr 11, 2018

I think I remember being affected by this once on Nix 1.12, but when I tested just now, it was fine.

@dtzWill @ttuegel can you confirm that you still have this issue?

Edited to add the output of nix-info:

  • system: "x86_64-darwin"
  • host os: Darwin 17.5.0, macOS 10.13.4
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.0
  • channels(root): "nixpkgs-18.03pre115958.bed076cdfb"
  • nixpkgs: /etc/nix-darwin/pkgsets/nixpkgs/darwin

@dtzWill
Copy link
Member

dtzWill commented Apr 11, 2018

Indeed, it seems to work for me now as well!

@domenkozar
Copy link
Member

Closing as it works now.

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

No branches or pull requests

7 participants