-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
babashka: use upstream version of Clojure tools #257473
babashka: use upstream version of Clojure tools #257473
Conversation
We don't want to vendor things. We should rather use an appropriate closure tools version from nixpkgs or add an override. Also can we add a short test to know if things break on updates? Than we would be confident that things work even if we don't match the upstream version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to try to use the recommended version, but in that case, we should add an script to automate the updates and keep the version in sync.
With the current approach, next time babashka updates clojure tools, the build will break.
@SuperSandro2000 Makes sense! I'll switch it over to using the
I think the best we can do is detect whether we need to update the tracked version on our end. Testing whether it works with a non-matching version seems intractable as the surface area of clojure tools is quite large and fully exposed via |
@jlesquembre Good call, that's a better approach overall. I'll rework the patch accordingly (might take a few days, tho). |
@DerGuteMoritz thanks for working on it :) |
@jlesquembre OK got back to it earlier than expected 😄 Check it out! Note that Hope the changes make sense and be sure to squash before merge (not sure if GH automatically squashes fixup commits?) |
58826d4
to
bf6210c
Compare
Forgot to mention that the |
Thanks @DerGuteMoritz , looks good. Before approving, just some minor suggestions:
@SuperSandro2000 Could you confirm if that is what you had in mind about using an override? To me it looks good, but I want to confirm it. |
Hi @jlesquembre, thanks for your feedback which I have now addressed as follows:
TIL & done!
I went to rename it to Instead of adding comments to
Done that, too! However, there's more:
Anyway, hope this all makes sense. I'm afraid another careful review is necessary now, though 🙏 |
bf6210c
to
cf573b6
Compare
Will now terminate e.g. when curl gets a 404 response. See NixOS#257473 (comment) for more backgroud on the shell code changes.
@DerGuteMoritz thanks, just 2 things I noticed:
Thanks again, I'll review it in more details in the upcoming days UPDATE:
I really like the idea 👍 |
I think you answered the question yourself in the next item:
i.e. the reason is so that I can do that 🙂 Or is there a nicer way? As for rewriting the whole script in babashka: I'll give it a shot once this PR has landed. Was a deep enough rabbit hole as it is already and I'm sure that this would be an even deeper dig 😄 |
@DerGuteMoritz I did another test, a looks good, thanks :) Regarding the Regarding rewriting the script in babashaka, I agree, better to do it on another PR. I want to mention that I have plans to work on some helpers to make easier to integrate babashka in nix derivations. Something similar to https://github.com/DeterminateSystems/nuenv but with babashka, I'd like to write complex derivations with Nix + Babahska, without any bash. Probably I'll start with it on https://github.com/jlesquembre/clj-nix, but if it's successful, I'd like to upstream it to nixpkgs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds are failing in darwin.
Cool, sounds good! OK then, let's keep it as it is for now.
👍
That would be excellent. Ping me when you have something to try out, then I can give the conversion of the babashka package a go and hopefully provide you with some feedback 🙂 |
cf573b6
to
f2590aa
Compare
@@ -13,6 +13,7 @@ | |||
, nativeImageBuildArgs ? [ | |||
(lib.optionalString stdenv.isDarwin "-H:-CheckToolchain") | |||
"-H:Name=${executable}" | |||
"-march=compatiblity" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"-march=compatiblity" | |
"-march=compatibility" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah damn, I copied & pasted it from #257473 (comment) and didn't notice the typo! How did you? The tests didn't fail after all 🤔 Anyway, fixed now. Also rebased the branch once more for good measure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, I think you didn't realize that we run the builds in our CI.
If you look into the checks, you will eventually see (after ofborg-eval
check finishes) something like:
babashka, babashka.passthru.tests on x86_64-linux
You can click in Details
to see the build, and if you click you also go to the OfBorg Viewer interface to see more details. Example of the build with the typo:
https://logs.ofborg.org/?key=nixos/nixpkgs.257473&attempt_id=f7c7e3ce-6661-4411-ac5b-d37870f402e1
We run checks for 4 platforms: aarch64-linux
, x86_64-linux
, aarch64-darwin
and x86_64-linux
. So even if you don't have a macOS, you can see the build failures directly in the CI (it will take a while though, because the macOS CI is way slower than Linux CI).
In case it doesn't trigger the build step automatically (we extract which package to build from the commit messages, this is one of the reasons that commit messages are important BTW), you can trigger it manually by running @ofborg build <package>
.
See more documentation about OfBorg here: https://github.com/NixOS/ofborg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info, much appreciated 🙏 I roughly knew that that's happening but since the overall checks status was "success", I didn't bother to check. Looks like these test jobs are configured to be allowed to fail? But it still makes sense to check them when they do I guess! makes mental note
Anyway, hope we're good to go now finally 💦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these test jobs are configured to be allowed to fail? But it still makes sense to check them when they do I guess! makes mental note
Yes, we allow the checks to fail because some packages are expect to fail (e.g.: maybe the package is broken in macOS, but works in Linux). Also some packages are broken in master
branch for some reason, and we shouldn't break builds just because a package is updated (but still broken).
As recommended by @borkdude[1], we should use the Clojure tools version included in a particular upstream release since the code might not always work with more recent versions. [1] borkdude/deps.clj#113 (comment)
This is necessary for compatibility with all targets supported by nixpkgs.
6a4a9f9
to
7db4774
Compare
Thanks @DerGuteMoritz and @thiagokokada . This PR took long, but I'm happy with the outcome, we fixed a couple of issues, including a fix to upstream Babahska 🎉 |
And thank you, too @jlesquembre! I learned a lot from this whole experience 😄 BTW is |
@DerGuteMoritz the As far as I know, it's executed in a best-effort basis, meaning that sometimes you have to wait longer. As far as I remember, usually updates packages 2-3 days after a release, but sometimes I had to wait for a week, or even a bit longer. |
Description of changes
As recommended by @borkdude[1], we should use the Clojure tools version included in a particular upstream release since the code might not always work with more recent versions.
[1] borkdude/deps.clj#113 (comment)
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)This change is