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

ammnoite & mill.repl conflicts #1012

Closed
yelled1 opened this issue Nov 26, 2020 · 1 comment
Closed

ammnoite & mill.repl conflicts #1012

yelled1 opened this issue Nov 26, 2020 · 1 comment
Milestone

Comments

@yelled1
Copy link

yelled1 commented Nov 26, 2020

When I create a mill project & move the directory I get the following problem, where mill.repl does not know where to look for the spark_hlper.scala file that I have put in the cor_poc/src/ directory

Welcome to the Ammonite Repl 2.2.0 (Scala 2.12.10 Java 1.8.0_275)
@ import spark_hlper.{get_spark, localz, foldr_loc_s3, column_exploded}
cmd0.sc:1: not found: value spark_hlper
import spark_hlper.{get_spark, localz, foldr_loc_s3, column_exploded}
       ^
Compilation Failed

keep getting this error after I moved the directory of the base project. When I git clone into /tmp, it works fine & mill -i coc_poc.console works. I tried cleaning out the ivy2, .cousier, ~/.mill/ammonite/cache, & even changed the git repo name. But not sure what to wipe out.
Oh, also rebooted my machine. WSL2 windows 10. I am working inside WSL2 only Linux DESKTOP-3DKM78D 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
As per advice:

Tobias Roeser @lefou Nov 25 01:46
What's your complete working path? Any strange characters in it?

S H Yoon @yelled1 Nov 25 05:41
@lefou working path is /home/syoon/Prj/mill_spark No nothing strange. When I clone into /tmp by git clone. I do not have a problem. The funny thing is mill -i coc.console works w/o problem.

$ mill -i cor_poc.console
[30/30] cor_poc.console
Welcome to Scala 2.12.10 (OpenJDK 64-Bit Server VM, Java 1.8.0_275).
Type in expressions for evaluation. Or try :help.

scala> import spark_hlper.{get_spark, localz, foldr_loc_s3, column_exploded}
import spark_hlper.{get_spark, localz, foldr_loc_s3, column_exploded}

This must be an ammonite cache issue. So, I wiped & recreate everything within that directory /home/syoon/Prj/mill_spark by git clone still the problem persists. Also did a complete reboot of the Windows machine too.
So, I'm concerned that I might hit mysterious serious problems with the repl & can't deal w/ it later.

Tobias Roeser @lefou Nov 25 05:42
Try to remove the out folder
Or better rename, for later analysis

S H Yoon @yelled1 Nov 25 05:46
Actually tried that too . Here's content of git. So, out is not even in there.
Arch
cor_poc
    ls cor_poc/src/
    emr_cust_consumr.scala  ln_ed_scala_files.txt  spark_hlper.scala
foo
project
test/src
-  .gitignore
-  .mill-version
-  .scalafmt.conf
-  build.sc

S H Yoon @yelled1 Nov 25 06:23
rm -rf /tmp/*
rm -rf ~/.cache/*
rm -rf ~/.mill/ammonite/cache
$ ls -l  ~/.cache/
total 0
$ rm -rf ~/Prj/mill_spark/
$ ls  ~/Prj/mill_spark/
ls: cannot access '/home/syoon/Prj/mill_spark/': No such file or directory

As per the above advice, I attempted to remove all potential caches.

$ cat .mill/ammonite/history
[
    "import org.apache.spark.sql.types._",
    "import org.apache.spark.sql.{functions => f}",
    "import org.apache.spark.sql.types._",
    "import org.apache.spark.sql.types._",
    "import org.apache.spark.sql.types._",
    "import org.apache.spark.sql.types._ "
]
$cat .ammonite/history
[
    "import org.apache.spark.sql.types.{StructType, StructField}",
    "import spark_hlper.{get_spark, localz, foldr_loc_s3, column_exploded}"
]

I would expect the last line with spark_hlper to be under ~/.mill/ammonite/history NOT ~/.ammonite/history. I had ammonite installed but now it's gone. So, I nuked ~/.ammonite directory, but it just came back again once I ran the coc_poc.repl command.
Lastly, I uninstalled the Ammonite shell & rebooted the machine. rm /usr/bin/amm
Still same problem & ~/.ammonite directory is back.

~/.ammonite$ tree
.
├── cache
│   └── 2.3.8
│       ├── compile
│       │   └── ammonite
│       │       └── $file
│       │           └── build
│       │               └── 2c6eb5b9f31b04a3312b02e8876dd1aa
│       │                   └── 4455be01c080c113ba473b4b97260bb2
│       │                       └── 835491922
│       │                           ├── ammonite.$file.build$.class
│       │                           ├── ammonite.$file.build$cor_poc$.class
│       │                           ├── ammonite.$file.build$cor_poc$test$.class
│       │                           ├── ammonite.$file.build.class
│       │                           └── metadata.json
│       └── scriptCaches
│           └── ammonite
│               └── $file
│                   └── build
│                       └── a3205389b5b49142ef5f9d738de25d52
│                           └── d41d8cd98f00b204e9800998ecf8427e
│                               └── 835491922
│                                   └── classFilesOrder.json
└── history
@lefou
Copy link
Member

lefou commented Jun 11, 2021

The issue with mill using ~/.ammonite instead of ~/.mill/ammonite was now identified and fixed in PR #1334. The first release containing this fix is mill 0.9.8.

@lefou lefou closed this as completed Jun 11, 2021
@lefou lefou added this to the after 0.9.8 milestone Jun 11, 2021
@lefou lefou modified the milestones: 0.9.9, after 0.9.9 (0.10) Jul 15, 2021
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

2 participants