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

Do not compile hidden files #402

Closed
smarter opened this issue Aug 5, 2018 · 4 comments · Fixed by #423
Closed

Do not compile hidden files #402

smarter opened this issue Aug 5, 2018 · 4 comments · Fixed by #423
Labels
solved The issue was fixed/resolved
Milestone

Comments

@smarter
Copy link
Collaborator

smarter commented Aug 5, 2018

If a file starts with a ., it shouldn't be compiled, even if it ends with .scala. This matches the behavior of sbt and is pretty important for correctness since emacs likes to create backup files .#Foo.scala.

@vic
Copy link
Contributor

vic commented Aug 28, 2018

A workaround currently is to ignore the those temporary files by adding something like the following to your module:

  override def allSourceFiles = super.allSourceFiles().filter(!_.path.segments.last.startsWith("."))

@jkstrauss
Copy link
Collaborator

I would be willing to work on this for a permanent solution. Do we have a consensus that ignoring hidden files is a reasonable default?

@Ammonite-Bot
Copy link
Collaborator

Ammonite-Bot commented Aug 28, 2018 via email

@smarter
Copy link
Collaborator Author

smarter commented Aug 28, 2018

While you're at it, I think we should drop hidden files from assembly too: #383 (comment)

vic added a commit to vic/mill that referenced this issue Sep 1, 2018
Mill was trying to read all files found under the source directory to
create a digest for each of them. This was causing an error for broken
symlinks.

At first I believed temporary files should be ignored to avoid this problem,
and asked at the gitter channel how to go about this, but overriding the `sources`
task as [suggested](https://gitter.im/lihaoyi/mill?at=5ad6cd801130fe3d36eb7655)
by @lihaoyi didn't actually help.

on a simple scala project, editing a file with Emacs, creates a link file, like:

```
vic@oeiuwq ~/h/foo> ls -la foo/src/
total 8
drwxr-xr-x  4 vic  staff  128 Sep  1 12:23 .
lrwxr-xr-x  1 vic  staff   22 Sep  1 12:23 .#hello.scala -> [email protected]
drwxr-xr-x  3 vic  staff   96 Sep  1 12:22 ..
-rw-r--r--  1 vic  staff   12 Sep  1 12:22 hello.scala
```

So this patch only makes sures that the files (or the symlink here) is actually
readable before trying to digest it.

Fixes com-lihaoyi#402
rockjam added a commit that referenced this issue Sep 3, 2018
rockjam added a commit that referenced this issue Sep 3, 2018
lihaoyi pushed a commit that referenced this issue Sep 5, 2018
Mill was trying to read all files found under the source directory to
create a digest for each of them. This was causing an error for broken
symlinks.

At first I believed temporary files should be ignored to avoid this problem,
and asked at the gitter channel how to go about this, but overriding the `sources`
task as [suggested](https://gitter.im/lihaoyi/mill?at=5ad6cd801130fe3d36eb7655)
by @lihaoyi didn't actually help.

on a simple scala project, editing a file with Emacs, creates a link file, like:

```
vic@oeiuwq ~/h/foo> ls -la foo/src/
total 8
drwxr-xr-x  4 vic  staff  128 Sep  1 12:23 .
lrwxr-xr-x  1 vic  staff   22 Sep  1 12:23 .#hello.scala -> [email protected]
drwxr-xr-x  3 vic  staff   96 Sep  1 12:22 ..
-rw-r--r--  1 vic  staff   12 Sep  1 12:22 hello.scala
```

So this patch only makes sures that the files (or the symlink here) is actually
readable before trying to digest it.

Fixes #402
@lefou lefou added this to the 0.2.8 milestone May 8, 2019
@lefou lefou added the solved The issue was fixed/resolved label Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue was fixed/resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants