Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 25 2020 20:09
    gildor478 edited #532
  • Oct 25 2020 20:09
    gildor478 commented #532
  • Oct 24 2020 23:57
    Travis ocaml/oasis (master) passed (282)
  • Oct 24 2020 21:40
    Travis ocaml/oasis (master) canceled (281)
  • Oct 24 2020 21:40

    gildor478 on master

    Update README.md (compare)

  • Oct 24 2020 21:20
    Travis ocaml/oasis (master) canceled (280)
  • Oct 24 2020 21:20

    gildor478 on master

    Improve documentation. (compare)

  • Oct 24 2020 21:13
    Travis ocaml/oasis (master) canceled (279)
  • Oct 24 2020 21:13

    gildor478 on master

    Update logo. (compare)

  • Oct 24 2020 21:10
    bar commented #532
  • Oct 24 2020 21:10

    gildor478 on master

    Integrate documentation from oa… (compare)

  • Oct 24 2020 19:13
    gildor478 commented #557
  • Oct 24 2020 19:12
    gildor478 commented #509
  • Oct 24 2020 19:12
    gildor478 commented #507
  • Oct 24 2020 19:11
    gildor478 commented #505
  • Oct 24 2020 19:11
    gildor478 commented #494
  • Oct 24 2020 19:10
    gildor478 commented #373
  • Oct 24 2020 19:10
    gildor478 commented #371
  • Oct 24 2020 19:09
    gildor478 commented #367
  • Oct 24 2020 19:09
    gildor478 commented #363
Aleksandr Denisov
@alerdenisov
snark_intf.ml 415: : functor (M : sig type t [@@deriving enum] end) ->
enumerable.ml 12: module Make (Impl : Snark_intf.Basic) (M : sig type t [@@deriving enum] end) = struct
Sylvain Le Gall
@gildor478
@alerdenisov jbuilder is totally different from oasis, I have no clue about it.
Kenneth Adam Miller
@KennethAdamMiller
Is there a way to build using ppx dependencies?
Ivan Gotovchits
@ivg
@KennethAdamMiller, just add a ppx library as a dependency and it will work out if the box.
Kenneth Adam Miller
@KennethAdamMiller
I was trying to do that, but it ended up being easier to switch to dune. I had added that library using _oasis, and it wouldn't work.
Kenneth Adam Miller
@KennethAdamMiller
Do you have any recommendation for/against dune or oasis? I mean, I thought that bap had switched to dune at one point, and I was really reluctant to encounter any more further trouble when I already had something working. But now I can get that working too.
Ivan Gotovchits
@ivg
Nope, we didn't switch to dune as it is not versatile enough. We use oasis, together with ocamlbuild and omake backend. The former is for portability the latter is for in-house development (it builds bap in 2 minutes vs 30 minutes, and rebuilds in the matter of seconds).
Kenneth Adam Miller
@KennethAdamMiller

I kept getting this error:

File "src/metrics.ml", line 16, characters 14-22:
Error: Ppxlib.Deriving: 'protobuf' is not a supported type deriving generator

And, my build depends include ppx_deriving_protobuf

Ivan Gotovchits
@ivg
You were probably also missing the dependency on ppx_deriving
Kenneth Adam Miller
@KennethAdamMiller
Ok, I added that, but I still get that error
Ivan Gotovchits
@ivg
just in case, when you change anything in _oasis you have to repeat all the steps from the very beginning, oasis setup, ocaml setup.ml -configure, etc
Kenneth Adam Miller
@KennethAdamMiller
I did that too
Here's the command:
  • /home/kennethadammiller/.opam/4.07.0/bin/ocamlfind ocamldep -package bap -package cmdliner -package core_kernel -package ocamlgraph -package ppx_deriving -package ppx_deriving_protobuf -package threads -modules src/superset.ml > src/superset.ml.depends
Ivan Gotovchits
@ivg
ivg@pippin:~/artifacts/protobuf_example$ cat _oasis
OASISFormat: 0.4
Name:        protobuf_example
Version:     0.1
Synopsis:    Example
Authors:     Me
License:     MIT
Plugins:     META (0.4), StdFiles (0.4), DevFiles (0.4)
Executable example
  Path:       .
  BuildTools: ocamlbuild
  MainIs:     example.ml
  BuildDepends: ppx_deriving_protobuf
