buildLisp: Make style-warnings fail the build

Opened by grfn at 2021-04-04T14·49+00

see eg, 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.

  1. 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)
                     ;; 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 calling compile-lisp, but rather when load-ing the compiled fasl files.

    sterni at 2021-04-04T15·42+00

  2. yeah, the style-warning was specifically coming from sly, so that wouldn't surprise me

    grfn at 2021-04-04T15·43+00