facebook / facebook/hhvm

HHVM exports "TRACE" as an un-prefixed global symbol (define)

Open
#7,288 3 comments 0 reactions 0 assignees View on GitHub
build
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### HHVM Version

3.13.1
### Standalone code, or other way to reproduce the problem

Extension compilation of "mongodb/mongo-hhvm-driver"
### Expected result

It compiles.
### Actual result

HHVM defines "TRACE", without prefixing it with a library specific prefix. This causes issues with mongodb/mongo-c-driver, as it does the same.

I am now getting the following compile errors:

```
derick@whisky:~/dev/php/derickr-mongo-hhvm-driver $ make
[ 0%] Building CXX object CMakeFiles/mongodb.dir/mongodb.cpp.o
In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc.h:54:0,
from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/BulkWrite.h:21,
from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:21:
/home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc-trace.h:42:0: warning: "TRACE" redefined
#define TRACE(msg,...)
^
In file included from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/memory-manager.h:31:0,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/array-data.h:25,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-array.h:20,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/exceptions.h:28,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/string-data.h:30,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-string.h:22,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/debuggable.h:19,
from /usr/local/hhvm/3.13.1/include/hphp/runtime/ext/extension.h:21,
from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:17:
/usr/local/hhvm/3.13.1/include/hphp/util/trace.h:386:0: note: this is the location of the previous definition
#define TRACE(...) do { } while (0)
^
In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:34:0:
/home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/BSON/Decimal128.h:34:3: error: ‘bson_decimal128_t’ does not name a type
bson_decimal128_t m_decimal;
^
CMakeFiles/mongodb.dir/build.make:62: recipe for target 'CMakeFiles/mongodb.dir/mongodb.cpp.o' failed
make[2]: *** [CMakeFiles/mongodb.dir/mongodb.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mongodb.dir/all' failed
make[1]: *** [CMakeFiles/mongodb.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
```

HHVM should prefix this with something, as to prevent symbol clashes.

I've also filed this in the CDRIVER project: https://jira.mongodb.org/browse/CDRIVER-1486

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.