Closed Bug 1478942 Opened 4 years ago Closed 4 years ago

Build bustage on Debian 9 due to "XPCJSRuntime.cpp:2913:12: error: no viable conversion from returned value of type 'UniquePtr<JS::ubi::SimpleEdgeRange>' to function return type 'UniquePtr<JS::ubi::EdgeRange>'

Categories

(Core :: XPConnect, defect, P2)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 --- unaffected
firefox63 --- fixed

People

(Reporter: masayuki, Assigned: KrisWright)

References

Details

(Keywords: regression)

Attachments

(1 file)

When I build m-c on Debian 9, I see this error:

 0:07.25 In file included from /home/toybox/mozilla/fx-gtk3-dbg/js/xpconnect/src/Unified_cpp_js_xpconnect_src0.cpp:83:
 0:07.25 /home/toybox/mozilla/src/js/xpconnect/src/XPCJSRuntime.cpp:2913:12: error: no viable conversion from returned value of type 'UniquePtr<JS::ubi::SimpleEdgeRange>' to function return type 'UniquePtr<JS::ubi::EdgeRange>'
 0:07.25     return range;
 0:07.25            ^~~~~
 0:07.25 /home/toybox/mozilla/fx-gtk3-dbg/dist/include/mozilla/UniquePtr.h:262:3: note: candidate constructor not viable: no known conversion from 'js::UniquePtr<SimpleEdgeRange>' (aka 'mozilla::UniquePtr<JS::ubi::SimpleEdgeRange, JS::DeletePolicy<JS::ubi::SimpleEdgeRange> >') to 'mozilla::UniquePtr<JS::ubi::EdgeRange, JS::DeletePolicy<JS::ubi::EdgeRange> > &&' for 1st argument
 0:07.25   UniquePtr(UniquePtr&& aOther)
 0:07.25   ^
 0:07.25 /home/toybox/mozilla/fx-gtk3-dbg/dist/include/mozilla/UniquePtr.h:267:3: note: candidate constructor not viable: no known conversion from 'js::UniquePtr<SimpleEdgeRange>' (aka 'mozilla::UniquePtr<JS::ubi::SimpleEdgeRange, JS::DeletePolicy<JS::ubi::SimpleEdgeRange> >') to 'decltype(nullptr)' (aka 'nullptr_t') for 1st argument
 0:07.25   UniquePtr(decltype(nullptr))
 0:07.25   ^
 0:07.25 /home/toybox/mozilla/fx-gtk3-dbg/dist/include/mozilla/UniquePtr.h:276:3: note: candidate constructor [with U = JS::ubi::SimpleEdgeRange, E = JS::DeletePolicy<JS::ubi::SimpleEdgeRange>] not viable: no known conversion from 'js::UniquePtr<SimpleEdgeRange>' (aka 'mozilla::UniquePtr<JS::ubi::SimpleEdgeRange, JS::DeletePolicy<JS::ubi::SimpleEdgeRange> >') to 'UniquePtr<JS::ubi::SimpleEdgeRange, JS::DeletePolicy<JS::ubi::SimpleEdgeRange> > &&' for 1st argument
 0:07.25   UniquePtr(UniquePtr<U, E>&& aOther,
 0:07.25   ^
 0:07.25 /home/toybox/mozilla/fx-gtk3-dbg/dist/include/mozilla/UniquePtr.h:352:3: note: candidate constructor not viable: no known conversion from 'js::UniquePtr<SimpleEdgeRange>' (aka 'mozilla::UniquePtr<JS::ubi::SimpleEdgeRange, JS::DeletePolicy<JS::ubi::SimpleEdgeRange> >') to 'const mozilla::UniquePtr<JS::ubi::EdgeRange, JS::DeletePolicy<JS::ubi::EdgeRange> > &' for 1st argument
 0:07.25   UniquePtr(const UniquePtr& aOther) = delete; // construct using std::move()!
 0:07.25   ^

my mozconfig file is:

. $topsrcdir/browser/config/mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fx-gtk3-dbg

mk_add_options MOZ_MAK_FLAGS="-sj16"

mk_add_options AUTOCLOBBER=1

export CC="/usr/bin/clang -fgnu89-inline"
export CXX="/usr/bin/clang++"
export LLVM_SYMBOLIZER="/usr/bin/llvm-symbolizer-3.8"

ac_add_options --enable-default-toolkit=cairo-gtk3

ac_add_options --enable-debug
ac_add_options --enable-tests


or

removing export lines from the above.

IIRC, I succeeded to build on same environment 2 weeks ago. And I can build on Ubuntu 18.04.
This looks like bustage on a pretty old version of clang (3.8). Presumably just changing that from `return range;` to `return std::move(range);` should be good enough.
Assignee: nobody → kwright
Status: NEW → ASSIGNED
(In reply to Eric Rahm [:erahm] from comment #1)
> This looks like bustage on a pretty old version of clang (3.8). Presumably
> just changing that from `return range;` to `return std::move(range);` should
> be good enough.

SimpleEdgeRange is a subclass of EdgeRange so it may need to assume itself as an EdgeRange. IIRC, this could happen on clang 3.8 or earlier. Returning a UniquePtr<EdgeRange> should deal with it.
I am getting this on High Sierra MacOS

 9:05.92 In file included from /Users/dharvey/src/gecko/obj-x86_64-apple-darwin17.7.0/js/xpconnect/src/Unified_cpp_js_xpconnect_src0.cpp:83:
 9:05.92 /Users/dharvey/src/gecko/js/xpconnect/src/XPCJSRuntime.cpp:2913:12: error: no viable conversion from returned value of type 'UniquePtr<JS::ubi::SimpleEdgeRange>' to function return type 'UniquePtr<JS::ubi::EdgeRange>'
 9:05.92     return range;

~/src/gecko (inbound)$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
~/src/gecko (inbound)$ grep clang obj-x86_64-apple-darwin16.7.0/config.status
    'CC': '/usr/local/bin/ccache /usr/bin/clang -std=gnu99',
    'CC_TYPE': 'clang',
        '/usr/bin/clang',
    'CXX': '/usr/local/bin/ccache /usr/bin/clang++ -std=gnu++14',
        '/usr/bin/clang++',
    'HOST_CC': '/usr/local/bin/ccache /usr/bin/clang -std=gnu99',
    'HOST_CC_TYPE': 'clang',
    'HOST_CXX': '/usr/local/bin/ccache /usr/bin/clang++ -std=gnu++14',
    'MOZ_CLANG_PATH': '/usr/local/Cellar/llvm/4.0.1/bin/clang',
    '_CC': '/usr/bin/clang',
    '_CXX': '/usr/bin/clang++',
    '_HOST_CC': '/usr/bin/clang',
    '_HOST_CXX': '/usr/bin/clang++',

I have tried brew upgrade llvm but not helping
Priority: -- → P2
I ran into this today, my VM's clang is super out-of-date (3.8.1). :-/ Applying Kristen's patch fixed the error.
See Also: → 1472666
Attachment #8995592 - Flags: review+
Keywords: checkin-needed
Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a99bdd693233
Convert UniquePtr<SimpleEdgeRange> back to UniquePtr<EdgeRange> to return an EdgeRange. r=erahm
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a99bdd693233
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.