I am trying to contribute more with couchdb code, but I have really no idea how it is done the right way.
I have cloned the source from apache git repository and built it with
./configure
make && sudo make install
Then I wanted to change a file from the source called couch_httpd_show.erl
Do I need to run make && sudo make install
again for every change I make to the source code and want to see how it behaves?
I am sure there's a more practical way to do it, because this approach is a bit time and patience consuming right?
3条答案
按热度按时间g6ll5ycj1#
Yes, there is a shortcut.
This builds and runs CouchDB entirely in the current directory. Instead of running as a background daemon, CouchDB will run in the foreground and output log messages to the terminal. It uses some local directories to store stuff:
./tmp/log
for logs,./tmp/lib
for databases, and (if I remember correctly)./etc/couch/local_dev.ini
for configuration.If you run this instead:
then you will also have an interactive Erlang prompt, which you can use to help debug.
When I work on CouchDB, I run this in the shell:
After I change some code, I press
^C
, up-arrow, return.When I joined Couchio, I was responsible for production CouchDB deployments. I asked Chris Anderson for advice about something and he said, "Sorry, ask Jan. I've been just using utils/run for years!"
vojdkbi02#
您可以重建该文件,并将输出光束放置到位,然后重新启动。
flseospp3#
&然后将.beam文件复制到适当的位置。要重新启动couchdb,请在erlang shell中使用init:restart().或对CouchDB执行POST /_restart。
尽管你可能也想考虑使用命令行的erlang & javascript测试套件来确保你没有破坏任何东西。