You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/10/21 13:32:24 UTC

[GitHub] [couchdb] willholley opened a new issue #2265: Dreyfus is not detected in rebar scripts

willholley opened a new issue #2265: Dreyfus is not detected in rebar scripts
URL: https://github.com/apache/couchdb/issues/2265
 
 
   [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
   
   ## Description
   
   When building CouchDB master I noticed that `ken` was not updating search indexes. Upon further investigation, it transpired that the conditional compilation flag `HAVE_DREYFUS` (see [here](https://github.com/apache/couchdb-ken/blob/tmp/rebar.config.script#L13)) is not set when the build is run in a clean environment. The impact of this is that background indexing for search indexes is disabled, though every other piece of search functionality seems to work fine.
    
   I find that if I force `ken` to rebuild (e.g. delete the `ebin` directory from `src/ken` and run `make release`), the feature detection works!
   
   ## Steps to Reproduce
   
   In a local CouchDB git repository, add debug output to rebar by adding `-vvv` to the `couch` target in the `Makefile`:
   
   ```
   couch: config.erl
   	@COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) $(REBAR) -vvv compile $(COMPILE_OPTS)
   	@cp src/couch/priv/couchjs bin/
   ```
   
   Then run a clean build:
   
   ```
   $ make clean
   $ ./configure -c
   $ make dist
   ```
   
   Observe the debug output when compiling `ken`. `erl_opts` is what we're interested in:
   
   ```
   ...
   ==> ken (compile)
   DEBUG: Matched required ERTS version: 8.3.5.6 -> .*
   DEBUG: Matched required OTP release: 19 -> 19|20|21|22
   DEBUG: Min OTP version unconfigured
   DEBUG: erl_opts [debug_info,{i,"../"}]
   ...
   ```
   
   If you then force `ken` to rebuild, you'll get the expected output:
   
   ```
   $ rm -rf src/ken/ebin`
   $ make dist
   
   ...
   ==> ken (compile)
   DEBUG: Matched required ERTS version: 8.3.5 -> .*
   DEBUG: Matched required OTP release: 19 -> 19|20|21|22
   DEBUG: Min OTP version unconfigured
   DEBUG: erl_opts [debug_info,{d,'HAVE_DREYFUS'},{i,"../"}]
   ...
   ```
   
   I first detected this when building packages using the couchdb-ci Dockerfiles but can reproduce it locally using the above steps.
   
   ## Expected Behaviour
   
   For CouchDB master, `HAVE_DREYFUS` should be set when `dreyfus` is present (which is now always?).
   
   ## Additional Context
   
   `ken` isn't the only module to use the `HAVE_DREYFUS` compilation flag - Mango also uses it [here](https://github.com/apache/couchdb/blob/master/src/mango/rebar.config.script#L14). Knowing very little about rebar, my guess is that it's significant that `mango` is "part" of the CouchDB application whereas `ken` is an external dependency. At least, they are specified differently in the [rebar.config](https://github.com/apache/couchdb/blob/master/rebar.config.script#L91) that perhaps impacts compilation order / dependency resolution.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services