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

Can't use BOOT_LOCAL_REPO on windows #243

Closed
schmir opened this issue Jul 8, 2015 · 0 comments · Fixed by #246
Closed

Can't use BOOT_LOCAL_REPO on windows #243

schmir opened this issue Jul 8, 2015 · 0 comments · Fixed by #246
Assignees

Comments

@schmir
Copy link
Contributor

schmir commented Jul 8, 2015

I have set the BOOT_LOCAL_REPO variable on windows. Running boot repl
now fails with a FileNotFoundException:

C:\Users\ralf\home>set BOOT_HOME
BOOT_HOME=C:\home\.boot

C:\Users\ralf\home>set BOOT_LOCAL_REPO
BOOT_LOCAL_REPO=C:\home\.m2\repository

C:\Users\ralf\home>boot repl
Exception in thread "main" java.io.FileNotFoundException: C:\home\.boot\cache\boot\customC:\home\.m2\repository\1.6.0\2.1.2\deps.cache (The filename, directory name, or volume label syntax is incorrect)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at boot.App.writeCache(App.java:123)
    at boot.App.readCache(App.java:137)
    at boot.App.main(App.java:316)

The problem is that boot tries to use the local repository path as a
part of another filename [1].

[1] https://github.com/boot-clj/boot/blob/master/boot/base/src/main/java/boot/App.java#L285

@schmir schmir self-assigned this Jul 8, 2015
schmir added a commit that referenced this issue Jul 8, 2015
replace special characters when building path components when the
environment variable BOOT_LOCAL_REPO is set.
Previously we ended up trying to use illegal filenames like
C:\home\.boot\cache\boot\customC:\home\.m2\... on windows.

Since we now also replace the path separators, we use a single directory
under boot/custom/ instead of a deep directory structure.

This may lead to a single path component being too long. But that is a
future issue.

see #243 for more information.
schmir added a commit that referenced this issue Jul 9, 2015
use md5 hash when building path components when the environment variable
BOOT_LOCAL_REPO is set.

Previously we ended up trying to use illegal filenames like
C:\home\.boot\cache\boot\customC:\home\.m2\... on windows.

We now use a single directory under boot/custom/ instead of a deep
directory structure.

The conversion to a hex string is a bit awkward, see
https://stackoverflow.com/questions/9655181/how-to-convert-a-byte-array-to-a-hex-string-in-java
for a discussion.

fixes #243
@micha micha closed this as completed in #246 Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant