bertsky / workflow-configuration

a makefilization for OCR-D workflows, with configuration examples
Apache License 2.0
9 stars 5 forks source link

Make install fails when installing to vfat HDD #12

Closed kba closed 4 years ago

kba commented 4 years ago

I had to offload ocrd_all to an external hard drive due to storage running out. I notice that now installation fails:

git submodule sync  workflow-configuration
Synchronizing submodule url for 'workflow-configuration'
if git submodule status  workflow-configuration | grep -qv '^ '; then \
        git submodule update --init  workflow-configuration && \
        touch workflow-configuration; fi
make -C workflow-configuration install
make[1]: Entering directory '/media/kba/VERBATIM HD/ocrd_all/workflow-configuration'
mkdir -p /home/kba/build/github.com/OCR-D/ocrd_all/venv/bin /home/kba/build/github.com/OCR-D/ocrd_all/venv/share/workflow-configuration
cp -Lf Makefile **/media/kba/** /home/kba/build/github.com/OCR-D/ocrd_all/venv/share/workflow-configuration
cp: -r not specified; omitting directory '/media/kba/'
Makefile:103: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/media/kba/VERBATIM HD/ocrd_all/workflow-configuration'
Makefile:355: recipe for target '/home/kba/build/github.com/OCR-D/ocrd_all/venv/bin/ocrd-make' failed
make: *** [/home/kba/build/github.com/OCR-D/ocrd_all/venv/bin/ocrd-make] Error 2

I highlighted the problem in the listing with double asterisks. IIUC this should be the $(EXSISTING_MAKEFILES) that are supposed to be symlinks which fails because vfat doesn't supporet them I gues..

bertsky commented 4 years ago

I highlighted the problem in the listing with double asterisks.

I don't understand that. Are you saying make install caused running cp -Lf Makefile /media/kba/ /home/kba/build/github.com/OCR-D/ocrd_all/venv/share/workflow-configuration (literally)?

vfat and symlinks aside (yes, that would not work), this hints at something going wrong badly. EXISTING_MAKEFILES is merely a makefile wildcard on the existing .mk files: https://github.com/bertsky/workflow-configuration/blob/bfce7d3aa31d8e283f28e3898ab73c8463e443c5/Makefile#L385

I fail to see any way this gets expanded to the directory name /media/kba/...

bertsky commented 4 years ago

The point about vfat is this: You don't need symlinks for workflow-configuration, but if you want to work with the ocrd-make usage variant (which as opposed to the make invocation variant needs a prior make install step), then whereever you want to run ocrd-make in, the FS will have to support symlinks there. So it's perfectly ok to install from/to vfat, or use ocrd-make in a target directory with symlink support, or use make after copying the makefiles yourself (with or without prior make install) on any FS, but it won't work to run ocrd-make on vfat.

kba commented 4 years ago

I highlighted the problem in the listing with double asterisks.

I don't understand that. Are you saying make install caused running cp -Lf Makefile /media/kba/ /home/kba/build/github.com/OCR-D/ocrd_all/venv/share/workflow-configuration (literally)?

Yes

vfat and symlinks aside (yes, that would not work), this hints at something going wrong badly. EXISTING_MAKEFILES is merely a makefile wildcard on the existing .mk files: https://github.com/bertsky/workflow-configuration/blob/bfce7d3aa31d8e283f28e3898ab73c8463e443c5/Makefile#L385

I fail to see any way this gets expanded to the directory name /media/kba/...

I am as flabberghasted/flummoxed as you are. The symlinks problem is besides the point (and you're right, symlinking FROM vfat should work).

FWIW, this is GNU Make 4.1, is EXISTING_MAKEFILES a builtin there or something similar? What version of make do you test with?

kba commented 4 years ago

I think i got it. The Problem was that the external HDD had a label VERBATIM HD with a space. Renamed it to OCRD-HDD with fatlabel, remounted and now installation worked.

bertsky commented 4 years ago

I think i got it. The Problem was that the external HDD had a label VERBATIM HD with a space.

Oh I see! So I should try to support directory names with spaces...

kba commented 4 years ago

The more we move towards supporting OSX and MS Windows, the more important that will become I guess. IIRC @stweil also struggled with spaces in the past. We should take some time to systematically test this with the full OCR-D stack.

bertsky commented 4 years ago

Alas, make is probably never going to support spaces in path names. There simply are no general workarounds either. So this noble goal is futile for workspace-configuration.

If on OSX/MSW, avoid spaces in path names or don't use makefilization. Should probably make this prominent in the README...

EDIT true for Unix filesystems as well, just less conventional there.

kba commented 4 years ago

Yeah, the golden rule should be to avoid spaces in general, everywhere. But since the underlying shell normally supports escaped or quoted spaces, there is probably some leeway if we quote right. But without having systematically tested yet, its hard to say.

A notice in the README is probably a good idea in either case.

bertsky commented 4 years ago

A notice in the README is probably a good idea in either case.

Done.

Also made ocrd-make fall back to cp when ln does not work. (I know, it's unrelated – but since it came up.)

Yeah, the golden rule should be to avoid spaces in general, everywhere. But since the underlying shell normally supports escaped or quoted spaces, there is probably some leeway if we quote right. But without having systematically tested yet, its hard to say.

The problem is with make itself. It simply does not know any quoting. It tokenises around spaces in various situations (in fact, most of its functions and automatic variables are centered around white-space delimitation).