-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cannot build MeiliSearch v0.19.0 as NixOS package #1273
Comments
Hello @Michcioperz! Thanks for this report! |
I see the label that the issue will be fixed with the next release. I'm keen to test this when the new release comes. |
Hello @happysalada! |
Yes that's what I understood. When you think it can be tested, just let me know and I'll give it a try. |
Thanks @happysalada! :) |
The invitation to the Pest Discord in the issue about the Pest working group has expired, so I can't see if there have been any updates on the Pest situation. But I just realized this could be worked around a bit differently Michcioperz@68e4a52 Instead of only changing the version of I tried running a build now locally to see if it solves my issue, but I ran out of disk space at the very end, so I'm gonna try again on a different machine in the morning (it's pretty late now and I don't wanna wake my neighbours up with a rack server, haha). At the very least, vendoring runs successfully with this patch, and the build process continues. |
Adding this patch to the build expression from Nixpkgs and bumping the version to v0.20.0 gives me a working build of meilisearch at the cost of having no less than 4 GBs (probably more) of intermediate build files in /tmp (so technically earlier I ran out of tmpfs space, not actual disk). @Br1ght0ne It appears that you are the maintainer of the Nix package of Meilisearch. Do you think it would be a good idea to put my solution there? (If yes and if you want to take it, feel free to.) |
I was checking the commit referenced on the pest dependency, it's from september 2020. Perhaps the dependency can just be updated to the latest version (2.1.3 which is from March 2021). Do you think the update could be made as a PR to this repo? my understanding here is that it would be a PR to update the version of one dependency. Let me know if I misinterpreted. |
@Michcioperz @happysalada, this is still on my TODO. I have joined the pest group, but hadn't much time to work on it since then. We need to make a new pest release, but there are still some issue we want to merge before we are able to do it. Sorry for it taking so long :( |
@happysalada I don't know if it is a good practice to use the patching functionality in Cargo to replace packages like this, but perhaps this isn't something that can be quickly mitigated with good practices either. So maybe it would actually be viable to merge my patch to Meili for the time being? I understand your concern about adding the patch to Nixpkgs. Regarding 2.1.3, it's from March 2020 unfortunately, not 2021, which is why it's not good enough |
@Michcioperz thanks for clarifying the date, I completely missed that. @MarinPostma no worries at all. Thank you in the first place for making an amazing software! ;-) |
@happysalada According to my understanding, MS has used a modified version of Pest starting in 0.10.0, as seen in commit dcf1096 and by my intuition, that version of Pest also causes the same problem. If you need a more up-to-date version of MS on Nix, my recommendation for now would be to export my commit to a patch file, copy the upstream build expression to an overlay, add something like |
Or an alternative would be to upstream my patch to MeiliSearch, to change the method of inserting the custom version of Pest. I think it should be functionally equivalent, and might even make the build process very slightly faster (because now the original pest 2.1.3 is also built as a dependency of pest_derive, and with my patch pest 2.1.3 is completely replaced by the custom pest) |
I was checking pest upstream as well and they were organising for a new release. |
I've just made a PR to try to integrate the fix you proposed #1659 |
1659: deps: unify pest dependency r=MarinPostma a=happysalada meilisearch dependends on two different versions of pest. This can be problematic for some build systems (e.g. NixOS). Since the repo hasn't received an update in a while, in the meantime, use the later version of the two pest dependencies. Context: this has been discussed previously #1273 meilisearch has been selected by ngi to be packaged for nixos. A patch can be applied to make the changes proposed in this PR. This PR intends to see how the maintainers of meilisearch would feel about the patch. What was done. - Add an override for the pest dependency in Cargo.toml. - recreate the Cargo.lock with `cargo update`. This has had the side effect of updating some dependencies. I ran the tests on darwin. My machine is quite old so I had 8 failures due to a timeout. None of the failures look like they are due to the new dependencies. Checking the pest repo, it seems there are some recent commits, however no sure date of when there could be a new release. If this gets accepted, there is no need to do a new release, nixos can just target the new commit. If you feel it's too much pain for not enough gain, no worries at all! Co-authored-by: happysalada <raphael@megzari.com>
1659: deps: unify pest dependency r=curquiza a=happysalada meilisearch dependends on two different versions of pest. This can be problematic for some build systems (e.g. NixOS). Since the repo hasn't received an update in a while, in the meantime, use the later version of the two pest dependencies. Context: this has been discussed previously #1273 meilisearch has been selected by ngi to be packaged for nixos. A patch can be applied to make the changes proposed in this PR. This PR intends to see how the maintainers of meilisearch would feel about the patch. What was done. - Add an override for the pest dependency in Cargo.toml. - recreate the Cargo.lock with `cargo update`. This has had the side effect of updating some dependencies. I ran the tests on darwin. My machine is quite old so I had 8 failures due to a timeout. None of the failures look like they are due to the new dependencies. Checking the pest repo, it seems there are some recent commits, however no sure date of when there could be a new release. If this gets accepted, there is no need to do a new release, nixos can just target the new commit. If you feel it's too much pain for not enough gain, no worries at all! Co-authored-by: happysalada <raphael@megzari.com>
1659: deps: unify pest dependency r=MarinPostma a=happysalada meilisearch dependends on two different versions of pest. This can be problematic for some build systems (e.g. NixOS). Since the repo hasn't received an update in a while, in the meantime, use the later version of the two pest dependencies. Context: this has been discussed previously #1273 meilisearch has been selected by ngi to be packaged for nixos. A patch can be applied to make the changes proposed in this PR. This PR intends to see how the maintainers of meilisearch would feel about the patch. What was done. - Add an override for the pest dependency in Cargo.toml. - recreate the Cargo.lock with `cargo update`. This has had the side effect of updating some dependencies. I ran the tests on darwin. My machine is quite old so I had 8 failures due to a timeout. None of the failures look like they are due to the new dependencies. Checking the pest repo, it seems there are some recent commits, however no sure date of when there could be a new release. If this gets accepted, there is no need to do a new release, nixos can just target the new commit. If you feel it's too much pain for not enough gain, no worries at all! Co-authored-by: happysalada <raphael@megzari.com>
meilisearch has been integrated into nixpkgs, and after the proposed fixes have been merged to meilisearch, I've reverted the build system to a more traditional one. (see PR that also updates to 0.23.1) I think we can safely close this issue. |
Hello @happysalada! Thank you so much for this update ❤️ |
I don't know if that can help you @happysalada but in the next release we are going to remove |
That PR is nice! Yeah nom makes much more sense! |
Describe the bug
I tried to use MeiliSearch on my NixOS server today, but noticed the official repos only have v0.9, so I tried to update it.
I took the build script from the official repository and upped the version and fixed the hash of the source code.
The build process stops with an error as seen below.
To Reproduce
Steps to reproduce the behavior:
nix-build meilisearch.nix
(the filename you saved to)Expected behavior
The vendoring process should finish and Nix should complain that the hash of the vendor directory is different from what I told it to expect.
Desktop:
Additional context
NixOS is really into reproducible builds and pinning hashes of all things that are downloaded, so the first part of the process of building a package of something in Rust is vendoring the dependencies and checking that the hash of vendor directory matches what was given in the build script.
Vendoring doesn't complete successfully, because there are two colliding definitions of pest 2.1.3 package: a crates.io version depended on by pest_derive and a few other pest_* crates, and a git version depended on by meilisearch directly.
If I understand correctly the problem would go away if pest had a new release on crates.io so you wouldn't have to use a git version, but its maintainer is busy as seen in pest-parser/pest#491 and pest-parser/pest#454
The text was updated successfully, but these errors were encountered: