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

report clj build failures to stderr #135

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

bendlas
Copy link
Contributor

@bendlas bendlas commented Sep 9, 2024

The default behavior of clojure to write error reports into /tmp/clojure-*.edn doesn't really work well in a nix builder: After the build concludes, the edn file is deleted, or rather, it never hit the disk because in the build sandbox, a fresh tmpfs is mounted on /tmp.

So it's better, to restore the old behavior and let clojure barf to stderr. Nix will keep it available via nix log.

Before

😨 😢

       > Full report at:
       > /tmp/clojure-17334729123361555966.edn
       For full logs, run 'nix log /nix/store/2xzw9b0jmlhwzwidqzgw6mcllqhn4i5d-directory-DEV.drv'.

After

👍 😁

       > Execution error (NullPointerException) at rewrite-clj.custom-zipper.core/node (core.cljc:55).
       > Cannot invoke "clojure.lang.IFn.invoke(Object)" because "loc" is null
       >
       For full logs, run 'nix log /nix/store/qfigggf1jd6396zp5bjwiphnjwk1wlvz-directory-DEV.drv'.

@jlesquembre
Copy link
Owner

Thanks! It was annoying me too.

BTW, are you having issues with rewrite-clj? clj-nix expands all :git/sha hashes to avoid network requests, it seems like the error is originating from there.

@jlesquembre jlesquembre merged commit 9f3decd into jlesquembre:main Sep 9, 2024
1 check passed
@bendlas
Copy link
Contributor Author

bendlas commented Sep 9, 2024

BTW, are you having issues with rewrite-clj?

Nah, all good. For testing the error reporting, I put some random characters before the (ns) clause, which happens to trip cljnix.builder_cli$check_main_class in rewrite-clj, where it attempts to parse the (ns) clause ...

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

Successfully merging this pull request may close these issues.

2 participants