yb85 / scantailor-advanced-osx

Homebrew formula and App bundler for Scantailor (Advanced)
150 stars 6 forks source link

build error on High Sierra #6

Closed lingdoc closed 2 years ago

lingdoc commented 4 years ago

Following the build/install instructions, after I type brew install ./scantailor.rb everything seems to start fine, and then halfway through the process I get a traceback with the following error:

/usr/local/Homebrew/Library/Homebrew/utils/github.rb:305:in `issues_for_formula': undefined method `full_name' for nil:NilClass (NoMethodError)

here's the full traceback:

[ 50%] Built target imageproc
make: *** [all] Error 2

Do not report this issue to Homebrew/brew or Homebrew/core!

Traceback (most recent call last):
    28: from /usr/local/Homebrew/Library/Homebrew/build.rb:202:in `<main>'
    27: from /usr/local/Homebrew/Library/Homebrew/build.rb:118:in `install'
    26: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:in `with_env'
    25: from /usr/local/Homebrew/Library/Homebrew/build.rb:123:in `block in install'
    24: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1177:in `brew'
    23: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2156:in `stage'
    22: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
    21: from /usr/local/Homebrew/Library/Homebrew/resource.rb:81:in `stage'
    20: from /usr/local/Homebrew/Library/Homebrew/resource.rb:106:in `unpack'
    19: from /usr/local/Homebrew/Library/Homebrew/resource.rb:196:in `mktemp'
    18: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `run'
    17: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `chdir'
    16: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `block in run'
    15: from /usr/local/Homebrew/Library/Homebrew/resource.rb:197:in `block in mktemp'
    14: from /usr/local/Homebrew/Library/Homebrew/resource.rb:111:in `block in unpack'
    13: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2181:in `block in stage'
    12: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:in `with_env'
    11: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2182:in `block (2 levels) in stage'
    10: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1184:in `block in brew'
     9: from /usr/local/Homebrew/Library/Homebrew/build.rb:152:in `block (2 levels) in install'
     8: from /Users/hiramring/Downloads/scantailor/scantailor-advanced-osx/scantailor.rb:30:in `install'
     7: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2099:in `mkdir'
     6: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/fileutils.rb:128:in `cd'
     5: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/fileutils.rb:128:in `chdir'
     4: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2100:in `block in mkdir'
     3: from /Users/hiramring/Downloads/scantailor/scantailor-advanced-osx/scantailor.rb:32:in `block in install'
     2: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1977:in `system'
     1: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1977:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2039:in `block in system': Failed executing: make (BuildError)
    5: from /usr/local/Homebrew/Library/Homebrew/brew.rb:45:in `<main>'
    4: from /usr/local/Homebrew/Library/Homebrew/brew.rb:151:in `rescue in <main>'
    3: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:414:in `dump'
    2: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:360:in `issues'
    1: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:364:in `fetch_issues'
/usr/local/Homebrew/Library/Homebrew/utils/github.rb:305:in `issues_for_formula': undefined method `full_name' for nil:NilClass (NoMethodError)
lingdoc commented 4 years ago

I tried to install the bleeding-edge version instead, via brew install --HEAD ./scantailor.rb and that works fine..

yb85 commented 4 years ago

apparently a recent update of homebrew seems to break local taps (i may be wrong) :

https://github.com/Homebrew/brew/pull/7745

from what i understand, the formula being from the local filesystem and not from a tap, the call to tap.full_name fails (tap is a NIL object)

maybe it is possible to define a tap object explicitly in the formula… i'll look into it

dtrodrigues commented 4 years ago

The build error is unrelated to Homebrew. If you look at the full traceback, you'd see something like Last 15 lines from /Users/<username>/Library/Logs/Homebrew/scantailor/02.make:, but the cmake error in your case was before the last 15 lines. Looking in the logfile would let you find the actual error.

/tmp/scantailor-20200806-60229-1lec3rl/scantailor-advanced-1.0.16/ImageViewBase.cpp:431:18: error: variable has incomplete type 'QPainterPath'
    QPainterPath clip_path;
                 ^
/usr/local/opt/qt/lib/QtGui.framework/Headers/qmatrix.h:54:7: note: forward declaration of 'QPainterPath'
class QPainterPath;
      ^
/tmp/scantailor-20200806-60229-1lec3rl/scantailor-advanced-1.0.16/ImageViewBase.cpp:442:18: error: variable has incomplete type 'QPainterPath'
    QPainterPath clip_path;
                 ^
/usr/local/opt/qt/lib/QtGui.framework/Headers/qmatrix.h:54:7: note: forward declaration of 'QPainterPath'
class QPainterPath;
      ^
2 errors generated.
make[2]: *** [CMakeFiles/stcore.dir/ImageViewBase.cpp.o] Error 1
make[1]: *** [CMakeFiles/stcore.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 36%] Building CXX object imageproc/CMakeFiles/imageproc.dir/ColorTable.cpp.o

It's slightly confusing because due to the parallel build, the last lines of the cmake output may not contain the error, but looking at the full log file finds it.

It looks like it might be resolved in https://github.com/4lex4/scantailor-advanced/commit/3d1e74e6ace413733511086934a66f4e3f7a6027, which is why passing the --head option works.

Homebrew does support third-party taps, but the instructions in this repo README don't install this as a tap. See https://docs.brew.sh/Taps#the-brew-tap-command for more.

If you do

brew tap yb85/scantailor-advanced-osx https://github.com/yb85/scantailor-advanced-osx/
brew install scantailor

you'll instead only get a GitHub API error since the tap name doesn't have homebrew as the username prefix when brew is searching GitHub for open issues after the build fails.

yb85 commented 2 years ago

the new repo fixes the issue