QLMarkdown icon indicating copy to clipboard operation
QLMarkdown copied to clipboard

Errors building from source

Open acronce opened this issue 3 years ago • 3 comments

Thanks for this great project!

I'm trying to build this from source but I'm seeing errors like the following:

sbarex/QLMarkdown/QLMarkdown.xcodeproj Missing package product 'Sparkle'
sbarex/QLMarkdown/QLMarkdown.xcodeproj Missing package product 'Yams'
sbarex/QLMarkdown/QLMarkdown.xcodeproj Missing package product 'SwiftSoup'

There's no mention of these in the readme, and I don't see any submodules for them.

Maybe these should be added to the dependencies folder as submodules?

acronce avatar May 08 '22 01:05 acronce

All these modules are managed via the swift package. Xcode should automatically download the dependencies.

sbarex avatar May 08 '22 08:05 sbarex

Thanks for getting back to me. Xcode does seem to download the dependencies, but the targets that depend on them still cannot find them. I see errors building every target except for external-launcher.

Note that I'm using Xcode 13.2.1 and trying to build from the GUI, not the command line.

Looks like other folks have been complaining about this kind of problem since the Xcode 13 beta. Following their advice I tried File -> Packages -> Reset Package Caches and that resolved the missing package messages.

But now when doing a build I see an error from the libpcre2 target:

./dependencies/MakefilePCRE:104: *** No autoreconf in PATH (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin), try install autogen tools with homebrew.  Stop.

I do have the autogen tools installed, but the path is apparently not known to Xcode (but is available from the command line):

/opt/autotools/bin/autoreconf

To work around this, I added the following user defined env var to the libpcre2 and libjpcre2 targets:

PATH = ${PATH}:/opt/autotools/bin

The next problem is that the highlight-wrapper target produces the following error (for either the Debug or Release config):

make: *** No rule to make target `/Users/acronce/Library/Developer/Xcode/DerivedData/QLMarkdown-ectrneqybndeqrbkrkqvtedzxoho/Build/Products/Debug/libhighlight_arm64.dylyb', needed by `/Users/acronce/Library/Developer/Xcode/DerivedData/QLMarkdown-ectrneqybndeqrbkrkqvtedzxoho/Build/Products/Debug/libhighlight.a'.  Stop.

I don't see any built deliverable with libhighlight in the name. I have not yet figured out this error.

acronce avatar May 08 '22 15:05 acronce

Have you downloaded the source code via zip or have you cloned the repository?

highlight-wrapper uses a git submodule that is not preserved by the zip format.

Also, after the repository clone, you must call git submodule update --init to initialize the submodules.

sbarex avatar May 09 '22 15:05 sbarex