fendor / hsimport

Extend the import list of a Haskell source file
Other
38 stars 10 forks source link

Odd behavior with errors.log #14

Closed hasufell closed 4 years ago

hasufell commented 6 years ago
hasufell@localhost ~ $ echo "gaga" > ~/.cache/hsimport/errors.log && hsimport --help
hsimport: gaga

I got an error and then every subsequent call to hsimport just cats that error forever. What?

dan-t commented 6 years ago

Do you have a hsimport configuration file (~/.config/hsimport/hsimport.hs)?

hasufell@localhost ~ $ echo "gaga" > ~/.cache/hsimport/errors.log && hsimport --help hsimport: gaga

Why on earth would you do something like this?

hsimport uses dyre for a Haskell configuration file and dyre most likely just outputs the content of errors.log.

hasufell commented 6 years ago

Do you have a hsimport configuration file (~/.config/hsimport/hsimport.hs)?

I had, then hsimport threw a ton of build errors, because the public API is broken again. Then I removed my config, but hsimport didn't stop printing the errors as if it was still recent. I don't think that is expected behavior in any way.

dan-t commented 6 years ago

Then I removed my config, but hsimport didn't stop printing tht errors as if it was still recent. I don't think that is expected behavior in any way.

Then this is an issue for the dyre library and not hsimport. I'm not creating this error file nor caring in any away about it.

hasufell commented 6 years ago

I don't know if that is true or if it's because of the way you use the library. I cannot tell and I don't really care either, because I don't use dyre, but hsimport and this issue just shows in hsimport, nowhere else.

dan-t commented 6 years ago

I think you misunderstood what I meant by caring. I don't know anything about this error file and dyre doesn't tell me anything about it, but I just get the error as string from dyre and outputting it.

hsimport can't decide at this point if this is a valid error or not. It's seems to be the job of dyre to clean up the error file after a configuration file has been removed.

hsimport could now try to delete this error file by itself, but this doesn't seem to be the right way and might easily break on changes of dyre.

I've opened an issue for dyre (https://github.com/willdonnelly/dyre/issues/35).