buildLisp: Make style-warnings fail the build
see eg https://cl.tvl.fyi/c/depot/+/2845, where we had a style-warning indicating that something would fail at runtime that should have failed the build but didn't.
eta seems to think this could be done by wrapping the build script in a handler-case that handles the style-warning condition and causes it to exit with a failure code.
I've tried to fix this with the following patch, but it doesn't seem to resolve the issue for some reason:
diff --git a/nix/buildLisp/default.nix b/nix/buildLisp/default.nix index fe43c895f..b502494a5 100644 --- a/nix/buildLisp/default.nix +++ b/nix/buildLisp/default.nix @@ -33,9 +33,9 @@ let :directory (or (sb-posix:getenv "NIX_BUILD_TOP") (error "not running in a Nix build")) :name (substitute #\- #\/ srcfile)))) - (multiple-value-bind (_outfile _warnings-p failure-p) + (multiple-value-bind (_outfile warnings-p _failure-p) (compile-file srcfile :output-file outfile) - (if failure-p (sb-posix:exit 1) + (if warnings-p (sb-posix:exit 1) (progn ;; For the case of multiple files belonging to the same ;; library being compiled, load them in order:
I've however also never seen the
STYLE-WARNING
grfn mentioned although I do remember running into similar issues. My best guess it that the STYLE-WARNING doesn't occur when callingcompile-lisp
, but rather whenload
-ing the compiled fasl files.sterni at 2021-04-04T15·42+00
yeah, the style-warning was specifically coming from sly, so that wouldn't surprise me
aspen at 2021-04-04T15·43+00