rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

Windows build error, call to deleted constructor of 'pgp_transferable_userid_t' #1244

Closed kaie closed 4 years ago

kaie commented 4 years ago

I tried to build the snapshot from end-of-day 2020-08-03. Building as part of Thunderbird for Windows results in the following build error:

/builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -Xclang -std=c++14 -m32 -Fostream-key.obj -c  -DNDEBUG=1 -DTRIMMED=1 -D_GNU_SOURCE -DHAVE_BZLIB_H -DHAVE_ZLIB_H '-DMOZ_RNP_DIST_INFO=Thunderbird Daily 78.1.1 rnp' -I/builds/worker/checkouts/gecko/comm/third_party/rnp -I/builds/worker/workspace/obj-build/comm/third_party/rnp -I/builds/worker/checkouts/gecko/comm/third_party/rnp/include -I/builds/worker/checkouts/gecko/comm/third_party/rnp/src -I/builds/worker/checkouts/gecko/comm/third_party/rnp/src/common -I/builds/worker/checkouts/gecko/comm/third_party/rnp/src/lib -I/builds/worker/workspace/obj-build/comm/third_party/botan/build/include -I/builds/worker/checkouts/gecko/comm/third_party/zlib -I/builds/worker/checkouts/gecko/comm/third_party/json-c -I/builds/worker/checkouts/gecko/comm/third_party/bzip2 -I/builds/worker/checkouts/gecko/comm/third_party/niwcompat -I/builds/worker/workspace/obj-build/dist/include -MT -FI /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -Z7 -O2 -Oy- -Xclang -fcxx-exceptions -Xclang -iquote -Xclang /builds/worker/workspace/obj-build/comm/third_party/rnp/src/lib -Xclang -iquote -Xclang /builds/worker/checkouts/gecko/comm/third_party/rnp/src/lib -Xclang -iquote -Xclang /builds/worker/workspace/obj-build/comm/third_party/rnp/../json-c -FI /builds/worker/checkouts/gecko/comm/third_party/rnp/../niwcompat/niw_compat.h -Xclang -fexperimental-new-pass-manager  -Xclang -MP -Xclang -dependency-file -Xclang .deps/stream-key.obj.pp -Xclang -MT -Xclang stream-key.obj   /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-key.cpp
In file included from /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-key.cpp:36:
In file included from /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-key.h:33:
In file included from /builds/worker/checkouts/gecko/comm/third_party/rnp/include/rnp.h:35:
In file included from /builds/worker/checkouts/gecko/comm/third_party/rnp/src/lib/types.h:55:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/string:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/istream:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/ostream:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/ios:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xlocnum:10:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/streambuf:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xiosbase:6:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xlocale:8:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/stdexcept:7:
In file included from /builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xstring:6:
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xmemory0(881,4): error: call to deleted constructor of 'pgp_transferable_userid_t'
                        _Objty(_STD forward<_Types>(_Args)...);
                        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xmemory(164,29): note: in instantiation of function template specialization 'std::_Default_allocator_traits<std::allocator<pgp_transferable_userid_t> >::construct<pgp_transferable_userid_t, pgp_transferable_userid_t>' requested here
                allocator_traits<_Alloc>::construct(_Al, _Unfancy(_Last), _STD forward<_Types>(_Vals)...);
                                          ^
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xmemory(232,12): note: in instantiation of function template specialization 'std::_Uninitialized_backout_al<pgp_transferable_userid_t *, std::allocator<pgp_transferable_userid_t> >::_Emplace_back<pgp_transferable_userid_t>' requested here
                _Backout._Emplace_back(_STD move(*_First));
                         ^
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/xmemory(257,3): note: in instantiation of function template specialization 'std::_Uninitialized_move_al_unchecked<pgp_transferable_userid_t *, pgp_transferable_userid_t *, std::allocator<pgp_transferable_userid_t> >' requested here
                _Uninitialized_move_al_unchecked(_UFirst, _ULast, _UDest, _Al,
                ^
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/vector(1828,11): note: in instantiation of function template specialization 'std::_Uninitialized_move<pgp_transferable_userid_t *, pgp_transferable_userid_t *, std::allocator<pgp_transferable_userid_t> >' requested here
                return (_Uninitialized_move(_First, _Last, _Dest, this->_Getal()));
                        ^
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/vector(970,4): note: in instantiation of member function 'std::vector<pgp_transferable_userid_t, std::allocator<pgp_transferable_userid_t> >::_Umove' requested here
                        _Umove(this->_Myfirst(), _Whereptr, _Newvec);
                        ^
/builds/worker/checkouts/gecko/vs2017_15.8.4/VC/include/vector(922,19): note: in instantiation of function template specialization 'std::vector<pgp_transferable_userid_t, std::allocator<pgp_transferable_userid_t> >::_Emplace_reallocate<const pgp_transferable_userid_t &>' requested here
                _Ty& _Result = *_Emplace_reallocate(this->_Mylast(), _STD forward<_Valty>(_Val)...);
                                ^
/builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-key.h(44,5): note: 'pgp_transferable_userid_t' has been explicitly marked deleted here
    pgp_transferable_userid_t(pgp_transferable_userid_t &&src) = delete;
    ^
1 error generated.
/builds/worker/checkouts/gecko/config/rules.mk:746: recipe for target 'stream-key.obj' failed
rrrooommmaaa commented 4 years ago

I also have this error when trying to build with MSC compiler (#997) Perhaps, it's more stringent than GNU's

ni4 commented 4 years ago

That's why we should definitely have workflow which copies TB build steps. I'll take a look tomorrow, at the moment it looks a bit mystic. This could be related but not sure yet: https://stackoverflow.com/questions/53168836/does-visual-studio-2017-need-an-explicit-move-constructor-declaration

ni4 commented 4 years ago

@rrrooommmaaa @kaie Does this patch helps on this issue: https://github.com/rnpgp/rnp/pull/1250/files ?

kaie commented 4 years ago

I've started a test build to check it: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=da01a700bb6f3519b57f66693727caa6874ee195

kaie commented 4 years ago

The windows build passed!

Can you suggest how Thunderbird should pick up this fix? Do you want TB to update to a newer snapshot that includes this fix?

Or is it time to consider a stable branch, based on the 2020-08-03 baseline, plus fixes?

ni4 commented 4 years ago

Great! We had some PRs merged since 08-03, and those are mostly about bug fixing. If this doesn't interfere with audit I'd suggest to pick all of those commits, if it does - then just put this fix on top of 08-03, and delay picking up other commits till audit is finished.

kaie commented 4 years ago

who should make that decision? (interfere or doesn't interfere)

kaie commented 4 years ago

I've started a build for linux/macos, just to doublecheck this change builds on those platforms, too. https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=357a973452230c31ab19fa9ac2448074a734d49b

ni4 commented 4 years ago

who should make that decision? (interfere or doesn't interfere)

Hm, I think we should ask guys from c53. Anyway, as I correctly understand your beta build process, it's okay to have one build for them and another development build which is based on latest sources?

kaie commented 4 years ago

linux/macos built ok

ni4 commented 4 years ago

Closing this since issue is fixed.