2011-12-26

<thelema> hcarty: err, I can change the internal name in batteries. Batteries.ml exports only Ulib.Text as Text (replacing Rope)
<hcarty> I want to put a Ulib-the-stdlib-extension-from-OCaml-CVS on oasis-db, but I don't want it to conflict with Batteries.
<hcarty> thelema: Does Batteries expose Ulib?
<thelema> hcarty: Invalid_arg
<hcarty> thelema: What is the final decision on the exception raised by Option.get?
<hcarty> thelema: Fantastic! I'll hopefully have a chance to try it out soon.
<thelema> hcarty: now tested. It needed a small fix, but I'm now compiling batteries from my source tree via odb
<thelema> hcarty: meaning that it's not necessary to upload to oasis-db to test with odb
<hcarty> The '&& :' hack was definitely nice as a test
<hcarty> But I wanted to avoid that in the case of ocamlnet because several options are turned off by default. Some folks may want to enable them.
<hcarty> Yes
<hcarty> thelema: Or whatever the custom configure command is
<hcarty> thelema: Yes. 'ocaml setup.ml -configure --prefix foo' could end up as 'touch setup.data && ./configure --prefix foo'
<thelema> hcarty: so the arguments of setup.ml get passed on to the given command?
<hcarty> thelema: XCustomConfigure doesn't seem to do anything other than provide a pass-through to the given command
<hcarty> ocamlnet is the only package I have worked on that had trouble with --prefix so far
<hcarty> I think that is a reasonable requirement for now
<hcarty> thelema: It may be necessary for packages like camomile which install extra data
<thelema> hcarty: back. hmm.
<hcarty> thelema: I modified ocamlnet's configure script to ignore --prefix. It's a bit of a hack, but hopefully OCAMLFIND_DESTDIR will be enough to do the right thing. It looks like it is, as I can install ocamlnet through odb now.
<hcarty> thelema: I'm still uncertain if I want odb from ocamlbrew to install to odb/ or site-lib/
<hcarty> thelema: --have-perms may be a nice thing to be able to set with an environment variable. That would make it easy to have ocamlbrew'd OCaml + odb.ml + installing to site-lib play nicely together.
<hcarty> thelema: " && :" can be added to the end of the custom configuration line to ignore --prefix, but that prevents other flags from being passed in
<hcarty> thelema: Or... not destdir, --prefix
<hcarty> thelema: That's not a valid argument for ocamlnet's configure script so it barfs and quits.
<hcarty> thelema: Any thoughts on how to get an _oasis file working with ocamlnet? There is a problem in its current state when odb passes 'destdir'
<hcarty> thelema: odb via ocamlbrew finds dependencies properly on my system, although this is testing without a ~/.odb directory

2011-12-25

<hcarty> thelema: Thank you again for testing!
<hcarty> thelema: I'm off for a bit, possibly the night. Please leave any further comments/notes you have and I'll go through the logs when I'm back on.
<hcarty> And yes - OCaml has a long compilation log :-)
<hcarty> thelema: That's another shortcoming of ocamlbrew in its current state - if something breaks, you have to check the log to know, or know ahead of time that it prints "Done." when everything completes successfully.
<hcarty> thelema: At that point, perhaps we can discuss (possibly with gildor as well) how to keep both odb and ocamlbrew running smoothly together.
<hcarty> thelema: No worries re: odb breakage - both projects are fairly young. I'm not too concerned about ocamlbrew breaking until it has some sort of formal announcement.
<thelema> hcarty: sorry for breaking things in master, with you depending on it.
<hcarty> thelema: Thank you for getting those dependency fixes out so quickly
<hcarty> And the odb fixes worked on my test ocamlbrew run
<hcarty> thelema: Thanks - a few README tweaks pushed
<hcarty> Drat - you're right
<thelema> hcarty: I still think your "run by hand" text is wrong.
<hcarty> thelema: Ripped directly from perlbrew :-)
<thelema> hcarty: I like the | bash line
<thelema> hcarty: I'm trying ocamlbrew right now.
<thelema> hcarty: that's a very reasonable position, and one I didn't consider.
<hcarty> thelema: If that's not the case then it's a logical error in the code - if None is a possibility then it should be checked for through pattern matching
<hcarty> thelema: Yes - I think it's somewhat reasonable to expect that Option.get is being used in an area where, logically, None should never be possible
<hcarty> thelema: If odb is able to install oasis again, then ocamlbrew should be ready for the case you suggested (./ocamlbrew --all, which is what the curl ... | bash command effectively does)
<thelema> hcarty: you think Option.get should raise Invalid_argument?
<hcarty> )
<hcarty> thelema: Raising exceptions other than Invalid_argument from the Option module seems somewhat counter-intuitive (re: Batteries bug #198
<thelema> hcarty: odb bug should be fixed.
<hcarty> thelema: Yes, I'm pretty sure that's what I hit.
<hcarty> If I swap the first and second then the installation completes
<hcarty> The first is being hit - odb exits
<thelema> hcarty: how's that? the first match case isn't being hit, as it's not exiting
<hcarty> thelema: ~L360
<hcarty> thelema: I think the odb error I ran into is due to match case ordering
<hcarty> flux: It's cool, which has its merits :-)
<hcarty> It works in utop as well, apprently without causing too much damage to the custom interface
<hcarty> That post was the first I had heard of it too. Quite a nifty trick.
<hcarty> Drakken: You're welcome - have fun
<Drakken> hcarty thanks, that's what I wanted to know :)
<hcarty> Drakken: Also, you can use odb with GODI
<hcarty> Drakken: In that case there is no need to keep your non-GODI installation around.
<Drakken> hcarty I hope I don't need more than one installation. I just want one system that has all the libraries I need, including Ocamlnet and yojson, which are available thru godi but apparently not thru odb.
<hcarty> Drakken: Probably, unless you have another use for it, such as a separate OCaml installation you need to keep around and use.
<Drakken> hcarty so can/should I uninstall the original findlib?
<Drakken> hcarty that makes a lot more sense.
<hcarty> Drakken: You need to use GODI's findlib with GODI's OCaml
<hcarty> Drakken: See ocamlbrew's installation steps for one possible way to do this : https://github.com/hcarty/ocamlbrew/blob/master/ocamlbrew
<Drakken> hcarty I installed findlib before I installed godi.
<hcarty> Drakken: GODI may do some extra configuration after that
<hcarty> Drakken: findlib automatically sets itself up to install alongside whatever OCaml installation is used to compile it
<Drakken> hcarty do you know how it does that?
<hcarty> Drakken: GODI configures findlib to look in the appropriate directories
<Drakken> hcarty but how does findlib know where I installed godi?
<hcarty> META files, proper install paths, etc.
<hcarty> Drakken: All GODI packages are setup to use findlib
<hcarty> thelema: Using the latest odb and a fresh ocamlbrew installation, oasis fails to install due to what appears to be an incorrect PCRE version check
<hcarty> thelema: --all and --help added; README instructions fixed; New, even simpler method of doing "ocamlbrew --all" pinched from perlbrew

2011-12-24

<Qrntzz> bobzhang: as hcarty said, creating a project page would probably be the best turn to gather people interested in it
<hcarty> bobzhang: My guess is that you will get a lot of interest. I won't be able to take a look for a few days, but creating a project on the forge (forge.ocamlcore.org) or github is probably a good place to start.
<thelema> hcarty: great
<hcarty> *list of features to add
<hcarty> thelema: Command line arguments (and possibly environment variables) are on the list to add
<hcarty> thelema: It will be a few hours before I can make and push the fixes, but I will definitely make them.
<hcarty> thelema: Thanks, I'll get those fixed
<hcarty> That's what I get for doing all my testing from the source tree
<hcarty> thelema: Ha! All good points...
<hcarty> ocamlbrew now has a simple README if anyone is able to give it a quick read and comment: https://github.com/hcarty/ocamlbrew/blob/master/README.md
<hcarty> thelema: That's cool. Something to allow for (perhaps manually managed) local packages?
<hcarty> Thank you
<hcarty> thelema: Do you mind if I steal some of the tone/wording from odb's README for ocamlbrew?

2011-12-23

<hcarty> thelema: A bit more customization now. Each component is optional through a run-time prompt, except odb which automatically comes along if findlib is being installed.
<thelema> hcarty: thanks for your work.
<hcarty> thelema: Thank you for your help and comments!
<hcarty> And with that I'm off for a while.
<hcarty> ocamlbrew is updated now to put all odb-related material under the same tree as OCaml itself. ~/.odb/ is left open for other use, making it easier to have multiple OCaml installations.
<hcarty> thelema: Ah, ok
<hcarty> thelema: odn works fine here as long as I 'odb.ml oUnit fileutils' first
<hcarty> Or a change in how odn's _oasis is written
<hcarty> oasis seems to check for test dependencies as well, at least in the case of odn
<hcarty> oasis-db only lists the build dependencies
<hcarty> thelema: Not oasis-db, oasis itself. Or, rather, the build system generated by oasis.
<hcarty> That part is arguably either a bug in oasis (checking for too many dependencies) or a bug in oasis-db (not listing enough dependencies
<hcarty> It looks like oasis is checking for the availability of oUnit and fileutils for odn, even though they are only required for the tests
<hcarty> odb.ml has odb_lib as $ODB_INSTALL_DIR/lib
<hcarty> thelema: Yes, that was the reasoning
<hcarty> thelema: Wait
<hcarty> thelema: Oversight on my part
<thelema> hcarty: because of ~/.odb/bin?
<thelema> hcarty: any reason why $ODB_INSTALL_DIR is ~/.odb instead of ~/.odb/lib?
<hcarty> Unless the info cache separates the local files out that way, in which case it's less important
<hcarty> thelema: That would depend on the mirror/server/package source used
<thelema> hcarty: well, the info cache probably doesn't need the same relocation treatment
<hcarty> s/new locations/other directories/
<hcarty> It's also nice to be able to relocate ~/.odb to new locations so that there is one instance (or more) per OCaml installation
<hcarty> tomprince, thelema: During development it's nice to have the directories all in one spot
<hcarty> But going from no OCaml, odb, etc. to OCaml + odb trying to install oasis (or just odn) now fails
<hcarty> I thought we had too. I'm not sure what has changed.
<hcarty> odn's configuration step fails
<hcarty> Nope, sorry - I forgot that it fails on odn
<thelema> hcarty: try running with --debug
<hcarty> thelema: http://oasis.ocamlcore.org/dev/odb/stable/pkg/info/oasis -- this includes oUnit and fileutils, but they seem to be missed by odb.ml
<hcarty> Or without the cache prefix - but if this eventually includes other files it my be handy to have the directory there
<hcarty> Something along the lines of ~/.odb/cache/info/
<hcarty> thelema: If local caching is done, I think it would be best under ~/.odb/
<thelema> hcarty: what do you think?
<hcarty> All the more reason to create a (dumb) package mirror or few
<hcarty> thelema: That makes sense too
<thelema> hcarty: I have intermittent problems with odb - I believe it's oasis-db, although I have little proof other than it working seconds later with no changes
<hcarty> Something strange is going on with github, odb.ml, or ocamlbrew. Every few clean runs, odb will fail to install oasis due to missing fileutils and oUnit
<hcarty> They all seem to make sense to some extent
<hcarty> Wow, that's quite a list
<hcarty> What does BatIO depend on?
<hcarty> Having all of Batteries would be nice, but not absolutely required
<hcarty> Likely so.
<thelema> hcarty: I imagine that pushing batteries through javascript would... increase the startup costs
<hcarty> thelema: I'm not sure what the effort required is, but it would be very cool to have a Batteries'd version of the Try OCaml site available once Batteries 2.0 is out.
<hcarty> Yes, thank you for the suggestion and link
<hcarty> I'm happy either way
<hcarty> thelema: Tested and pushed
<hcarty> beat me to it :-)
<hcarty> If not, I suppose I can split up the script into multiple {} groupings
<hcarty> I wonder if tee will continue to act as it currently does when inside the { }
<hcarty> Cool. I'll add a prompt at L40, wrap everything in { } for output redirection, and test without the extra package installation
<hcarty> Sorry, forgot to mention that earlier - that caused the process to fail when I ran this earlier
<hcarty> They are required for testing
<hcarty> I'm at approximately the level of "knowing enough to do real damage" with bash
<hcarty> And I'll look into the redirect - that would be handy and make everything more readable
<hcarty> thelema: Agreed re: a pause/prompt
<hcarty> Anarchos: A very simple attempt at making something along the lines of perlbrew (build various Perl versions from source; allows you to switch between them)
<hcarty> thelema: If an OCaml environment + environment variables exist... I have no idea what will happen :-)
<Anarchos> hcarty what is ocamlbrew ?
<hcarty> thelema: If you run ocamlbrew without setting anything, from an OCaml-clean environment, it will build OCaml 3.12.1, findlib 1.2.7, grab odb.ml, and install oasis
<hcarty> They are useful together, so keeping them somehow related would be nice
<hcarty> I'm not opposed to mixing odb and ocamlbrew, but I'm not sure odb's repository is the right place to do that.
<hcarty> thelema: Not posted yet - I'll push something out somewhere once this test run is complete
<hcarty> thelema: I think I may put ocamlbrew and getting-started.md in a new repository
<thelema> hcarty: where is ocamlbrew?
<hcarty> ocamlbrew can now build multiple OCaml versions, by default installing them in ~/ocamlbrew/ocaml-$OCAML_VERSION/
<hcarty> Looks like it works, thank you
<hcarty> I get that message, then "Installing oasis" then "Exception: Not_found"
<hcarty> Beyond that, odb as-is works well with ocamlbrew as it currently exists
<hcarty> thelema: For now, I need to find out why "odb.ml oasis" is raising Not_found :-)
<thelema> hcarty: very nice. I've pointed odb towards being able to use local info to get packages
<hcarty> thelema: ocamlbrew just completed its first test run
<hcarty> Drakken: Agreed
<hcarty> There are certainly a few pragmatic hacks like that in OCaml :-)
<Drakken> hcarty right, all the bitwise operators.
<hcarty> Drakken: Not just mod. ( lsl ) and ( lsr ), along with some other logical operators I think
<hcarty> thelema: Is there anything in particular you would like tested?
<hcarty> thelema: I should be able to test odb today

2011-12-22

<thelema> hcarty__: if you get a chance to make sure I didn't break odb too badly, I just pushed some internal changes. Some can/should be reverted after asking gildor for some tweaks to the oasis-db/odb server
<thelema> hcarty__: no worries
<hcarty__> thelema: Feel free to rename switches. My apologies for the naming inconsistency - all does make more sense in this case.
<thelema> no - I think that hcarty thought -global made sense, although it was inconsistent with the existing -all
<thelema> hcarty: mind if I rename --configure-flags-global to --configure-flags-all?
<larhat> thelema, hcarty, adrien: we, the camluntiy, will translate design doc shortly
<hcarty> thelema: Interesting...
<hcarty> On the plus side, I imagine this could land post-2.0 since it would only add to interfaces. Nothing would be removed.
<hcarty> I'm more concerned about time overhead. I don't think I'll have time to complete it.
<hcarty> I'm not concerned about the computational overhead - I'm already used a NoException-functorized version of Map locally :-)
<hcarty> LOC heavier
<hcarty> It's not impossible, just heavier
<hcarty> thelema: Map.(Make, S) are troublesome, along with Set and any other modules with functors
<hcarty> I don't think a BatteriesNoExceptions will be as straightforward as I had hoped
<hcarty> thelema: That's a cool let (...) = Module.(...) trick
<hcarty> adrien: Windows support is something that we can only hope to asymptotically approach
<hcarty> Five revisions later... It Works For Me
<adrien> hcarty: right, it only works if upstream is using something itself
<hcarty> Which is arguably not the right way to develop something :-)
<hcarty> adrien: That works for normal development, but not for this "quick patch over upstream's build system" approach
<adrien> hcarty: I never ever do that: my makefile does it
<hcarty> adrien: A large part of the challenge is getting used to a different workflow - like remembering to run "oasis setup" after changing _oasis
<adrien> hcarty: same here; my issue is that parsing is slow
<hcarty> adrien: I really like oasis overall
<hcarty> One more fix to do... I forgot to add "touch setup.data" to the custom configuration command
<hcarty> thelema: Sounds good re: odb. It would be nice to bring testing support back in eventually, but it may require oasis-db support to do properly.
<thelema> hcarty: yes, that's an annoying feature of oasis
<hcarty> thelema: I forgot to regenerate setup.ml in my lablgtk2 upload - I'll correct that now
<thelema> hcarty: my latest commit 6e9c removes the make test bit for oasis packages
<f[x]> hcarty, cool, good to know
<hcarty> f[x]: It has per-target dependencies. oasis's flags allows for a type of optional depency - Lwt uses this, for example.
<f[x]> hcarty, do you mean that oasis now has optional dependencies?
<hcarty> to the _oasis file of the oasis-db lablgtk2 package to ensure ./configure is called
<hcarty> thelema: I added ConfType: custom (0.2)
<hcarty> thelema: I added
<hcarty> thelema: odn's tests require fileutils and oUnit, but the library itself does not
<hcarty> thelema: oasis-db doesn't list test-only dependencies, so odb.ml doesn't know to fetch them before building
<hcarty> thelema: The addition of automatic test running looks like it broke odn's build

2011-12-21

<Anarchos> hcarty so each callback can triggers the gc on the same ocaml heap...
<Anarchos> hcarty i have lightweight processes having shared memory
<hcarty> Anarchos: If you use multiple processes, each process can independently call to/from C. It doesn't help with multiple C threads calling back into a single process though.
<Anarchos> hcarty not sure what you say, but the lib uses multiple processes
<adrien> hcarty: that's iirc, there are the details in one article on the website
<hcarty> Anarchos: Unless you use multiple processes, one partition per process
<hcarty> adrien: That's pretty cool. I didn't know that was how it works.
<hcarty> adrien: What part of ocamlnet is that?
<hcarty> thelema: That's quite a varied set of quotes.
<hcarty> thelema: That's good. I like having the comfort of bounds checking and performance.
<hcarty> It looks like "./odb.ml --unstable oasis" works now
<thelema> hcarty: yes, modern processors have gotten *damn* good at array bounds checks
<hcarty> gildor: Thank you for pushing out the update
<hcarty> gildor: Woo-hoo! :-) It works
<hcarty> gildor++
<hcarty> thelema: Along the lines of modern processors are smart enough to negate the benefits of "-unsafe" in many cases
<hcarty> thelema: xleroy commented on that on the list a while ago...
<hcarty> Locally make Array, String and Bigarray accesses use the *.unsafe_* functions
<hcarty> With 3.12.x, Unsafe.(...) would be nice for localizing unsafe accesses
<adrien> hcarty: I got a bit lazy while coding in the train and used the out-of-bound exception instead of checking that the array index was in-bounds
<hcarty> adrien: What brings that up? :-)
<hcarty> gildor: I get that error from using OCaml 3.12.1 with type-conv 3.0.4 and odn 0.0.6 from oasis-db's unstable packages
<hcarty> gildor: Thank you as well :-)
<hcarty> thelema: Cool, thanks
<hcarty> gildor: I'd like to upload it on oasis-db so that oasis is buildable across stable/testing/unstable
<gildor> hcarty: wait a second
<hcarty> gildor: Where is type-conv 3.0.4 available?
<thelema> hcarty: no worries.
<hcarty> thelema: Sorry, I didn't remember who had initiated that topic.
<hcarty> thelema: Yes, you and pilki were talking about it earlier
<hcarty> thelema, adrien: Yes, and I think someone else mentioned it earlier too...
<adrien> hcarty: "Noise about IRC"? what do you mean?
<hcarty> gildor: "Error: Unbound value Gen.idp" using odn 0.0.6 and type-conv 3.0.3. We'll have to put 3.0.4 in odb.
<thelema> hcarty: that's just my best guess for its purpose.
<hcarty> adrien: Noise about IRC seems to indicate that is (part of?) its purpose
<adrien> hcarty: agreed
<hcarty> adrien: It looks hard to read to me, but without concrete examples it's kind of hard to tell.
<hcarty> gildor: With type-conv 3.0.3 that is?
<hcarty> gildor: With 3.0.3?
<gildor> hcarty: I think the latest version of odn is type-conv compatible
<hcarty> Are there other findlib-like systems which support multiple versions of the same library installed side by side?
<hcarty> thelema: I wanted to get it out in prose first, but a .sh is my goal
<thelema> hcarty: while proofreading, I was thinking about whether the document shouldn't just be a documented .sh file
<hcarty> I want to make a .sh equivalent to that getting-started document. That could be a v0 ocamlbrew.
<hcarty> bitbckt: A tool complimentary to odb is definitely a good idea
<hcarty> They could merge eventually if it seems logical, but initial work should probably be separate
<hcarty> thelema: I agree. I think 'ocamlbrew' and odb.ml should be separate tools
<hcarty> bitbckt: Or the other way around - I don't know which came first
<hcarty> thelema: And that ~/.odb could be blown away, leaving OCaml itself intact.
<thelema> hcarty: I now see the usefulness of perlbrew, and will work to make odb friendly with this. odb already auto-detects GODI and configures for its install dir
<hcarty> thelema: That's what I was shooting for, with the hope that the result would be flexible enough to grow from.
<hcarty> thelema: The Ruby tool avsm mentioned sounds a lot like perlbrew
<thelema> hcarty: yes, I was expecting something targeting a total beginner, with minimal complexity.
<hcarty> thelema: avsm's comments are part of why I wrote getting-started.md the way I did. But it may be useful to have a purely vanilla version (no extraneous configuration) and a custom version (easy support for multiple OCamls and multiple library trees)
<hcarty> s/lookf/look/
<hcarty> I lookf forward to mind-bendingly useful examples of let.foo and GADTs in OCaml :-)
<pilki> hcarty : it is an equivalent for the do notation of haskell
<thelema> hcarty: I guess to accomodate lwt
<hcarty> What is the goal of the let.foo syntax?
<hcarty> thelema: The last time I checked OCaml's trunk was just after the toplevel additions. This new flood of activity and features is impressive.
<hcarty> thelema: You're welcome, and thank you for the comments.
<thelema> hcarty: thanks for your writeup
<hcarty> summary
<hcarty> thelema: I'm off for a while. Email or leave comments here if you have anything further on the getting started summaryu
<thelema> hcarty: true - with custom package trees, --install-everything would be useful
<hcarty> But if there is eventually a local version of oasis-db, having an --install-everything option could be handy when setting up a new system with local libraries.
<hcarty> thelema: re: --install-everything - I don't think this would be a commonly used option, primarily used for the purpose you mentioned
<hcarty> thelema: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00180.html -- hopefully gildor will release a new version which works with the newer type-conv
<thelema> hcarty: I'll wait for a new release... hopefully not too long.
<hcarty> I have the message saved in my account. I'll see if I can find the original message in the archives.
<hcarty> thelema: There is a patch on the caml-list for odn from May 30
<hcarty> IIRC a function was removed from the API
<thelema> hcarty: ah, thanks.
<hcarty> There was something on one of the mailing lists about this, and I think that there is a patch somewhere to fix oasis building against the newer type-conv
<hcarty> It's the type-conv version
<hcarty> And useful for local or custom oasis-db repositories
<hcarty> thelema: "--install-everything" could be a nice testing tool
<hcarty> With odb.ml + a few environment variable changes, one OCaml version could be used with several sets of libraries (ex. Batteries 1.x in stable, 2.x in testing)
<hcarty> Out-of-tree package installs allow for options like local stable, testing, unstable sets of libraries
<hcarty> I'm not entirely convinced that local source-based OCaml installations should have odb packages installed under the install tree
<hcarty> cpanm + local::lib - install CPAN modules to custom locations
<hcarty> perlbrew - build any version of Perl from source
<hcarty> Or, perhaps, local::lib
<hcarty> Think perlbrew vs cpanm
<hcarty> I'd like to split this up eventually
<hcarty> It does for packages with C bindings