profile
viewpoint

sliquister/batteries-included 0

Batteries Included project

sliquister/camlp4 0

Camlp4 tool

sliquister/dune 0

A composable build system for OCaml

sliquister/libfaketime 0

libfaketime modifies the system time for a single application

sliquister/notty 0

Declarative terminal graphics for OCaml

sliquister/ocaml 0

The core OCaml system: compilers, runtime system, base libraries

sliquister/ocaml-compiler-libs 0

compiler libraries repackaged

sliquister/ocaml-inotify 0

OCaml bindings for inotify.

sliquister/ocaml-re 0

Pure OCaml regular expressions, with support for Perl and POSIX-style strings

sliquister/regex 0

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

issue closedjanestreet/ppx_inline_test

non-ghost location in generated code

Hi,

We noticed in https://github.com/aantron/bisect_ppx/issues/387 that ppx_inline_test produces non-ghost located code. Generated code example:

[@@@ocaml.ppx.context
  {
    tool_name = "ppx_driver";
    include_dirs = [];
    load_path = [];
    open_modules = [];
    for_package = None;
    debug = false;
    use_threads = false;
    use_vmthreads = false;
    recursive_types = false;
    principal = false;
    transparent_modules = false;
    unboxed_types = false;
    unsafe_string = false;
    cookies = [("inline_tests", "enabled"); ("library-name", "trie")]
  }]
let () = Ppx_inline_test_lib.Runtime.set_lib_and_partition "trie" ""
...

Parsetree of the generated code:

...
structure_item (src/trie.ml[4,201+0]..[4,201+0])
    Pstr_value Nonrec
    [
      <def>
        pattern (src/trie.ml[4,201+0]..[4,201+0])
          Ppat_construct "()" (src/trie.ml[4,201+0]..[4,201+0])
          None
        expression (src/trie.ml[4,201+0]..[4,201+0])
          Pexp_apply
          expression (src/trie.ml[4,201+0]..[4,201+0])
            Pexp_ident "Ppx_inline_test_lib.Runtime.set_lib_and_partition" (src/trie.ml[4,201+0]..[4,201+0])
          [
            <arg>
            Nolabel
              expression (src/trie.ml[4,201+0]..[4,201+0])
                Pexp_constant PConst_string("trie",None)
            <arg>
            Nolabel
              expression (src/trie.ml[4,201+0]..[4,201+0])
                Pexp_constant PConst_string("",None)
          ]
    ]
 ...

In our case (for bisect_ppx instrumentation), this creates invalid locations for coverage reports.

(for more context, project can be found here)

closed time in 23 days

vch9

issue commentjanestreet/ppx_inline_test

non-ghost location in generated code

If you want to try using the latest jane street packages, there are instructions here https://github.com/janestreet/opam-repository . I'm going to close this because this issue should be fixed in the latest (unreleased) version.

vch9

comment created time in 23 days

issue commentjanestreet/ppx_inline_test

non-ghost location in generated code

Yeah, v0.14 has the issue.

Alright, well it's already fixed, so there's no more to do here. I think a new stable release is supposed to be made soon-ish. In the meantime, maybe you can try the non stable packages, and make sure there are no other issues (I don't know how to do it, but maybe you do?).

vch9

comment created time in a month

issue commentjanestreet/ppx_inline_test

non-ghost location in generated code

What version are you using?

I see everything marked as ghost, and it has been for almost exactly a year. That being said, I think a stable release hasn't been made in forever, so maybe it's not the default behavior yet.

  structure_item (config.ml[1,0+0]..[1,0+0]) ghost
    Pstr_value Nonrec
    [
      <def>
        pattern (config.ml[1,0+0]..[1,0+0]) ghost
          Ppat_construct "()" (config.ml[1,0+0]..[1,0+0]) ghost
          None
        expression (config.ml[1,0+0]..[1,0+0]) ghost
          Pexp_apply
          expression (config.ml[1,0+0]..[1,0+0]) ghost
            Pexp_ident "Ppx_inline_test_lib.Runtime.set_lib_and_partition" (config.ml[1,0+0]..[1,0+0]) ghost
          [
            <arg>
            Nolabel
              expression (config.ml[1,0+0]..[1,0+0]) ghost
                Pexp_constant PConst_string("fake_for_merlin",(config.ml[1,0+0]..[1,0+0]) ghost,None)
            <arg>
            Nolabel
              expression (config.ml[1,0+0]..[1,0+0]) ghost
                Pexp_constant PConst_string("fake",(config.ml[1,0+0]..[1,0+0]) ghost,None)
          ]
    ]
vch9

comment created time in a month

issue commentfacebookexperimental/eden

Unable to build eden

Thanks! I managed to build edenfs with #88. It's a bit hard to tell whether the resulting exe work normally though, because I haven't built the other parts of eden. I think there may be something weird with the edenfs executable, because its dependency on libgit2 is dynamic:

$ ../eden-install/eden/bin/edenfs
../eden-install/eden/bin/edenfs: error while loading shared libraries: libgit2.so.28: cannot open shared object file: No such file or directory
$ ldd ../eden-install/eden/bin/edenfs | grep 'not found'
	libgit2.so.28 => not found
 LD_PRELOAD=$PWD/../eden-install/libgit2-kH6rIzSaNvZTBjTar1kL8hrJu4z_QA5f3nbqrz7216g/lib/libgit2.so.28 ../eden-install/eden/bin/edenfs --help
... seems to work ok ...

So anyway I looked for a way to build the client. I think build/fbcode_builder/getdeps.py build eden_scm is the way to do this. Unfortunately I ran into issues again there, after a couple of simple tweaks [1]:

$ build/fbcode_builder/getdeps.py build eden_scm
Building on {distro=ubuntu, distro_vers=21.04, fb=off, os=linux, test=on}
Assessing fb303-source...
Using pinned rev 56ad59fa12e136cae61478c13ddb7651c4a31add for https://github.com/facebook/fbthrift.git
Assessing fbthrift-source...
Using pinned rev 56ad59fa12e136cae61478c13ddb7651c4a31add for https://github.com/facebook/fbthrift.git
Assessing openssl...
...
Assessing wangle...
Using pinned rev 56ad59fa12e136cae61478c13ddb7651c4a31add for https://github.com/facebook/fbthrift.git
Assessing fbthrift...
Using pinned rev 56ad59fa12e136cae61478c13ddb7651c4a31add for https://github.com/facebook/fbthrift.git
Assessing rust-shed...
Assessing eden_scm...
Building eden_scm...
---
+ GETDEPS_BUILD_DIR=/tmp/fbcode_builder_getdeps-fbcode_builder/build \
+ GETDEPS_INSTALL_DIR=/tmp/fbcode_builder_getdeps-fbcode_builder/installed \
+ OPENSSL_DIR=/tmp/fbcode_builder_getdeps-fbcode_builder/installed/openssl-OE70IQim5vtlKk6ZHvvzHHZikHn-NXo3s7YCd-58ws8 \
+ cd /tmp/fbcode_builder_getdeps-fbcode_builder/repos/github.com-facebookexperimental-eden.git/eden/scm && \
+ make \
+      -j6 \
+      getdepsbuild \
+      PREFIX=/tmp/fbcode_builder_getdeps-fbcode_builder/installed/eden_scm \
+      prefix=/tmp/fbcode_builder_getdeps-fbcode_builder/installed/eden_scm
mkdir -p /tmp/fbcode_builder_getdeps-fbcode_builder/build/eden_scm
ln -sfn /tmp/fbcode_builder_getdeps-fbcode_builder/build/eden_scm build
ln -sfn /tmp/fbcode_builder_getdeps-fbcode_builder/installed/fbthrift-source/thrift ../../thrift
ln -sfn /tmp/fbcode_builder_getdeps-fbcode_builder/installed/fb303-source/fb303 ../../fb303
mkdir -p ../../common/rust
ln -sfn /tmp/fbcode_builder_getdeps-fbcode_builder/installed/rust-shed/source/shed ../../common/rust/shed
GETDEPS_BUILD=1 \
	PYTHON_SYS_EXECUTABLE=/usr/bin/python3 \
	THRIFT="/tmp/fbcode_builder_getdeps-fbcode_builder/installed/fbthrift/bin/thrift1" \
	/usr/bin/python3 setup.py \
	 build 
/tmp/fbcode_builder_getdeps-fbcode_builder/repos/github.com-facebookexperimental-eden.git/eden/scm/setup.py:31: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
stderr from '/usr/bin/python3 hg log -r. -T {sub("([:+-]|\d\d\d\d$)", "",date|isodatesec)} {node|short}':
b"  /usr/bin/python3: can't open file '/tmp/fbcode_builder_getdeps-fbcode_builder/repos/github.com-facebookexperimental-eden.git/eden/scm/hg': [Errno 2] No such file or directory"
running build
running build_mo
warning: hgbuildmo: could not find msgfmt executable, no translations will be built

running build_scripts
cc -g -c contrib/whochanges/whochanges.c -o contrib/whochanges/whochanges.o
cc contrib/whochanges/whochanges.o -o build/scripts-3.9/whochanges
running build_py
error: [Errno 2] No such file or directory: '../../thrift/lib/py'
make: *** [Makefile:97 : getdepsbuild] Erreur 1
Command '['make', '-j6', 'getdepsbuild', 'PREFIX=/tmp/fbcode_builder_getdeps-fbcode_builder/installed/eden_scm', 'prefix=/tmp/fbcode_builder_getdeps-fbcode_builder/installed/eden_scm']' returned non-zero exit status 2.
!! Failed

which I suspect comes from https://github.com/facebookexperimental/eden/blob/c7762ae593a9d15ea0b134fc57882849e2f32909/eden/scm/setup.py#L755-L769

There's perhaps some kind of local hack I can use to make progress, but I haven't figured it out yet.

[1]

diff --git a/build/fbcode_builder/manifests/eden_scm b/build/fbcode_builder/manifests/eden_scm
index 52cde91bc2..698507089d 100644
--- a/build/fbcode_builder/manifests/eden_scm
+++ b/build/fbcode_builder/manifests/eden_scm
@@ -6,6 +6,8 @@ shipit_fbcode_builder = true
 
 [git]
 repo_url = https://github.com/facebookexperimental/eden.git
+rev = c7762ae593a9d15ea0b134fc57882849e2f32909
+# rev = main
 
 [build.not(os=windows)]
 builder = make
diff --git a/build/fbcode_builder/manifests/rust-shed b/build/fbcode_builder/manifests/rust-shed
index c94b3fdd60..afe67c9e8b 100644
--- a/build/fbcode_builder/manifests/rust-shed
+++ b/build/fbcode_builder/manifests/rust-shed
@@ -6,6 +6,7 @@ shipit_fbcode_builder = true
 
 [git]
 repo_url = https://github.com/facebookexperimental/rust-shed.git
+rev = main
 
 [build]
 builder = cargo
sliquister

comment created time in a month

issue commentfacebookexperimental/eden

Unable to build eden

Right. It's possible I'd run into a wall pretty quickly even the build were to succeed, but I assume there are still useful things to learn even if starting a VFS or a server is a challenge. Say, what the CLI even looks like. Is there still a notion of draft and obsolescence markers. What's the speed of operation, say commit/status/update, if I import a working copy from some other repo.

sliquister

comment created time in 2 months

issue openedfacebookexperimental/eden

Unable to build eden

I've spent maybe an hour or two trying to build eden, with no success.

The first issue was that it was not entirely clear how to build eden. The root README.md says to use build.sh to build EdenFS, but doesn't mention anything about building the rest of eden, which are the bits I'm interested in. So I looked in eden/scm, but the README there seems to be leftover from hg, and trying to build something there gave me an error saying something like "this needs to be built using getdeps.py", so I assumed maybe the root build.sh builds everything and the README is stale.

So running build.sh, I got a compilation error in eden/fs/config/EdenConfig.h, due to common/rust/shed/hostcaps/hostcaps.h not existing. So I cloned the rust-shed repo and copied it under common/rust.

Then I got a bunch more compilation errors because the Cargo.toml files request the master branch of the rust-shed repo, which doesn't exist. I rewrote all these from "master" to "main".

Then I got multiple rust build failures on mod fb; lines, presumably because --features fb was being passed to cargo/rustc (which I think should be only be used for internal builds?) first in the rust-shed code I copied into the tree, then elsewhere (don't remember where). I couldn't quickly find why the feature was set, and ./build.sh --no-facebook-internal didn't help, so I replaced all "feature = "fb" by "feature = "zz" to deactivate all this and proceed.

Then I got a build error because eden/scm/lib/third-party/rust/fbthrift/Cargo.toml mentions ../../../../../../thrift/lib/rust, which does not exist. I replaced it with ../../../../../.././external/fbthrift/thrift/lib/rust, which stopped this error but resulting in multiple new ones, so I don't know if that was the right fix:

  • external/fbthrift/thrift/lib/rust/Cargo.toml mentions the support_old_nightly feature of async-trait, which apparently doesn't exist. I removed that.

  • then I got rust errors in external/fbthrift/thrift/lib/rust/src/processor.rs in the NullServiceProcessor implemenation of ServiceProcessor, because the unused parameters of handle_methods are not Send/Sync (??). My rust compiler is already as up to date as it can. So I made everything relevant Send/Sync.

  • finally, I ran into screenfuls of errors like this:

error[E0433]: failed to resolve: could not find `help` in `fbthrift`
   --> ~/eden/eden/scm/lib/thrift-types/eden_config/src/lib.rs:105:25
    |
105 |             ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
    |                         ^^^^ could not find `help` in `fbthrift`

error[E0433]: failed to resolve: could not find `help` in `fbthrift`
   --> ~/eden/eden/scm/lib/thrift-types/eden_config/src/lib.rs:125:25
    |
125 |             ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "ConfigSource").map(ConfigSource)
    |                         ^^^^ could not find `help` in `fbthrift`

That's where I'm stuck currently. Any idea how to make progress here?

created time in 2 months

issue closedjanestreet/ppx_variants_conv

Missing is_* functions

The readme says that this ppx should be generating is_* functions, but it doesn't seem to be doing so.

E.g.,

module Fruit = struct
  type t = Apple | Pear [@@deriving variants]
end

let _x = Fruit.is_apple Fruit.apple

Gives the error

17 | let _x = Fruit.is_apple Fruit.apple
              ^^^^^^^^^^^^^^
Error: Unbound value Fruit.is_apple
Hint: Did you mean apple?

Is this expected behavior? (I'm using the 4.12.0 OCaml compiler and ppx_variants_conv v0.14.1.)

For reference, here's the whole generated signature:

sig
  type t = Apple | Pear
  val apple : t
  val pear : t
  module Variants :
    sig
      val apple : t Variant.t
      val pear : t Variant.t
      val fold :
        init:'a ->
        apple:('a -> t Variant.t -> 'b) ->
        pear:('b -> t Variant.t -> 'c) -> 'c
      val iter :
        apple:(t Variant.t -> unit) -> pear:(t Variant.t -> unit) -> unit
      val map :
        t -> apple:(t Variant.t -> 'a) -> pear:(t Variant.t -> 'a) -> 'a
      val make_matcher :
        apple:(t Variant.t -> 'a -> (unit -> 'b) * 'c) ->
        pear:(t Variant.t -> 'c -> (unit -> 'b) * 'd) -> 'a -> (t -> 'b) * 'd
      val to_rank : t -> int
      val to_name : t -> string
      val descriptions : (string * int) list
    end
end

closed time in 2 months

mooreryan

issue commentjanestreet/ppx_variants_conv

Missing is_* functions

If you're using v.014.1, you should probably look at this README instead: https://github.com/janestreet/ppx_variants_conv/blob/v0.14.1/README.md . You'll see it doesn't have the is_... functions, because it's too old.

There's not a newer released version at the moment though. It's possible to use the latest version of our packages. I haven't tried this myself, but based on a quick search, maybe the command from https://github.com/janestreet/incr_map/issues/1 is the way to do it.

mooreryan

comment created time in 2 months

more