JuliaAI / MLJ.jl

A Julia machine learning framework
https://juliaai.github.io/MLJ.jl/
Other
1.79k stars 157 forks source link

All releases after v0.8.0 cannot be installed on Windows due to strange PNG filename #591

Open Sh4pe opened 4 years ago

Sh4pe commented 4 years ago

TL;DR

On windows, no release after v0.7.0 can be installed. This is due to a PNG file below ./doc that contains a strange character which prevents git checkouts on Windows. The offending file .*workflows_learning_curves.png seems to be in the repo since #429.

Longer description

Julia packaging is based on git checkouts. On Linux, all the checkouts work. However, they do not work properly on windows. When I manually check out the current master, I get

PS C:\Users\XXX\tmp> git clone https://github.com/alan-turing-institute/MLJ.jl.git
Cloning into 'MLJ.jl'...
remote: Enumerating objects: 21717, done.
remote: Total 21717 (delta 0), reused 0 (delta 0), pack-reused 21717
Receiving objects: 100% (21717/21717), 19.24 MiB | 2.84 MiB/s, done.
Resolving deltas: 100% (13043/13043), done.
error: invalid path 'docs/src/_old/
workflows_learning_curves.png'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Note that there seems to be a newline in the path docs/src/_old.... Checkouts until v0.7.0 work, but checking out all newer tags fails on windows.

As a side note, checking out the repo in WSL (i.e. in Linux running on windows) works and you can inspect the strange file:

XXX@COMPUTER:/mnt/c/Users/XXX/tmp/MLJ.jl$ git checkout master
XXX@COMPUTER:/mnt/c/Users/XXX/tmp/MLJ.jl$ ls -1 docs/src/_old/
''$'\n''workflows_learning_curves.png'
0.jpg
# ...

Something weird is going on with the filename here. You see that it contains a newline. This appears to break the checkout on windows.

This is a real problem and prevents installs on Windows! I've stumbled upon this because I want to use MLJ.jl on one of my projects in Windows. Running Pkg.add("MLJ") does not work and leads to the corresponding directory below ~./julia/packages/MLJ to be created but empty. Using MLJ with using MLJ in the project fails with the hint to run Pkg.instantiate(), but instantiating does not work too of course (because everything relies on git).

Solution?

Of course we could rename the offending file but that would only fix future versions. In one of my projects, I'm forced to use an older version (v0.11.5 in this case) and that does not work.

One workaround would be to checkout the code in WSL and manually copy it to the proper directory (not tested yet). But that seems rather unsatisfactory.

I'll try to create a PR soonish that fixes the filename. But I have no idea how to fix the releases between v0.8.0 and v0.12.0.

ablaom commented 4 years ago

@Sh4pe Many thanks for reporting, investigation and diagnosis. A PR to fix the name in patch would be a great start.

Regarding your desire to use v0.11.5. Is there a reason a 0.11.6 patch would not resolve your problem?

Sh4pe commented 4 years ago

@ablaom Thanks for your answer. I'll try to add a PR soon.

I think a patch to 0.11.6 might help me. I'm not very familiar with the Julia package version resolution system, but I tried to use 0.12.0 in my case and it appears that dependencies of some other packages make using 0.12.0 impossible. So if I guess that if we could define a 0.11.6 with the same compatibility requirements as 0.11.5, this should work. However, I've used the workaround I described and it works too.

But a 0.11.6 would be very welcome too :)

Sh4pe commented 4 years ago

I've added the PR #595. This will fix the problem for future releases, but not for past ones.

ablaom commented 4 years ago

A patch 0.11.6: https://github.com/JuliaRegistries/General/pull/17837

@Sh4pe If this works for you (when merged) please confirm by closing this issue. I think support for earlier versions will not be attempted.

Sh4pe commented 4 years ago

Thanks for the patch, but this does not solve my problem however. Checking out v0.11.6 now works on windows, but I'm using MLJ.jl from within docker and Pkg.instantiate() still fails on the first try. My guess is that the repo is still cloned first and clone appears to try to check out a commit that is still broken.

I'll have to investigate that problem still but I don't know when I'll find the time to do so.

ablaom commented 2 years ago

@Sh4pe Is this still a problem?