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

idrisPackages.optparse: init at 2016-06-18 [wip] #19018

Closed
wants to merge 3 commits into from
Closed

idrisPackages.optparse: init at 2016-06-18 [wip] #19018

wants to merge 3 commits into from

Conversation

langston-barrett
Copy link
Contributor

Motivation for this change

This isn't working quite yet, I was hoping to get some help from @shlevy. This package requires idrisPackages.wl-pprint, but I don't know how to add it to the build. Do I need to use with-packages.nix? If so, would you mind posting some example code?

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@shlevy shlevy self-assigned this Sep 27, 2016
@shlevy
Copy link
Member

shlevy commented Sep 27, 2016

Taking a look, thanks!

@shlevy
Copy link
Member

shlevy commented Sep 27, 2016

OK so I can test this myself in a few hours, but you should just be able to add wl-pprint to the function arguments and add it to the buildInputs list.

@langston-barrett
Copy link
Contributor Author

@shlevy Looks like it, thanks! Now I'm just running into #19014

@langston-barrett langston-barrett changed the title idrisPackages.optparse: init at 2016-06-18 [help needed] idrisPackages.optparse: init at 2016-06-18 Sep 27, 2016
@langston-barrett
Copy link
Contributor Author

Weird that the Travis build is passing. Can anyone build this locally?

@shlevy
Copy link
Member

shlevy commented Sep 27, 2016

Travis just checks general nixpkgs evaluation, not the actual package build.

@langston-barrett langston-barrett changed the title idrisPackages.optparse: init at 2016-06-18 idrisPackages.optparse: init at 2016-06-18 [wip] Sep 28, 2016
@langston-barrett
Copy link
Contributor Author

This package also requires lens, which also doesn't compile with new versions of Idris. Nor does it have a README (idris-hackers/idris-lens#4), nor does it have a license (idris-hackers/idris-lens#5). I'm going to try to fix up that project with a few PRs, but it might take a minute. I'll update here when done.

@langston-barrett
Copy link
Contributor Author

After some more digging and more PRs, I've got it narrowed down to (hopefully) the last issue: HuwCampbell/idris-lens#7. I'll have to update that lens package again, but won't take long. Nothing like a chain of broken dependencies 😈

@langston-barrett
Copy link
Contributor Author

Okay, my PR was accepted so I've rebased and squashed!

