Ashlen <euryd...@riseup.net> writes:

> On 22/04/03 21:04, Stuart Henderson wrote:
>> [ dropping misc@ from CC list ]
>>
>> On 2022/04/03 11:25, Ashlen wrote:
>> > With the previous emails in mind, I have a diff for the build script in
>> > the ports tree if it would help. My xmonad.hs hardly changes these days.
>> > If the build script actually recompiled xmonad every time instead of
>> > quitting if xmonad.hs hasn't changed, I don't think this issue would
>> > come up in the future.
>>
>> How about comparing the date of /usr/local/bin/xmonad as well?
>> If libraries have changed such that a rebuild is needed, that binary
>> ought to have been updated too.
>>
>> if [ "${output_file}" -nt xmonad.hs -a "${output_file}" -nt 
>> /usr/local/bin/xmonad ]; then
>> ...
>>
>> Or is it fast enough anyway? I couldn't tell, there seem to be other 
>> problems:
>
>
> I didn't think to do that, but I bet that would probably work (and is a
> better solution than recompiling every time). Although I would tend to
> prefer this form:
>
>
> if [ "${output_file}" -nt xmonad.hs ] && [ "${output_file}" -nt 
> /usr/local/bin/xmonad ]; then
> ...
>
>
> I prefer that over the form mentioned as it avoids some potential
> ambiguity/maintenance issues in the long run. Here's a relevant entry
> from the shellcheck wiki on github.
>
> https://github.com/koalaman/shellcheck/wiki/SC2166

`build` runs when xmonad is launched by xdm and having it pause for
cabal+ghc rebuild every time isn't much fun. Even with xmonad.hs not
changing a ghc version upgrade (annual-ish) or `cabal update` would
trigger a lengthy rebuild.

Either of the proposed changes is OK gnezdo if somebody wants it in 7.1.
I tested the [] && [] version and intend to commit it after the ports
tree is unlocked.

Thanks
Greg

Reply via email to