Skip to content
Stephen Sigwart edited this page Dec 4, 2020 · 17 revisions

Debugging

Logging

  • You can enable CodeIntel logging in /Applications/Komodo Edit 12.app/Contents/Resources/components/koCodeIntel.py:
cmd = [koDirSvc.pythonExe, "-O",
  join(koDirSvc.supportDir, "codeintel", "oop-driver.py"),
  # Warning
  #"--log-level", "30",
  # Info
  #"--log-level", "20",
  # Debug: WAY TOO VERBOSE
  #"--log-level", "10",
  "--import-path", koDirSvc.komodoPythonLibDir,
  "--database-dir", join(koDirSvc.userDataDir, "codeintel")]

Copying CodeIntel Files to Real App

# Most Files
rsync -urlcv --exclude pythoncile2.py --exclude '*.cix' src/codeintel/lib/codeintel2/ /Applications/Komodo\ Edit\ 12.app/Contents/Resources/python/komodo/codeintel2/
# PHP
rsync -urlcv src/udl/skel/PHP/pylib/ /Applications/Komodo\ Edit\ 12.app/Contents/Resources/distribution/bundles/php_language\@ActiveState.com/pylib/

# Common Files I Work On
cp src/codeintel/lib/codeintel2/tree_php.py /Applications/Komodo\ Edit\ 12.app/Contents/Resources/python/komodo/codeintel2/tree_php.py
cp src/udl/skel/PHP/pylib/lang_php.py /Applications/Komodo\ Edit\ 12.app/Contents/Resources/distribution/bundles/php_language\@ActiveState.com/pylib/lang_php.py
cp src/codeintel/lib/codeintel2/stdlibs/php-7.0.cix /Applications/Komodo\ Edit\ 12.app/Contents/Resources/python/komodo/codeintel2/stdlibs/php-7.0.cix
cp src/codeintel/lib/codeintel2/database/langlib.py /Applications/Komodo\ Edit\ 12.app/Contents/Resources/python/komodo/codeintel2/database/langlib.py
cp src/udl/skel/Smarty/pylib/lang_smarty.py /Applications/Komodo\ Edit\ 12.app/Contents/Resources/distribution/bundles/smarty_language\@ActiveState.com/pylib/lang_smarty.py

# src/chrome/komodo files
# These get compressed into /Applications/Komodo\ Edit\ 12.app/Contents/Resources/chrome/komodo.jar
mkdir ~/Downloads/tmpjar
cp /Applications/Komodo\ Edit\ 12.app/Contents/Resources/chrome/komodo.jar ~/Downloads/tmpjar/
cd ~/Downloads/tmpjar
jar -x -f komodo.jar
rm -f komodo.jar
# Edit files
rm /Applications/Komodo\ Edit\ 12.app/Contents/Resources/chrome/komodo.jar && jar -f /Applications/Komodo\ Edit\ 12.app/Contents/Resources/chrome/komodo.jar -c .

Building

Catalina/XCode 12 Work In Progress

  1. Use 10.12 SDK because it supports CLOCK_MONOTONIC
  2. Find the other -Wno blocks in build/moz3500-ko12.10/mozilla/configure.in and add these lines.
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-tautological-unsigned-enum-zero-compare"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-tautological-unsigned-enum-zero-compare"
  1. To solve nspr-config not found for python build.py pyxpcom
cp ./build/moz3500-ko12.10/mozilla/ko-rel/nsprpub/config/nspr-config ./build/moz3500-ko12.10/mozilla/ko-rel/dist/sdk/bin/
  1. Not sure how to solve this:
make[3]: *** No rule to make target `/Users/ssigwart/Documents/KomodoEdit/mozilla/build/moz3500-ko12.10/mozilla/ko-rel/dist/lib/libxpcomglue_s.a', needed by `libpyxpcom.dylib'.  Stop.

Setup

export HOMEBREW_NO_AUTO_UPDATE=1
brew install [email protected]
brew install yasm ccache mercurial subversion

# Update MinimumSDKVersion
defaults read /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
sudo defaults write /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist MinimumSDKVersion -string "10.9"
sudo chmod 644 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist

Download Xcode 6.4 from https://developer.apple.com/download/more/. Open, but don't install.

sudo rsync -urlt /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/

Initial Build

sudo rsync -urlt ~/Downloads/MacOSX10.9.sdk/ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/
cd mozilla
export MACOSX_DEPLOYMENT_TARGET="10.9"
# Change 12.10 to correct version number (.10 is used for development builds)
python build.py configure -k 12.10 --with-crashreport-symbols --options=disable-webrtc --options='with-macos-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
python build.py all

Handling Errors

Komodo Build

export MACOSX_DEPLOYMENT_TARGET="10.9"
export PATH=`pwd`/util/black:$PATH   # Komodo's "bk" build tool
git submodule update --init
git submodule update --remote
bk configure -V 12.10.1-devel --with-crashreport-symbols
bk build
# Optional: Build crash symbols
bk build crashreportsymbols

Manual Fixes

  • Make sure mozilla/prebuilt/python2.7/macosx/Python.framework/Versions/2.7/lib/python2.7/config/Makefile has -isysroot set to MacOSX10.9.sdk.
    • Might need to run bk reconfigure -V 12.10.1-devel after
  • Change watchdog_fsevents.c from #include <Python/Python.h> to #include <Python.h>
  • Make sure contrib/Conscript has -mmacosx-version-min=10.9

Running Komodo

export PATH=`pwd`/util/black:$PATH   # Komodo's "bk" build tool
bk run
˜
# Quick rebuild and run
bk build quick && bk run

Quick Rebuild with PHP Code Intel

  • bk build quick doesn't copy some PHP files
cp src/udl/skel/PHP/pylib/lang_php.py mozilla/build/moz3500-ko12.10/mozilla/ko-rel/dist/Komodo.app/Contents/MacOS/distribution/bundles/php_language\@ActiveState.com/pylib/lang_php.py && bk run

Crash debugging

./src/processor/minidump_stackwalk ~/Library/Application\ Support/Komodo\ Edit/Crash\ Reports/pending/XXXXXXX.dmp ~/Documents/Programming/KomodoEdit/mozilla/build/moz3500-ko12.10/mozilla/ko-rel/dist/crashreporter-symbols/

Logs

cd ~/Library/ApplicationSupport/KomodoEdit/12.10 # Change version as needed
tail -f pystderr.log

Rebasing

git fetch upstream
git merge upstream/master