Now I'm getting a new error that I don't understand (I've included Bifunctors in the build inputs, after all).

these derivations will be built:
  /nix/store/7pk6h9n46sg9zscm0c2d515klrs7cyck-optparse-2016-06-18.drv
building path(s) ‘/nix/store/0ky18pmsw504rap2zfypxydi5hv6ckl8-optparse-2016-06-18’
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/prelude' -> '/nix/store/wj89pdqx99xl5fpy9y48m88ir5qhjlcr-prelude/lib/idris-0.12.3/prelude'
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/base' -> '/nix/store/8dalawpd8brv47pap8pjcizlccmfzv1b-base/lib/idris-0.12.3/base'
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/effects' -> '/nix/store/gy70g6rfyskvp1d2nahy7qcscjldpzh8-effects/lib/idris-0.12.3/effects'
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/lens' -> '/nix/store/y6pnqk2dqdpa7zkddxsfi9smrsm3gqsd-lens-2016-10-05/lib/idris-0.12.3/lens'
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/bifunctors' -> '/nix/store/bq0rxsq81clrz81v3ycgzx15vxrhj0s7-bifunctors-2016-08-10/lib/idris-0.12.3/bifunctors'
'/tmp/nix-build-optparse-2016-06-18.drv-0/idris-libs/wlpprint' -> '/nix/store/0dcwg3dm911zmncd86mxj0ksqbn3pch0-wl-pprint-2016-09-28/lib/idris-0.12.3/wlpprint'
unpacking sources
unpacking source archive /nix/store/v1s6sy191sz2kwrc4bl05hf2f09zwywf-optparse-idris-ad0490ff0fa0e623d03cde1f49a4adffc6f9362f-src
source root is optparse-idris-ad0490ff0fa0e623d03cde1f49a4adffc6f9362f-src
patching sources
configuring
building
Type checking ./Options/Applicative/Maybe.idr
Can't find import Data/Bifunctor
builder for ‘/nix/store/7pk6h9n46sg9zscm0c2d515klrs7cyck-optparse-2016-06-18.drv’ failed with exit code 1
error: build of ‘/nix/store/7pk6h9n46sg9zscm0c2d515klrs7cyck-optparse-2016-06-18.drv’ failed

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

Strange, this seems to be happening for any library that doesn't ship with idris itself. idris --libdir is showing the right directory though... I wonder if library lookup has changed some other way

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

Ah! Happens for idris-packaged libs too, unless you happen to request a library in the top-level namespace. strace output showing the issue (for :load Data.So):

5098  stat("/nix/store/w5k4wr6lznjy37n6qmimcw994ip5y8ml-idris-0.12.3/lib/idris-0.12.3/base/Data.ibc", 0x2046528b0) = -1 ENOENT (No such file or directory)
5098  stat("/nix/store/w5k4wr6lznjy37n6qmimcw994ip5y8ml-idris-0.12.3/lib/idris-0.12.3/base/Data.ibc", 0x204652b40) = -1 ENOENT (No such file or directory)
5098  stat("/nix/store/w5k4wr6lznjy37n6qmimcw994ip5y8ml-idris-0.12.3/lib/idris-0.12.3/base/Data.So.idr", 0x204652de0) = -1 ENOENT (No such file or directory)
5098  stat("/nix/store/w5k4wr6lznjy37n6qmimcw994ip5y8ml-idris-0.12.3/lib/idris-0.12.3/base/Data.So.lidr", 0x20142e090) = -1 ENOENT (No such file or directory)

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

It should be looking for/eventually finding base/Data/So.ibc

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

And indeed, :load Data/So worked.

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

Oops, my mistake, I wanted :module not :load. Back to the drawing board...

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

Ah, optparse.ipkg just has opts = "-p lens -p wlpprint" instead of listing dependencies, bifunctors is a transitive dep via lens. I'm not sure if listing dependencies would work either, you may need to manually specify bifunctors even though it's transitive.

@langston-barrett
Copy link
Contributor Author

@shlevy Wow, thank you so much for all your investigation!

@langston-barrett
Copy link
Contributor Author

@shlevy What do you mean "instead of listing dependencies"? Could it be fixed by a PR?

@langston-barrett
Copy link
Contributor Author

Ugh, after changing the buildPhase to

  buildPhase = ''
    ${idris}/bin/idris --build *.ipkg -p bifunctors
  '';

I get

Not all command line options can be used to override package options.

The only changeable options are:
    --log <lvl>, --total, --warnpartial, --warnreach
    --ibcsubdir <path>, -i --idrispath <path>
    --logging-categories <cats>

The options need removing are:
     Pkg "bifunctors" 

@shlevy
Copy link
Member

shlevy commented Oct 6, 2016

@siddhanathan The ipkg format has a field for dependencies listed declaratively, rather than specifying the idris command line flag: http://docs.idris-lang.org/en/latest/reference/packages.html

pkgs = (',' )+, a comma separated list of package names that the Idris package requires.

@ocharles
Copy link
Contributor

@siddhanathan I'm unclear what the status of this pull request is. Did you finally get everything building, or is there still more work to be done?

@langston-barrett
Copy link
Contributor Author

langston-barrett commented Sep 25, 2017

@ocharles No, I've not got this working. It probably could be done now that the ipkg is fixed upstream, but I'm not using Idris these days.

@shlevy
Copy link
Member

shlevy commented Jan 21, 2018

@siddharthist Feel free to reopen if you come back to this.

@shlevy shlevy closed this Jan 21, 2018
@shlevy shlevy removed their assignment Jan 21, 2018
@shmish111
Copy link
Contributor

I have created HuwCampbell/optparse-idris#7 which when merged will mean this can be re-opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants