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

Embeds a modified copy of libyaml #51

Open
glondu opened this issue Dec 20, 2021 · 7 comments
Open

Embeds a modified copy of libyaml #51

glondu opened this issue Dec 20, 2021 · 7 comments

Comments

@glondu
Copy link

glondu commented Dec 20, 2021

While packaging ocaml-yaml for Debian (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001893), I've realized that it embeds a modified copy of libyaml. This is bad, for many reasons including following new versions, and security updates.

The changes look simple and uncontroversial, so I've made a pull request to libyaml: yaml/libyaml#235

I am opening this issue to inform ocaml-yaml authors of this process, and track the effort of making ocaml-yaml buildable with pristine libyaml.

@avsm
Copy link
Owner

avsm commented Feb 4, 2022

I really appreciate you taking the time to submit this upstream. Debian packaging wins again, thanks @glondu :-)

@toots
Copy link

toots commented Jan 25, 2023

+1 here as vendored libyaml also won't compile in a cross-compilation environment: https://github.com/ocaml-cross/opam-cross-windows/actions/runs/4009102050/jobs/6884062479

It might be possible to fix it but, frankly, the module should be able to bind (w/o libffi!) on a local libyaml.

Thanks for the hard work nonetheless!

@rwmjones
Copy link

FYI we also came across this problem when packaging ocaml-yaml and we're unbundling it here:

https://bugzilla.redhat.com/show_bug.cgi?id=2217729

Basically we patch the system yaml.h with the same changes, delete vendor/*.c, and then modify the dune files so that it links everything with -lyaml.

A better solution would be for ocaml-yaml to detect the system libyaml and use it (once the changes above have gone into libyaml).

@avsm
Copy link
Owner

avsm commented Nov 4, 2023

Before doing anything about this, I'm generally worried about the state of libyaml upstream maintenance, and several heap overflows reported upstream. Should we just be focussing on a pure OCaml implementation instead of trying to track libyaml?

@rwmjones
Copy link

rwmjones commented Nov 4, 2023

I believe this is a case where a native OCaml version could well be better. (A bit surprised there's not one already ...) I'm sure you're aware that yaml is a minefield of a format so good luck!

@glondu
Copy link
Author

glondu commented Nov 6, 2023

I agree with your worries about libyaml upstream maintenance, and that a pure OCaml implementation would be useful.

@glondu
Copy link
Author

glondu commented Dec 15, 2023

Maybe a pure OCaml implementation could be done with https://github.com/yaml/yaml-reference-parser

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

No branches or pull requests

4 participants