Bug 228289 - devel/RStudio fails to build on amd64
Summary: devel/RStudio fails to build on amd64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-16 10:06 UTC by Thomas Mueller
Modified: 2018-05-18 06:45 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
amd64 build fixes for devel/RStudio r470021 (3.46 KB, patch)
2018-05-16 10:06 UTC, Thomas Mueller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Mueller 2018-05-16 10:06:19 UTC
Created attachment 193449 [details]
amd64 build fixes for devel/RStudio r470021

Building devel/RStudio (1.1.451) on 11.1-STABLE r332554 amd64 fails
with what appears to be integer/pointer and pointer type mismatches in 
assignments:

[...]
In file included from /home/tmu/ports/RStudio/work/rstudio-1.1.451/src/cpp/core/spelling/hunspell/affentry.cxx:9:
/home/tmu/ports/RStudio/work/rstudio-1.1.451/src/cpp/core/spelling/hunspell/affentry.hxx:30:94: error: cannot initialize a parameter of type 'unsigned short' with an rvalue of type 'nullptr_t'
  struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                             ^          ~~~~

[...]
/home/tmu/ports/RStudio/work/rstudio-1.1.451/src/cpp/core/system/Process.cpp:239:21: note: in instantiation of function template specialization 'boost::function<void (bool, bool)>::operator=<nullptr_t>' requested here
   cb.onHasSubprocs = NULL;
[...]

The attached patch allows me to successfully build RStudio on amd64.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-16 15:20:52 UTC
RStudio (1.1.451) has built fine on 11.1-RELEASE-p6.

What is the clang version on your system?
Comment 2 Thomas Mueller 2018-05-16 15:57:46 UTC
tmu:~$ clang -v
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-16 16:24:57 UTC
It is known to break with clang-6. On 12 it also breaks with boost-related errors that they've never fixed.

About your patch, two things:
1. NULL should probably be replaced with nullptr.
2. It really belongs upstream. The right way is to create a pull request.


Thanks for the patch!
Yuri
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-16 20:31:47 UTC
The pull request: https://github.com/rstudio/rstudio/pull/2794
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-17 06:47:34 UTC
I couldn't make this patch work with clang5:

In file included from /usr/local/include/boost/function/detail/maybe_include.hpp:29:
/usr/local/include/boost/function/function_template.hpp:159:33: error: type 'std::__1::nullptr_t' does not provide a call operator
          BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
                                ^~~~
/usr/local/include/boost/function/function_template.hpp:81:36: note: expanded from macro 'BOOST_FUNCTION_RETURN'
#  define BOOST_FUNCTION_RETURN(X) X
                                   ^
/usr/local/include/boost/function/function_template.hpp:934:53: note: in instantiation of member function 'boost::detail::function::void_function_obj_invoker2<std::__1::nullptr_t, void, bool, bool>::invoke' requested here
        { { &manager_type::manage }, &invoker_type::invoke };
                                                    ^
/usr/local/include/boost/function/function_template.hpp:725:13: note: in instantiation of function template specialization 'boost::function2<void, bool, bool>::assign_to<std::__1::nullptr_t>' requested here
      this->assign_to(f);
            ^

It appears similar to how it currently breaks with clang6:
https://github.com/rstudio/rstudio/issues/2373

Fix of the above issue #2373 should also resolve your problem.

I don't think I can do anything more for this.
Comment 6 Thomas Mueller 2018-05-17 07:28:24 UTC
I only had my local system in view, thanks for the investigation.
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-18 03:00:45 UTC
This upstream commit is supposed to solve all clang issues, including this one: https://github.com/rstudio/rstudio/commit/ab3d4355ab5c7f4bc7af1f7aeabe62c3d1bbccec

I will update the port shortly with this patch included. Please retest and let me know if the problem wouldn't go away.
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-05-18 03:48:49 UTC
A commit references this bug:

Author: yuri
Date: Fri May 18 03:48:28 UTC 2018
New revision: 470259
URL: https://svnweb.freebsd.org/changeset/ports/470259

Log:
  devel/RStudio: Fix clang6/boost build errors

  Add the upstream commit https://github.com/rstudio/rstudio/commit/ab3d4355ab5c7f4bc7af1f7aeabe62c3d1bbccec
  that is supposed to fix clang6/boost build errors.

  PR:		228289

Changes:
  head/devel/RStudio/Makefile
  head/devel/RStudio/distinfo
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-05-18 03:58:59 UTC
A commit references this bug:

Author: yuri
Date: Fri May 18 03:58:25 UTC 2018
New revision: 470261
URL: https://svnweb.freebsd.org/changeset/ports/470261

Log:
  devel/RStudio: Remove the bogus comment

  PR:		228289

Changes:
  head/devel/RStudio/Makefile
Comment 10 Thomas Mueller 2018-05-18 06:33:13 UTC
(In reply to Yuri Victorovich from comment #7)

RStudio-1.1.453_1 built without errors on
   FreeBSD 11.1-STABLE r332554
using 
  $ clang --version
  FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
  Target: x86_64-unknown-freebsd11.1
  Thread model: posix
  InstalledDir: /usr/bin

Thanks!
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2018-05-18 06:45:17 UTC
(In reply to Thomas Mueller from comment #10)

Thanks for testing!

Yuri