$ cat example.ml
type t = string [@@deriving protobuf]
let () = print_endline "hello, world"
$ oasis setup
$ ./configure
<snip>
$ make
ocaml setup.ml -build
Finished, 0 targets (0 cached) in 00:00:00.
Finished, 3 targets (3 cached) in 00:00:00.
$ ./example.byte
hello, world
In other words, it works for me out of the box
However, if I will add ppx_jane it will fail, because this derivier is not supported by ppx_jane
+ /home/ivg/.opam/4.09.0/bin/ocamlfind ocamldep -package ppx_deriving_protobuf -package ppx_jane -modules example.ml > example.ml.depends
File "example.ml", line 1, characters 28-36:
1 | type t = string [@@deriving protobuf]
                                ^^^^^^^^
Error: Ppxlib.Deriving: 'protobuf' is not a supported type deriving generator
Kenneth Adam Miller
@KennethAdamMiller
I don't have a configure step...
Where'd you get that example?
Ivan Gotovchits
@ivg
I just wrote it a second ago
The configure script is generated by the DevFiles it is just the same as running ocaml setup.ml -configure but in a more natural way
anyways, the culprit is that ppx_deriving is not compatible with ppx_jane and we're using ppx_jane in bap, so you will need to drop the dependency on ppx_deriving and ppx_protobufs. They are very fragile and break every other release and we took a lot of effort to get rid of them in our code base, so we would like to add them back. I also don't see any practical need to use protobuf when implementing a disassembler.
Kenneth Adam Miller
@KennethAdamMiller
My build works when I use dune though. You say dune takes 30+ mins vs oasis 2 mins?
Ivan Gotovchits
@ivg
I did not say this.
Your build works, because dune doesn't bring the dependency on ppx_jane from bap. But it will stop working if you will try to integrate it with bap and turn into a plugin. And anyway, if you want to merge to bap you will have to use oasis. You can make it work, of course, by setting predicates and playing with tags, but it will make bap very fragile and we don't want it.
Kenneth Adam Miller
@KennethAdamMiller
Ok. I was going to use protobuf to make much of the results of my output parsable without requiring scripts.
Ivan Gotovchits
@ivg
you can use binprot or sexp
Kenneth Adam Miller
@KennethAdamMiller
In particular, I don't like how my scripts folder breaks down results with grep and other things
Oh ok!
Well, now I had planned a lot of development efforts around ppx to use instrumentation to write some programmable debugging facilities.
Separate from bap. You say that ppx is really fragile?
Ivan Gotovchits
@ivg
I didn't say this. I said that ppx_deriving is fragile, stick to ppx_jane
and it doesn't mean that you shouldn't to use [@@deriving ...]. Just ppx_deriving grabbed that name, but ppx_jane is handling better this extension.
There are a few well-supported ppx extensions from Janestreet https://github.com/janestreet?q=ppx&type=&language=
Kenneth Adam Miller
@KennethAdamMiller
I was just thinking that the correction was from ppx to ppx_deriving being fragile. So, does ppx_jane allow for some comport of what ppx_deriving was for?
Ivan Gotovchits
@ivg
Yes, ppx_deriving_* libraries are fragile
Kenneth Adam Miller
@KennethAdamMiller
ha, like just as you wrote that.
Well, maybe I could share some of the project ideas with you.
Ivan Gotovchits
@ivg
but not in this chat, we already abuse it :)
Kenneth Adam Miller
@KennethAdamMiller
ok
Jaime Arias Almeida
@himito
Hello everyone :)
I was wondering if there is an option in oasis in order to build incrementally.
Ivan Gotovchits
@ivg
@himito, what do you mean by incremental build?
Jaime Arias Almeida
@himito
hi @ivg , for example, if I change only one line of code, then the build system does not recompile the whole project
Ivan Gotovchits
@ivg
Well, this is enabled by default (and has nothing to do with oasis, in fact), but the cross-module optimization kicks in and makes things slow. You can disable it by using the -opaque option of the compiler.

E.g., you can add the following (provided that you're using ocamlbuild backend) to the myocamlbuild.ml

let disable_crossmodule_optimization = function
  | After_rules -> flag ["ocaml"; "compile"] (A "-opaque")
  | _ -> ()

let () =
  Ocamlbuild_plugin.dispatch (fun stage ->
      disable_crossmodule_optimization stage)

and then after you touch any module no other modules, including those that depend on it will be recompiled. Well, unless you change the interface, of course.

Jaime Arias Almeida
@himito
:O I see, thank you @ivg , I will try :D
Ivan Gotovchits
@ivg
Sure thing :)
Jaime Arias Almeida
@himito
@ivg it worked !! thanks a lot !
Ivan Gotovchits
@ivg
glad to help :)
Kenneth Adam Miller
@KennethAdamMiller
I don't see landmarks anywhere in your _oasis, so I don't know how you tell oasis to rewrite with the ppx-landmarks?
Ivan Gotovchits
@ivg
I wasn't using ppx_landmarks, since I was profiling monadic code, but adding landmarks.ppx to the dependencies list might work