On Sun, Mar 17, 2013 at 06:38:04PM -0500, Anton Lavrik wrote:
> On Sun, Mar 17, 2013 at 6:41 AM, Motiejus Jakštys <
desir...@gmail.com> wrote:
> > Hi, Anton,
> >
> > We are thinking to package piqi to an RPM*, and have only "piqi-rpc"
> > as Erlang dependencies in our applications. Because of a few reasons:
> >
> > 1. We want to use company-wide piqi version and have a central place
> > to update it (our package repositories).
> > 2. For smaller projects compiling piqi takes 90% of the total project
> > build time.
> > 3. Be more explicit about the project dependencies. I.e. instead of
> > saying: for your tiny-project these packages must be installed
> > system-wide: "erlang ocaml ocaml-findlib ocaml-caml4p-devel", it will
> > be "erlang piqi".
> >
> > Same applies if piqi is downloaded via opam. And old behaviour will be
> > preserved (if system has no piqi, it must download and compile it at
> > build time).
>
> That was roughly my plan as well. The difference is that I never have
> to compile piqi executables from sources, because I always use one of
> the released stable versions that includes the prebuilt piqi and piqic
> executables.
In the past these did not work with some of our CI machines due to older
glibc version. Current piqi-binary works, but I am unsure why: either
because of system upgrade (unlikely that it happened), or because you
changed something in the binary build process, and it Just started working.
Unlikely as well, I guess.
Besides, maybe it is possible to fully statically compile piqi (i.e.
include libc)? That would be awesome. I wouldn't be surprised if it
worked with some other libc and could fully statically link.
Building piqi fails for me since 0.6.0 (just noticed), so I can't really
try. I will send you a proper bug report sometime soon.
> What it means in practice?
>
> 1. Complete piqi-erlang codebase, including the new "piqic-erlang"
> compiler, is now located and maintained here:
>
https://github.com/alavrik/piqi-erlang (in dev branch, which is the
> new default). There's no piqi_src dependency any more. In addition,
> the repository includes all the tests, examples and documentation.
>
> 2. piqi-erlang has a new dependency called piqi-binary
> (
https://github.com/alavrik/piqi-binary) that includes precompiled
> "piqi" executable for various platforms. This means that there's no
> need to build piqi from OCaml sources any more. By the way,
> "piqic-erlang" no longer requires "piqic". Instead it relies on "piqi
> compile".
I had a quick look, now it really looks cleaner. Good job!
As the artefact build system changed, Makefiles will need revamping on
our side. It is a good chance to redo the thing, though will take a
while.
> 3. Similarly to piqi-erlang, piqi-rpc codebase is now fully contained
> at
https://github.com/alavrik/piqi-rpc Naturally, it depends on
> piqi-erlang but that's pretty much it. Oh, I also bumped Webmachine
> version to 1.9.3
>
> 4. "piqic-erlang-ext" and therefore *_piqi_ext.erl go away.
> "piqic-erlang" now includes serializers and deserializers for
> multi-format converters (i.e. gen_X*/2, /3 and parse_X*/2, /3
> functions) in *_piqi.erl.
>
> 5. "--gen-defaults" compiler option is deprecated. "piqic-erlang" now
> generates default_X/1 without asking.
>
> I've been testing this new stuff for the last couple of weeks and I'm
> pretty confident about it. It should be almost a drop-in replacement
> for piqi-0.6.0. Only some minor makefile and code tweaking may be
> necessary, e.g. renaming to _piqi_ext:gen_X calls to _piqi:gen_X.
We are still on 0.5.7 and were waiting for default-field-values (not a
big deal, because I can cherry-pick) and piqic-erlang rewrite (big
deal). So now we will start migrating gradually I guess.
Is default-field-values in the job pipeline? We are looking forward. :-)
FYI, today I cherry-picked our "main" internal piqi fork with
experimental-erlang-defaults-0.5.7-dev-backport. So all our new projects
will use it, and the ones that will update piqi. Everyone in the company
are happy so far.
I also made some changes today which *depend* on that feature. So we are
dependent. Thanks again, it really allowed us to improve our data model.
> My plan is to release this version and officially announce it in the
> next week or two. In the meantime it is fully ready for user testing.
>
> It would be great if you guys could try it out and send your comments,
> bug reports and fixes :) With the new repository layout it should be
> so much easier to contribute.
Once we migrate from 0.5.7 to 0.6.2 to "tests pass" stage, I will send
feedback how it went.
How do you build piqi-binary repo? Do you have a script that
cross-compiles everything, or you do it by hand and collect binaries? I
am asking, because nobody will allow us to put a pre-compiled binary to
production which is not signed with an official CentOS or SL repository
key or was not built internally. And I am looking for ways for me to
make this process as close to upstream, and easy of course.
I know it might sound stupid, but I would appreciate if you could sign
the tags you create in piqi-binary repository:
git tag --sign v0.6.2
Not a big deal to do, but will avoid some unnecessary questions and will
give a bit higher degree of confidence to the binaries.
> > New build scenario: assume you want piqi-rpc. Piqi-rpc depends on
> > piqi-erlang. Piqi-erlang has rebar.config.script, which checks if
> > "which piqi" returns a path. If "which piqi" returns error, we add
> > "piqi" as a dependency of piqi-erlang, and the compilation stuff will
> > be done like now.
>
> I think this would be a very useful addition. Especially for platforms
> for which we don't have pre-built piqi binaries. Now that repositories
> are separated, I'd rather have users build and install "piqi"
> executable separately and not include piqi_src as a dependency and
> have it compiled during "rebar compile".
>
> I can merge it with no problem. My only suggestion would be to
> parameterize it using some environment variable instead of just
> relying on "piqi" executable accessibility.
This will have to wait until I find a machine in our environment on
which pre-built binaries do not work out of the box. Then I will have a
reason to pick up this task.
Regards,
Motiejus
[1]:
https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver