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

Repl command shouldn't eval ~/.ammonite/predef.sc #301

Closed
narma opened this issue Apr 17, 2018 · 6 comments
Closed

Repl command shouldn't eval ~/.ammonite/predef.sc #301

narma opened this issue Apr 17, 2018 · 6 comments

Comments

@narma
Copy link
Contributor

narma commented Apr 17, 2018

My ~/.ammonite/predef.sc is project independent file which contains imports of libraries for common daily use and it contain conflict libraries and/or versions with project libraries/versions use.

Probably this behaviour should be configurable at least.

UPD: I should clarify that ammonite's predef.sc is used when I execute mill -i module.repl. In my scenario this is not preferred behavior. I don't want global ammonite's predef in my project's REPL.

@Baccata
Copy link
Contributor

Baccata commented Apr 19, 2018

@narma it should not be the case. Mill has it's own home : ~/.mill/ammonite which it will evaluate predef.sc or predefScript.sc from.

Can you give a more thorough description of what you're witnessing ? (ie, minimum build file to reproduce the problem / version of mill you're using / os / commands you run )

@rockjam
Copy link
Contributor

rockjam commented Apr 19, 2018

Should be fine in 0.2.0. @narma may we close it?

@narma
Copy link
Contributor Author

narma commented Apr 25, 2018

@Baccata I should clarify that ammonite's predef.sc is used when I execute mill -i module.repl. In my scenario this is not preferred behavior. I don't want global ammonite's predef in my project's REPL.

@Baccata
Copy link
Contributor

Baccata commented Apr 25, 2018

I'm not a maintainer, but I know the codebase a bit and maybe I could have helped. As @rockjam (who is a maintainer) says, this should be fixed in version >= 0.2.0. Which version are you running ?

@rockjam
Copy link
Contributor

rockjam commented Apr 25, 2018

@Baccata we were actually talking about two different things.
First I thought that the issue is that predef of ammonite is used when you run mill itself, but it turns out that it happens only in repl command. This may for instance lead to a situation when there are conflicting versions of libraries in the classpath - one from your project's classpath and another from ammonite's predef

@lihaoyi
Copy link
Member

lihaoyi commented Apr 25, 2018

I think I'm going to call this a wontfix; Mill's Ammonite using ~/.ammonite/predef.sc behaves the same as using Ammonite from SBT. If you wish to override the default, you can do so by overrideing def repl and passing in the --predef foo.sc flag to point your predef at whatever file you wish

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

No branches or pull requests

4 participants