彙整

mdworker Error (To be updated)

I don't know when did I start to have the common OS X 10.8.2 error:

1
2
5/24/13 8:52:38.838 AM mdworker[597]: Unable to talk to lsboxd
5/24/13 8:52:38.996 AM sandboxd[598]: ([597]) mdworker(597) deny mach-lookup com.apple.ls.boxd

I was directed to a safe-boot, but due to some unclear reason my mac cannot do so unless I remove one of its RAMs. Details are in Macbook Safe Boot Adventure.

Unfortunately the error came back. It still doesn't bother much compared to my Macbook Pro's inability to safe boot though. I started reading Mac OS X Internals: The Book, so I decided to get some precise information about this error.

Google is amazing, and I found this post. The post points the cause to 3rd party mdimporters, which is the most feasible I have read. Assuming Apple should have resolved the issue for their own softwares, I suspect MS Office suite and TeX suite most. I will update after trial.

Macbook Safe Boot Adventure (To Be Continued)

Last night I read about the mdworker: Unable to talk to lsboxd problem at Lucifr. I have met the freeze several times, but ignored it since it doesn't affects anything severely. I didn't notice the console error, though, so this time, I decide to eliminate them all.

I restarted my Macbook Pro into Safe Mode and met the somehow familiar progress bar …… and BOOM I remembered that evil. The last time I saw it the poor machine hanged for a night before I force shut it down.

As I expected, my poor Macbook Pro stuck at exactly the same place with the progress bar near quarter.

管理器優先

在一整晚——真的是一整晚的奮鬥之下,我總算成功卸載了 CMake

一切開始於不久前,我拿到我這台Macbook Pro的時候。我安裝了一些“裝機必備”的東西,其中就有 Homebrew 。我還算愉快地把玩了一番。說是把玩,那時候我唯一安裝的 brew 也只有 gcc-4.7,用來代替 Xcode 提供的古董 gcc-4.2 而已。

好景不長,我後來在 Data Structure 課上想要調試代碼的時候卻發現,OSX 默認的 gdb 無法調試 gcc-4.7 所編譯的程序。無奈之下,我只好用回默認的 gcc-4.2 ,發現也没什麼大問題。那我還要 Homebrew 做甚呢?

於是就有了前晚的掙扎。這深刻的教訓告訴我,無論什麼時候,程序管理器都是該最先安裝,最後卸載的。

第一個問題出在 libgit2 。我運行 brew doctor 重新安裝 Homebrew 的時候,跳出了 Unexpected dylib 的錯誤。本來我就打算換成 Homebrew 版的,但問題是,怎麼換?找了許久也不見卸載的教程。不得已,我新開了一個 issue@vmg 在几分鐘後回復了我,帮我找到了安裝記録,在此感謝。手動刪除的步驟就不提了。

接下來纔是正題。Brew 安裝 MacVim 的時候,HomebrewCMake 作為前提安裝了,但因為我此前自己安裝過一次 CMake ,所以 Homebrew 無法鏈接新安裝的版本。

想着“也換成 Homebrew 版算了”,準備卸載的時候,發現這又是一個坑爹貨。官網github頁面都没有任何卸載說明,連 issue 那樣的溝通手段都没有。

能用的只有剛剛學到的 make uninstall 了。直接運行 cmake uninstall 提示 CMakeCache.txt 損壞。“什麼玩意?”我明明看見了 cmake_uninstall.cmake ,說明並非如 libgit2 一樣缺失目標。

仔細閱讀了當初編譯時用的 bootstrap 脚本後,我總算明白了。“還挺精巧的嘛,用自己編譯自己。”重新運行 bootstrap ,又遇到了 CMakeCache.txt 錯誤。我找來源包對比,發現只是個臨時文件,就放心刪除了。接下來果然成功引導了 CMake ,運行 cmake uninstall 卸載了本機的版本。遇到 Permisson Denied 加了 sudo

總算!brew link cmake 成功了。

Manager First

After a night -- literally a night's fight with the compiler, I finally got rid of CMake.

It all started a short time ago. When I first got this Macbook Pro, I decided to search for some "necessary complements". I found Homebrew. I played with it quite happily and it helped me a bit. At that time my only brew was "gcc-4.7", a replacement of the extremely old gcc-4.2 provided with Xcode.

Unfortunately later when I tried to gdb the code from my Data Structure course, I found it troublesome. I couldn't compile with gcc-4.7 then use default gdb. So, when I decided to go back to the default gcc, I thought, "as long as the default is enough, maybe homebrew is out of necessary."

The previous night has proved me wrong. Software managers should always be the first to be installed and the last to be removed.

The first issue was on libgit2. When I reinstalled Homebrew, ran brew doctor, Unexpected dylib came into my way. I didn't just remove the file warned; I knew I would change to homebrew version. But nothing online showed me how to uninstall it. So I opened an issue and luckily, @vmg helped me out (Thank you @vmg!). I had to find the list of installed files and remove them manually. They were in several folders and I removed them with ease.

Then I brewed MacVim. I was using the default vim but recently found a standalone editor more comfortable. Before the install really started, Homebrew automatically brewed CMake as it is a prerequisite, but failed to link it because I built one before. MacVim was still installed successfully.

"OK," I thought, "I'll uninstall CMake and change to homebrew version as well." This time I was really on my own. No document of CMake ever mentions uninstallation, no issue page in the github page of CMake, no local help.

Directly running cmake uninstall gave me error message about the file CMakeCache.txt. "Nonsense," I thought. make uninstall didn't work either. Noticing the existence of cmake_uninstall.cmake, I knew there's a uninstall target to use.

Upon scrutinizing the bootstrap script used to build the compiler, I was finally clear of confusion. "That's neat, " I said to myself silently, "compile a unlinked copy to run, then compile itself." To make a try, I reran the script. I met the cache error again. With the copy of tarball I reserved, I confirmed it was safe to delete CMakeCache.txt. Second try went smoothly, and with the bootstrapped CMake, I executed cmake uninstall.

Then I met Permission Denied. OK, add sudo to the beginning and run again.

brew link cmake succeeded later.