Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clash with alex in haskell #83

Closed
AbdealiLoKo opened this issue Feb 21, 2016 · 17 comments
Closed

Clash with alex in haskell #83

AbdealiLoKo opened this issue Feb 21, 2016 · 17 comments

Comments

@AbdealiLoKo
Copy link

We were adding haskell linter support for coala (https://github.com/coala-analyzer/coala) and found that there was a clash with another package named alex in ghc (haskell).
It seems we need alex from haskell as a dependency for our build - and this clash is a little annoying, as we can only use one of these packages at a time.

Is it possible to make an alias of your alex to alex.js or alexjs ? So that we can simply run alexjs to run your package and alex for the other ?
I'm sure it'd help with https://github.com/wooorm/alex/issues/58 too as CIs (Travis and circleci) seem to have this haskell's alex installed already.

@sils
Copy link

sils commented Feb 21, 2016

FWIW we actually do want to use your alex and the alex haskell lexer in our CI.

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

I’m not sure why it’s the task of this alex to name itself differently? (side note: the name alexjs is only used in the domain, nowhere else, I dislike it 😉)

Sure, it’s possible to add another link, but I feel it’s like feature creep.

I think I’ve suggested this before to Coala: instead of using npm install -g, install without the -g flag and use the correct version.
npm uses -g for commands installed by the user; if it’s a dependency it’s best to version it with the host package (coala).

If you’re using npm install alex remark, that means you can use ./node_modules/.bin/remark and ./node_modules/.bin/alex and be sure it’s the correct remark or alex, respectively.
Which seams pretty good?

@sils
Copy link

sils commented Feb 22, 2016

The usecase is that we actually want to use both alex binaries in one run. So global installation or not, if we modify the path we can still only use one of them, right?

@sils
Copy link

sils commented Feb 22, 2016

(FWIW we're using the non global installation of alex by now :))

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

Yeah, I understand, either adding a new (symlinked) binary or my proposed solution would work for that, but my suggestion would have nice benefits (like better version control, so if a new version of remark or Alex is published it won't affect coala.)

@sils
Copy link

sils commented Feb 22, 2016

Ah you mean specifying the whole path to alex without using PATH at all. Sorry, didn't get that. It's not feasible for users though... they'd have to give the path to alex which is system dependent.

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

Yes, no $PATH, just a local reference to ./node_modules/.bin/alex.

Why would users have to specify that location? You can specify it directly in your code, and there’s no differences between systems (other than / or \).

@sils
Copy link

sils commented Feb 22, 2016

@AbdealiJK that's a feasible solution, similar to how we do it with checkstyle.

@wooorm sorry for being so stubborn and stupid. :P

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

@sils1297 Wait, what is @AbdealiJK’s solution?

Does this mean this I can close this?

@sils
Copy link

sils commented Feb 22, 2016

Yeah I think considering your opinions you should close this.

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

OK, great! Please let me know if I can help in any other way 👍

@wooorm wooorm closed this as completed Feb 22, 2016
@sils
Copy link

sils commented Feb 22, 2016

We will, you know us :)

2016-02-22 22:42 GMT+01:00 Titus Wormer notifications@github.com:

Closed #83 #83.


Reply to this email directly or view it on GitHub
#83 (comment).

@wooorm
Copy link
Member

wooorm commented Feb 22, 2016

Haha 👌

@AbdealiLoKo
Copy link
Author

But if we specify ./node_modules/.bin/alex in the code, it wouldn't work is alex is globally installed.

Nor would it work if the user runs coala from a directory other than the root of the place they did npm install :(
i.e. --find-config wouldn't be able to run AlexBear => The editor plugins will not be able to use alex at all.

@wooorm
Copy link
Member

wooorm commented Feb 23, 2016

I just now saw that users have to manually install the npm dependencies.
I was under the impression coala installed those into its own directory, any reason why that’s not the case? If it would, that means every user can run those linters without having to manually install them!

@AbdealiLoKo
Copy link
Author

@wooorm At the moment we do not do that - we may support it later. There are issues that arise when doing something like that, and it's generally better to use existing libraries in my opinion.
Doing something like that feels like windows - where you have to package your own version of any library and it sits inside your own Program Files folder (I'm not a fan of it).

Either way (removing coala out of the equation) - I still think you should consider making a alexjs just for the reason that circleci already has an alex in their path for haskell. And adding both these alex's into a CI would be tough. In general, package name clashes are bad and causes confusion (I remember when nodejs came out).

@wooorm
Copy link
Member

wooorm commented Feb 24, 2016

@AbdealiJK I think it's more awkward for users to have to install 6+ packages when they want to use coala, whereas with the by me proposed solution, they would Install coala and be done with it.

This problem isn't just alex, or remark, it will arise more and more if there are other 'bears' added.
Note that in the case of node, they didn't change the name of node project.
CircleCI: one can specify a path to a binary.

I'm not going to rename remark or alex: I cannot control if some other package is created in the future, pics one of these names (or if I do that, by accident), and becomes popular.
Sure, I don't name thing 'ls' but Alex and remark are perfectly reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants