Discussion:
[sane-devel] sane-backend 1.0.27 USB broken on Mac with Homebrew
schmo-fu
2017-07-24 10:54:53 UTC
Permalink
Hi,

i want to report a problem with sane-backends 1.0.27 on MacOS
installation via homebrew package management.
I wrote to one of the maintainers (Yurii on Cc:) of the homebrew-formula
first. He send me here, because it's not a compilation problem.
The formula installed fine, but the resulting sane-backend is built
without usb support.


Here is how and what i found out:
xsane suddenly didn't find my USB-Scanner anymore. I checked the scanner
with another computer and it's fine. I looked into the debug-output and
... long story short:
Debug information from sane-find-scanner says:
"sanei_usb_init: SANE is built without support for libusb"

Since i "brew upgrade"d since my last use of the scanner, i switched
back to 1.0.25_1 and this fixed the problem.
Reinstalling 1.0.27 with --build-from-source reproduced the problem.

The strange thing is, that the sane-backends.rb-file (the homebrew
automatic installation instruction) clearly states
"--enable-libusb" in both versions. But config-warnings for 1.0.27 say
"unrecognized options: --enable-libusb" which is in accordance with the
NEWS note 2, that libusb is now the default, but something seems to be
broken here.
I changed the formula so that it states "--with-usb" but that didn't
help. (No warning anymore, but still no USB)

The last 1.0.25-homebrew-commit contained a patch (concerning some
missing headers) that later commits are missing. (What this patch did
exactly and whether this is related to the usb-problem is beyond me.)

Finally i can say that homebrew-commit
7aaf1e3a14b75a715eed34f3bb4c57e79f417e96 works, while the next commit
60b1305361d0ef61405014b37164b1daaf77d207 doesn't.


I hope all of this makes sense to you and someone has time to look
into this problem.



Greetings from germany,
Thomas.S
(aka schmo-fu)


PS: I made some brew gist-logs for you, maybe they help.

1.0.27 latest commit:
https://gist.github.com/anonymous/df5ad14abeca4ad0348d39693c92747a

1.0.27 manually changed --enable-usb to --with-usb:
https://gist.github.com/anonymous/5960a98614bed2b89a85fd726eddcece

1.0.25 last working commit:
https://gist.github.com/anonymous/c47dd22ff09318c0151cc5771173f97b




Gruß,
Thomas.S
(aka schmo-fu)
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.o
Olaf Meeuwissen
2017-07-24 12:09:56 UTC
Permalink
Hi Thomas,
Post by schmo-fu
Since i "brew upgrade"d since my last use of the scanner, i switched
back to 1.0.25_1 and this fixed the problem.
Reinstalling 1.0.27 with --build-from-source reproduced the problem.
The strange thing is, that the sane-backends.rb-file (the homebrew
automatic installation instruction) clearly states
"--enable-libusb" in both versions. But config-warnings for 1.0.27 say
"unrecognized options: --enable-libusb" which is in accordance with the
NEWS note 2, that libusb is now the default, but something seems to be
broken here.
I *was* gonna slap you over the head with that note ;-) but seeing that
you noticed, I guess there is another problem.
Post by schmo-fu
I changed the formula so that it states "--with-usb" but that didn't
help. (No warning anymore, but still no USB)
If you use --with-usb, the configure step is supposed to bomb if it
cannot enable USB support. I've trudged through the configure script
and it seems I may have made an overly optimistic mistake on that end
(although I don't think so).

Try --with-usb=yes. That really *should* bomb.

Why it bombs or not is another matter altogether.
Post by schmo-fu
The last 1.0.25-homebrew-commit contained a patch (concerning some
missing headers) that later commits are missing. (What this patch did
exactly and whether this is related to the usb-problem is beyond me.)
Finally i can say that homebrew-commit
7aaf1e3a14b75a715eed34f3bb4c57e79f417e96 works, while the next commit
60b1305361d0ef61405014b37164b1daaf77d207 doesn't.
I hope all of this makes sense to you and someone has time to look
into this problem.
It'd make more sense if you can tell me where these homebrew-commits can
be found.
# I've been on GNU+Linux and just about nothing else for two decades ;-)
Post by schmo-fu
Greetings from germany,
Thomas.S
(aka schmo-fu)
PS: I made some brew gist-logs for you, maybe they help.
https://gist.github.com/anonymous/df5ad14abeca4ad0348d39693c92747a
https://gist.github.com/anonymous/5960a98614bed2b89a85fd726eddcece
https://gist.github.com/anonymous/c47dd22ff09318c0151cc5771173f97b
From the config.log I see that there's probably a libusb-compat
installed somewhere. I'd suggest to get rid of that (as far as SANE is
concerned) because libusb-1.x should be okay.

From that same file, I also gather there should be libusb*.pc files (or
similar) in

/usr/local/opt/libusb/lib/pkgconfig

and

/usr/local/opt/libusb-compat/lib/pkgconfig

Curious about what those have to say about libusb because, AFAIU, the
configure script should be looking at those before it decides there's
no USB support.

Hope this helps, at least somewhat,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Yurii Kolesnykov
2017-07-24 12:50:02 UTC
Permalink
Hi Thomas, Olaf!
Post by Olaf Meeuwissen
It'd make more sense if you can tell me where these homebrew-commits can
be found.
# I've been on GNU+Linux and just about nothing else for two decades ;-)
Here is the brew formulae file. You can see history of commits.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/sane-backends.rb
schmo-fu
2017-07-26 03:38:20 UTC
Permalink
Hi Olaf,

sorry for the long wait, but now i'm back at the machine with the scanner.
Post by Olaf Meeuwissen
Try --with-usb=yes. That really *should* bomb.
I put '--with-usb=yes' into the formula, but that didn't stop the
compilation. You find the log here:
https://gist.github.com/anonymous/5ea27bd1a4c1f0baffebffe7aec0caf3
Post by Olaf Meeuwissen
From the config.log I see that there's probably a libusb-compat
installed somewhere. I'd suggest to get rid of that (as far as SANE is
concerned) because libusb-1.x should be okay.
From that same file, I also gather there should be libusb*.pc files (or
similar) in
/usr/local/opt/libusb/lib/pkgconfig
and
/usr/local/opt/libusb-compat/lib/pkgconfig
Curious about what those have to say about libusb because, AFAIU, the
configure script should be looking at those before it decides there's
no USB support.
i copied the contents of the two pc-files to this pad:
https://codicill.us/pad/p/gist

Then i force uninstalled libusb-compat.
That stopped sane-find-scanner from working (See error-message at the
end of the pad). So this looks more like sane-find-scanner is actually
build with usb-support?

So i reinstalled (build-from-source) sane-backends (after deactivating
the dependency for libusb-compat) and it bombed (of course).
Logs from that: https://gist.github.com/dfbe878620c1ae20f1bcbda44dbe37e3

So i reinstalled libusb-compat and now i'm back to where i started.


Greetings,
Thomas.S
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
schmo-fu
2017-08-07 13:05:27 UTC
Permalink
Okay, here i go again ...

i can confirm, that it is not a permission problem. It's just that there
are no files, where they should be.

The scanner is recognized by sane-find-scanner now. But scanimage -L
doesn't find it, because the sane-backends .conf files are supposed to
be at:
/usr/local/Cellar/sane-backends/1.0.27_1/etc/sane.d/
but there is no etc/ (and there also is no doc/; both are present under
1.0.25_1; (»officially« there should also be a tools/, but this isn't
present neither in 25 nor in 27).

Looking at
https://gist.github.com/anonymous/5e324f6e1c7c8b9ea4172a72e0352255
[[see note]]
the make-log shows, that the backends are all build with
"-DPATH_SANE_CONFIG_DIR=usr/local/Cellar/sane-backends/1.0.27_2/etc/sane.d"
which seems alright.

Maybe they get deleted later? I don't know enough about this process, to
know where to look for answers.
@Yurii can you help with this?


Greetings,
Thomas.S

[[ Note:
I corrected and reintroduced the patch from 1.0.25, that fixes some
header files, and thus made a version 1.0.27_2. ]]
Olaf Meeuwissen
2017-08-12 05:32:01 UTC
Permalink
Hi Thomas,
Post by schmo-fu
Okay, here i go again ...
i can confirm, that it is not a permission problem. It's just that there
are no files, where they should be.
The scanner is recognized by sane-find-scanner now. But scanimage -L
doesn't find it, because the sane-backends .conf files are supposed to
/usr/local/Cellar/sane-backends/1.0.27_1/etc/sane.d/
but there is no etc/ (and there also is no doc/; both are present under
1.0.25_1; (»officially« there should also be a tools/, but this isn't
present neither in 25 nor in 27).
Looking at
https://gist.github.com/anonymous/5e324f6e1c7c8b9ea4172a72e0352255
[[see note]]
the make-log shows, that the backends are all build with
"-DPATH_SANE_CONFIG_DIR=usr/local/Cellar/sane-backends/1.0.27_2/etc/sane.d"
which seems alright.
Maybe they get deleted later? I don't know enough about this process, to
know where to look for answers.
[ ... looking through the log ... ]

They don't get deleted later. The files to be installed don't get
created to begin with. This is arguably a bug in the sane-backends
build system but you can easily work around it by running a `make`
before doing a `make install`.

It looks like the homebrew stuff assumes that `make install` will be
smart enough to also trigger builds for everything that needs to be
installed. A bit overly optimistic, if you ask me ;-)

Below is the Makefile.am snippet that installs the configuration files.
The first line after the @list, checks for a readable configuration but
because all these files are generated they don't exist unless you run a
`make install` first.

install-becfg:
@# Libtool has a bug where it will sometimes symlink the last
@# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*.
@# Having two libsane's can cause issues so get rid of it.
-rm -f $(DESTDIR)$(sanelibdir)/libsane.*
test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d"
@list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \
if test ! -r $${cfg}; then continue; fi; \
if test -f $(DESTDIR)$(configdir)/$${cfg}; then \
echo NOT overwriting $${cfg} in $(configdir)...; \
else \
echo installing $${cfg} in $(configdir)/$${cfg}...; \
$(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \
|| exit 1; \
fi; \
done

I pushed a fix for this in 519ff57.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Yurii Kolesnykov
2017-08-12 12:42:53 UTC
Permalink
Post by Olaf Meeuwissen
They don't get deleted later. The files to be installed don't get
created to begin with. This is arguably a bug in the sane-backends
build system but you can easily work around it by running a `make`
before doing a `make install`.
It looks like the homebrew stuff assumes that `make install` will be
smart enough to also trigger builds for everything that needs to be
installed. A bit overly optimistic, if you ask me ;-)
Below is the Makefile.am snippet that installs the configuration files.
because all these files are generated they don't exist unless you run a
`make install` first.
@# Libtool has a bug where it will sometimes symlink the last
@# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*.
@# Having two libsane's can cause issues so get rid of it.
-rm -f $(DESTDIR)$(sanelibdir)/libsane.*
test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
test -z "$(configdir)/dll.d" || $(MKDIR_P)
"$(DESTDIR)$(configdir)/dll.d"
@list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \
if test ! -r $${cfg}; then continue; fi; \
if test -f $(DESTDIR)$(configdir)/$${cfg}; then \
echo NOT overwriting $${cfg} in $(configdir)...; \
else \
echo installing $${cfg} in $(configdir)/$${cfg}...; \
$(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \
|| exit 1; \
fi; \
done
I pushed a fix for this in 519ff57.
Hope this helps,
Olaf, I had created PR for this
https://github.com/Homebrew/homebrew-core/pull/16722 It can be installed
via:
`brew reinstall
https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb`
<https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb>

Thomas, please check it.
Tom Myers
2017-09-26 20:16:25 UTC
Permalink
Testing in 10.12.6
brew reinstall https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb
######################################################################## 100.0%
Error: /Library/Caches/Homebrew/Formula/sane-backends.rb:7: syntax error, unexpected '<'
<!DOCTYPE html>
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:8: syntax error, unexpected '<'
<html lang="en">
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:9: syntax error, unexpected '<'
<head>
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:11: syntax error, unexpected '<'
<link rel="dns-prefetch" href="https://assets-cdn.github.com">
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:11: syntax error, unexpected tIDENTIFIER, expecting end-of-input
<link rel="dns-prefetch" href="https://assets-cdn.github.com">
^
Please report this bug:
https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formulary.rb:22:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:22:in `load_formula'
/usr/local/Library/Homebrew/formulary.rb:79:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:134:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:70:in `klass'
/usr/local/Library/Homebrew/formulary.rb:66:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:176:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:29:in `block in resolved_formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:27:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:27:in `resolved_formulae'
/usr/local/Library/Homebrew/cmd/reinstall.rb:7:in `reinstall'
/usr/local/Library/brew.rb:127:in `<main>'

-----------------------------
Testing in 10.13
brew reinstall https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb
######################################################################## 100.0%
Error: /Library/Caches/Homebrew/Formula/sane-backends.rb:7: syntax error, unexpected '<'
<!DOCTYPE html>
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:8: syntax error, unexpected '<'
<html lang="en">
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:9: syntax error, unexpected '<'
<head>
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:11: syntax error, unexpected '<'
<link rel="dns-prefetch" href="https://assets-cdn.github.com">
^
/Library/Caches/Homebrew/Formula/sane-backends.rb:11: syntax error, unexpected tIDENTIFIER, expecting end-of-input
<link rel="dns-prefetch" href="https://assets-cdn.github.com">
^
Please report this bug:
https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formulary.rb:22:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:22:in `load_formula'
/usr/local/Library/Homebrew/formulary.rb:79:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:134:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:70:in `klass'
/usr/local/Library/Homebrew/formulary.rb:66:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:176:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:29:in `block in resolved_formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:27:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:27:in `resolved_formulae'
/usr/local/Library/Homebrew/cmd/reinstall.rb:7:in `reinstall'
/usr/local/Library/brew.rb:127:in `<main>'
ITALex15:/ tmyers$
Post by Olaf Meeuwissen
They don't get deleted later. The files to be installed don't get
created to begin with. This is arguably a bug in the sane-backends
build system but you can easily work around it by running a `make`
before doing a `make install`.
It looks like the homebrew stuff assumes that `make install` will be
smart enough to also trigger builds for everything that needs to be
installed. A bit overly optimistic, if you ask me ;-)
Below is the Makefile.am snippet that installs the configuration files.
because all these files are generated they don't exist unless you run a
`make install` first.
@# Libtool has a bug where it will sometimes symlink the last
@# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*.
@# Having two libsane's can cause issues so get rid of it.
-rm -f $(DESTDIR)$(sanelibdir)/libsane.*
test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d"
@list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \
if test ! -r $${cfg}; then continue; fi; \
if test -f $(DESTDIR)$(configdir)/$${cfg}; then \
echo NOT overwriting $${cfg} in $(configdir)...; \
else \
echo installing $${cfg} in $(configdir)/$${cfg}...; \
$(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \
|| exit 1; \
fi; \
done
I pushed a fix for this in 519ff57.
Hope this helps,
Olaf, I had created PR for this
`brew reinstall https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb` <https://github.com/yurikoles/homebrew-core/blob/sane-backends-1.0.27-3/Formula/sane-backends.rb%60>
Thomas, please check it.
--
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Loading...