haskell / haskell/cabal

Error in v1 Nix support: --add-root flag not supported by nix-shell

Open
#9,146 3 comments 0 reactions 0 assignees View on GitHub
cabal-install: nix integration cabal-install: v1-
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

nix-shell must have removed the `--add-root` flag at some point. Cabal v1 would have to be updated accordingly or nix integration turned off.

The error from Nix is:

> error: unrecognised flag '--add-root'
> Try '/run/current-system/sw/bin/nix-shell --help' for more information.

**To Reproduce**
Steps to reproduce the behavior:

```
$ cabal --enable-nix v1-build ...
```

Or even without `--enable-nix` if `nix: True` is in `~/.cabal/config`

**Expected behavior**

Cabal v1 + Nix intergation continues to work (any Cabal command: build, etc.).

**System information**
- NixOS 23.05
- cabal 3.10
- nix 2.13.3

**Additional context**

I've tried to find out when --add-root was removed but nothing that specific turns up in a web or documentation search.

I don't see `add-root` in the man page from `nix-shell --help` for example, despite the suggestion from the error message.

(Also, I do know v2 is preferred. I'm using v1 with Nix as a workaround for an issue with v2 finding binaries like BNFC, may also affect Alex & Happy. There are already tickets/issues open for that one; if it would help, I can link them here when I track them down.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.