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
Agda fails to compile files without --local-interfaces in nixos #4613
Comments
Example setup to reproduce:
|
For me I can reproduce just by:
|
This is very strange. (Note that there is another, unrelated, issue with nix that should get fixed in |
I think there probably is a .agda-lib file in my nix store but It was my understanding that it shouldn't matter because as it's in a different directory to my temp directory? |
With the (new) project-based interface stashes, we do not dump the .agdai files Here the presence of an I think this demonstrates we do need to ship an |
Ah I forgot about the primitives, that makes perfect sense |
So we could patch this quickly by distributing our own |
That might be the best solution |
If you do so, you need to make sure that the So you could:
and hopefully that should do it? 🤞 |
Should the .agda-lib file just go in the same folder as the builtins? |
I would put a file
|
Wait, surely not? I thought everything directly in |
Ah, this only started when we started trying to write tests, this is why it took so long to notice |
|
Aah, are |
no they are files, A derivation can be a single file |
Oh okay, I suppose this should be a won't-fix from the Agda side, then. |
I think our fix should be to add an |
As a side note, Agda also seems to recognise directories as agda-lib files for the purposes of determining what a library is |
And also ensure we only rely on *files* named .agda-lib and ignore directories. NB: this does not implement the more efficient directory exploration strategy discussed in #4526
In my machine, it compiles, but it takes a very long time. |
What system do you have? |
Nixos too. |
The problem only occurs if you end up with an .agda-lib file in your nix store. This only happened to us when we tried to make some nixos tests |
@guilhermehas is probably suffering from #4526 |
By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
* Ignore directories with an .agda-lib suffix Co-authored-by: ibbem <ibbem@ibbem.net> * Fix #4526, #4613: Add .agda-lib for builtins By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org> * Decide between interface files based on their existence --------- Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
@gallais : Is this fixed by this PR? |
* Ignore directories with an .agda-lib suffix Co-authored-by: ibbem <ibbem@ibbem.net> * Fix #4526, #4613: Add .agda-lib for builtins By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org> * Decide between interface files based on their existence --------- Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
I don't know, I'm not a nix user. :D |
Ok, I'll remove it from the milestone again. I also removed your assignment. |
I'll check this now, though need to built the release candidate |
As far as I can tell, everything is working with release candidate 2, with or without the |
* Ignore directories with an .agda-lib suffix Co-authored-by: ibbem <ibbem@ibbem.net> * Fix agda#4526, agda#4613: Add .agda-lib for builtins By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org> * Decide between interface files based on their existence --------- Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
* Ignore directories with an .agda-lib suffix Co-authored-by: ibbem <ibbem@ibbem.net> * Fix agda#4526, agda#4613: Add .agda-lib for builtins By default Agda tries to traverse the filesystem upwards until it hits the filesystem root or it finds a .agda-lib file. This traversal can be very slow if the Agda builtin sources are contained in a big directory (e.g. on NixOS where /nix/store, inside which Agda is stored, often contains ten to hundred thousand files). Hence we introduce the .agda-lib file to prevent this traversal for the Agda builtins. Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org> * Decide between interface files based on their existence --------- Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
I'm not sure if this is a nixos problem or an agda problem but currently if you try to compile an empty file with agda 2.6.1 which is not in a library, agda tries to build the interface file in
/nix/store/_build
which is read only. The problem seems to go away with--local-interfaces
Would be good if anyone has any ideas as to what is causing this.
The text was updated successfully, but these errors were encountered: