-
Notifications
You must be signed in to change notification settings - Fork 41
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
Installation with nix #381
Comments
I'm not a nix user myself but I know @liesnikov uses Agda2Hs with Nix so perhaps they can help. |
I'm assuming you cloned the repo locally and ran user@pc:~$ nix shell github:agda/agda2hs
[...download and compilation output...]
user@pc:~$ which agda2hs # it's available now
/nix/store/gbn5d084k4qk3hl9gb0k4z30d0ffsyxc-agda2hsWithPackages-1.3/bin/agda2hs This just pulls the latest commit from github, so you don't have to clone the repo. You do have to enable flakes for this though. |
I'm assuming you cloned the repo locally and ran nix shell in the directory?
Yeah. But with `nix-shell`. Is it possible to use it without enabling nix
experimental features?
(I am not a nix expert and use it primarily for the ease of installing
packages.)
…On Wed, Dec 18, 2024 at 3:15 PM liesnikov ***@***.***> wrote:
I'm assuming you cloned the repo locally and ran nix shell in the
directory? If so, this drops you in a shell to develop agda2hs, not to use
it.
You can instantiate a shell with agda2hs available like this:
***@***.***:~$ nix shell github:agda/agda2hs
[...download and compilation output...]
***@***.***:~$ which agda2hs # it's available now
/nix/store/gbn5d084k4qk3hl9gb0k4z30d0ffsyxc-agda2hsWithPackages-1.3/bin/agda2hs
—
Reply to this email directly, view it on GitHub
<#381 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALUHTIDYSDROA5VENNMHIZL2GE73ZAVCNFSM6AAAAABTZ5TXU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJQHA2TKMJRGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Using it with flakes seems to go through though.
```
nix --experimental-features 'nix-command flakes' shell github:agda/agda2hs
```
I was reluctant to use flakes because of its increased use of storage
space.
Ran out of space while running the above command.
```
$ nix --experimental-features 'nix-command flakes' shell github:agda/agda2hs
[0/13 built, 3/3/168 copied (27.2/4851.3 MiB), 5.5/386.3 MiB DL] fetching
gcc-13.3.0 from https://cache.nixos.org
error: writing to file: No space left on device
```
…On Wed, Dec 18, 2024 at 4:52 PM Julin S ***@***.***> wrote:
> I'm assuming you cloned the repo locally and ran nix shell in the
directory?
Yeah. But with `nix-shell`. Is it possible to use it without enabling nix
experimental features?
(I am not a nix expert and use it primarily for the ease of installing
packages.)
On Wed, Dec 18, 2024 at 3:15 PM liesnikov ***@***.***>
wrote:
> I'm assuming you cloned the repo locally and ran nix shell in the
> directory? If so, this drops you in a shell to develop agda2hs, not to use
> it.
> You can instantiate a shell with agda2hs available like this:
>
> ***@***.***:~$ nix shell github:agda/agda2hs
> [...download and compilation output...]
> ***@***.***:~$ which agda2hs # it's available now
> /nix/store/gbn5d084k4qk3hl9gb0k4z30d0ffsyxc-agda2hsWithPackages-1.3/bin/agda2hs
>
> —
> Reply to this email directly, view it on GitHub
> <#381 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALUHTIDYSDROA5VENNMHIZL2GE73ZAVCNFSM6AAAAABTZ5TXU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJQHA2TKMJRGE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Had also tried to install with cabal. But couldn't figure out which
zlib package it was missing.
```
$ nix-shell -p ghc cabal-install haskellPackages.zlib_0_7_1_0
$ cabal install agda2hs
Resolving dependencies...
Build profile: -w ghc-9.6.5 -O1
In order, the following will be built (use -v for more details):
- zlib-0.7.1.0 (lib) (requires build)
- Agda-2.7.0.1 (lib:Agda) (requires build)
- agda2hs-1.3 (exe:agda2hs) (requires build)
Starting zlib-0.7.1.0 (lib)
Failed to build zlib-0.7.1.0. The failure occurred during the configure
step.
Build log (
/home/user/.cabal/logs/ghc-9.6.5/zlib-0.7.1.0-8685beb15be7a8445fe5b4c02f02a2b71de973b7f08a6c17e4864b561738cf1e.log
):
Configuring library for zlib-0.7.1.0..
Error: .cabal-wrapped: Missing dependency on a foreign library:
* Missing (or bad) C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Error: cabal: Failed to build zlib-0.7.1.0 (which is required by exe:agda2hs
from agda2hs-1.3). See the build log above for details.
```
Any idea which path I can give for `--extra-include-dirs` and
`--extra-lib-dirs`
I am on debian with nixpkg.
Also tried install debian's `libghc-zlib-dev` package.
…On Wed, Dec 18, 2024 at 5:02 PM Julin S ***@***.***> wrote:
Using it with flakes seems to go through though.
```
nix --experimental-features 'nix-command flakes' shell github:agda/agda2hs
```
I was reluctant to use flakes because of its increased use of storage
space.
Ran out of space while running the above command.
```
$ nix --experimental-features 'nix-command flakes' shell
github:agda/agda2hs
[0/13 built, 3/3/168 copied (27.2/4851.3 MiB), 5.5/386.3 MiB DL] fetching
gcc-13.3.0 from https://cache.nixos.org
error: writing to file: No space left on device
```
On Wed, Dec 18, 2024 at 4:52 PM Julin S ***@***.***> wrote:
> > I'm assuming you cloned the repo locally and ran nix shell in the
> directory?
>
> Yeah. But with `nix-shell`. Is it possible to use it without enabling nix
> experimental features?
>
> (I am not a nix expert and use it primarily for the ease of installing
> packages.)
>
> On Wed, Dec 18, 2024 at 3:15 PM liesnikov ***@***.***>
> wrote:
>
>> I'm assuming you cloned the repo locally and ran nix shell in the
>> directory? If so, this drops you in a shell to develop agda2hs, not to use
>> it.
>> You can instantiate a shell with agda2hs available like this:
>>
>> ***@***.***:~$ nix shell github:agda/agda2hs
>> [...download and compilation output...]
>> ***@***.***:~$ which agda2hs # it's available now
>> /nix/store/gbn5d084k4qk3hl9gb0k4z30d0ffsyxc-agda2hsWithPackages-1.3/bin/agda2hs
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#381 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ALUHTIDYSDROA5VENNMHIZL2GE73ZAVCNFSM6AAAAABTZ5TXU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJQHA2TKMJRGE>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
>
|
I tried to whip something up quickly to use without flakes, could you try using this package? https://github.com/liesnikov/agda2hs/blob/master/nix/default.nix |
I cloned that repo and tried it like:
But I don't know what that error means, really.. |
I am on 24.05 channel now, I think I need 24.11 for agda 2.7 |
No same error with 24.11 channel too. But I kind of randomly tried: |
I meant trying something like |
Oh.. 😅
Thanks! It worked.
But
Is it that the part for that needs to be added onto one of the nix files? |
After a discussion with @flupe it seems that the |
But using the path directly works:
|
So at the moment |
I was trying the Got this error:
Could this error be circumvented? I put this is
Could it be because of the direct path to nix store? |
When using nix builds, agda2hs doesn't come with the prelude linked. I see four ways to circumvent this:
The problems you are experiencing are not really specific to agda2hs, but to nix and path management. |
I tried the first option. But had errors. |
Hi.
Is agda2hs usable via nix out of the box?
I tried using the shell.nix with
nix-shell
.Got these warnings but spotted no errors:
But it didn't seem to work:
Any idea how this can be fixed?
Thanks.
The text was updated successfully, but these errors were encountered: