Skip to content

fix rvalue reference#53

Merged
ariesdevil merged 1 commit intodouban:masterfrom
ariesdevil:dev
Jun 12, 2017
Merged

fix rvalue reference#53
ariesdevil merged 1 commit intodouban:masterfrom
ariesdevil:dev

Conversation

@ariesdevil
Copy link

@ariesdevil ariesdevil commented Jun 9, 2017

Fix compile error on alpine linux, the error is following:

pip install libmc
Collecting libmc
  Using cached libmc-1.1.0.tar.gz
Installing collected packages: libmc
  Running setup.py install for libmc ... error
    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0reiZW/libmc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0brqPz-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/libmc
    copying libmc/__init__.py -> build/lib.linux-x86_64-2.7/libmc
    running build_ext
    cythoning libmc/_client.pyx to libmc/_client.cpp
    building 'libmc._client' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    creating build/temp.linux-x86_64-2.7/libmc
    gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -fPIC -Iinclude -I/usr/include/python2.7 -c src/BufferReader.cpp -o build/temp.linux-x86_64-2.7/src/BufferReader.o -fno-strict-aliasing -fno-exceptions -fno-rtti -Wall -DMC_USE_SMALL_VECTOR -O3 -DNDEBUG
    gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -fPIC -Iinclude -I/usr/include/python2.7 -c src/Connection.cpp -o build/temp.linux-x86_64-2.7/src/Connection.o -fno-strict-aliasing -fno-exceptions -fno-rtti -Wall -DMC_USE_SMALL_VECTOR -O3 -DNDEBUG
    In file included from src/Connection.cpp:6:0:
    /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
     #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      ^~~~~~~
    src/Connection.cpp: In member function 'ssize_t douban::mc::Connection::send()':
    src/Connection.cpp:234:76: error: invalid initialization of non-const reference of type 'size_t& {aka long unsigned int&}' from an rvalue of type 'size_t {aka long unsigned int}'
       msg.msg_iov = const_cast<struct iovec *>(m_buffer_writer->getReadPtr(msg.msg_iovlen));
                                                                            ~~~~^~~~~~~~~~
    In file included from include/Connection.h:11:0,
                     from src/Connection.cpp:13:
    include/BufferWriter.h:29:29: note:   initializing argument 1 of 'const iovec* const douban::mc::io::BufferWriter::getReadPtr(size_t&)'
       const struct iovec* const getReadPtr(size_t &n);
                                 ^~~~~~~~~~
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0reiZW/libmc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0brqPz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0reiZW/libmc/

This PR also check if glibc is exists.
@youngsofun @MOON-CLJ plz review

@youngsofun
Copy link
Contributor

LGTM

@ariesdevil ariesdevil merged commit 1c96914 into douban:master Jun 12, 2017
@ariesdevil ariesdevil deleted the dev branch June 12, 2017 08:09
tclh123 added a commit that referenced this pull request Feb 18, 2019
ChangeLog:

- use pickle protocol version 2 (#52)
- fix rvalue reference (#53)
- Fix tests (#55)
- golibmc_test: Fix fragile test case (#56)
- Use connection pool in golibmc(again) (#57)
- golibmc Quit ret err (#59)
- cmake: Incorporate gtest in a standard way (#58)
- Rename refactor (#60)
- sync rapidjson/itoa.h upstream fix (#65)
- split cppcheck (#67)
- split FSM_GET_BYTES_CAS (#68)
- Avoid noisy recv_err when broadcast quit (#73)
- Try to support updating some servers without affecting others (#74)
- make normalize_key cpdef & add warnings for unpickle unmarshal fail (#66)
- fix fcntl usage when set socket nonblock (#69)
- minor fix (#61)
- add condition log macro (#77)
- Define and use notWaitForRetryTimeout (#82)
- upgrade travis to gcc 7 (#91)
- add func errCodeToString (#79)
- Introduce a reconnect mechanism in waitPoll (#88)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants