Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Mention hlint data file handling in readme #1573

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

jneira
Copy link
Member

@jneira jneira commented Jan 14, 2020

Closes #872

@jneira jneira changed the title Mention hlint data file handling Mention hlint data file handling in readme Jan 14, 2020
@Anrock
Copy link
Collaborator

Anrock commented Jan 14, 2020

As end-user: "Okay, hie must locate hlint file and will search at that path as a last resort. Where it will search in the first place?"

@jneira
Copy link
Member Author

jneira commented Jan 14, 2020

Uh, yeah, hlint has it own logic: afaik cwd (and parent directories) -> hlint_datadir(cabal/stack specific) env var -> $HOME (not sure about that one) -> executable current dir (the mentioned one)
Not sure about the order (but the last one) but it is hlint specific and i've dont find a link in hlint docs to point to.
Do you think that should be reflected (i had to previously read the code/test)?
My idea was: if the hlint.yaml file is not found (wherever it could be) you can put it wehre the hie executable is.

@Avi-D-coder
Copy link
Collaborator

I still have considerable doubts about this. It does not conform to standard UNIX packaging.
We can't place hie in /usr/bin since it would require making /usr/bin/data/hlint.yaml.
The file-embed approach is far better.

@jneira
Copy link
Member Author

jneira commented Jan 14, 2020

Jumm i've checked where my installation is searching for the file:

  • It looks in the dir pointed by $HLINT_DATADIR or the default one assigned by cabal/stack (inside cabal store or .stack_root)
  • If that directory nos exists it looks for it in the data subdir in the dir where the executable is.
  • At least using hlint as a library, it seems it doenst search in cwd or in $HOME.

@Avi-D-coder each option has it own caveats and we decided finally to handle it like hlint itself, at least for now, without change any hie or hlint code. But i am open to talk about the file embed option, specially if it is done in hlint itself: maybe could we open an issue/pr in hlint to get feedback about?

or we can also reopen #1143 before that

@Avi-D-coder
Copy link
Collaborator

@jneira $HLINT_DATADIR is a runtime env right? A runtime env cannot be configured by most Linux package managers. Over riding at compile is also broken ndmitchell/hlint#699

@jneira
Copy link
Member Author

jneira commented Jan 14, 2020

Oh, didnt know, i've just tested to set the env var manually in my windows machine and it worked for me.
So i think it is worth to document how hie works right now but i will reopen the mentioned issue to discuss the file embed alternative.

@Avi-D-coder
Copy link
Collaborator

I sent in a file-embed PR ndmitchell/hlint#824

@jneira
Copy link
Member Author

jneira commented Jan 14, 2020

@Anrock i've tested the different locations where the file is searched and i've added them

@jneira jneira merged commit 3b38880 into haskell:master Jan 15, 2020
@jneira jneira deleted the hlint-data-docs branch January 15, 2020 05:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to find requested hint files only on lts-12.*
3 participants