Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Certain file names result in a crash #14

Closed
mightybyte opened this issue Dec 20, 2018 · 4 comments
Closed

Certain file names result in a crash #14

mightybyte opened this issue Dec 20, 2018 · 4 comments

Comments

@mightybyte
Copy link
Contributor

I'm getting the following error:

error (ignored): writing to file: Bad file descriptor
error: invalid regular expression ‘^\.stack-work/downloaded/zrAzVbT4hDDB/buildUtils/(.*/|)[^/]*\.hi’, at /nix/store/ssdx84fbg92ql3mifvwk2j6fzrnp7irg-source/default.nix:24:26

I discovered that if I delete the .stack-work directory from the project root, this error goes away. This is a blocker for me using this package because some people on my team use stack and I can't have that breaking my build. If it was something about how I write my .gitignore files, I might be able to work around it. But it's not about that because deleting .stack-work fixed the problem with no change to the .gitignore file.

@siers
Copy link
Owner

siers commented Dec 22, 2018

Hi,

This regex doesn't seem to be invalid on its own. Are you using Linux or OS X? Could you maybe make a self-contained bug reproduction code / archive?

@mightybyte
Copy link
Contributor Author

I'm on OS X. I'll try to put together a minimal test case to reproduce.

@mightybyte
Copy link
Contributor Author

It looks like this has something to do with the behavior when there are nested .gitignore files. I can reproduce by cloning the following repo:

https://github.com/mightybyte/readable/tree/nix-gitignore-test

Change to the nix-gitignore-test branch and then do nix-build. It should work fine. Now create a directory called foo and then create foo/.gitignore with the following contents:

foo
.stack-work/

Now do nix-build and you should see the failure.

@siers
Copy link
Owner

siers commented Dec 27, 2018

Hi Doug,

builtins.match "(.*/|)" "" doesn't work because of NixOS/nix#1537. (.*/|) and can be replaced with (.*/)?, which seems to be working judging by ./test.sh.

I'll commit it soon enough.

@siers siers closed this as completed in 4f2d85f Jan 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants