Patch #3254 2012-02-18 04:49

alpha0010

Bundle Boost dependency (Windows)
Download
3254-Bundle_Boost_d.patch (2753.2 KB)
Category
Plugin::Refinement
Status
Out of date
Close date
2012-06-28 05:47
Assigned to
mortenmacfly
Index: plugins/contrib/NassiShneiderman/boost_1_48/boost/call_traits.hpp
===================================================================
--- plugins/contrib/NassiShneiderman/boost_1_48/boost/call_traits.hpp    (revision 0)
+++ plugins/contrib/NassiShneiderman/boost_1_48/boost/call_traits.hpp    (working copy)
@@ -0,0 +1,24 @@
+//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+//  Use, modification and distribution are subject to the Boost Software License,
+//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt).
+//
+//  See http://www.boost.org/libs/utility for most recent version including documentation.
+
+//  See boost/detail/call_traits.hpp and boost/detail/ob_call_traits.hpp
+//  for full copyright notices.
+
+#ifndef BOOST_CALL_TRAITS_HPP
+#define BOOST_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/detail/ob_call_traits.hpp>
+#else
+#include <boost/detail/call_traits.hpp>
+#endif
+
+#endif // BOOST_CALL_TRAITS_HPP
Index: plugins/contrib/NassiShneiderman/boost_1_48/boost/assert.hpp
===================================================================
--- plugins/contrib/NassiShneiderman/boost_1_48/boost/assert.hpp    (revision 0)
+++ plugins/contrib/NassiShneiderman/boost_1_48/boost/assert.hpp    (working copy)
@@ -0,0 +1,131 @@
+//
+//  boost/assert.hpp - BOOST_ASSERT(expr)
+//                     BOOST_ASSERT_MSG(expr, msg)
+//                     BOOST_VERIFY(expr)
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//  Copyright (c) 2007 Peter Dimov
+//  Copyright (c) Beman Dawes 2011
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//  Note: There are no include guards. This is intentional.
+//
+//  See http://www.boost.org/libs/utility/assert.html for documentation.
+//
+
+//
+// Stop inspect complaining about use of 'assert':
+//
+// boostinspect:naassert_macro
+//
+
+//--------------------------------------------------------------------------------------//
+//                                     BOOST_ASSERT                                     //
+//--------------------------------------------------------------------------------------//
+
+#undef BOOST_ASSERT
+
+#if defined(BOOST_DISABLE_ASSERTS)
+
+# define BOOST_ASSERT(expr) ((void)0)
+
+#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
+
+#include <boost/current_function.hpp>
+
+namespace boost
+{
+  void assertion_failed(char const * expr,
+                        char const * function, char const * file, long line); // user defined
+} // namespace boost
+
+#define BOOST_ASSERT(expr) ((expr) \
+  ? ((void)0) \
+  : ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
+
+#else
+# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
+# define BOOST_ASSERT(expr) assert(expr)
+#endif
+
+//--------------------------------------------------------------------------------------//
+//                                   BOOST_ASSERT_MSG                                   //
+//--------------------------------------------------------------------------------------//
+
+# undef BOOST_ASSERT_MSG
+
+#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG)
+
+  #define BOOST_ASSERT_MSG(expr, msg) ((void)0)
+
+#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
+
+  #include <boost/current_function.hpp>
+
+  namespace boost
+  {
+    void assertion_failed_msg(char const * expr, char const * msg,
+                              char const * function, char const * file, long line); // user defined
+  } // namespace boost
+
+  #define BOOST_ASSERT_MSG(expr, msg) ((expr) \
+    ? ((void)0) \
+    : ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
+
+#else
+  #ifndef BOOST_ASSERT_HPP
+    #define BOOST_ASSERT_HPP
+    #include <cstdlib>
+    #include <iostream>
+    #include <boost/current_function.hpp>
+
+    //  IDE's like Visual Studio perform better if output goes to std::cout or
+    //  some other stream, so allow user to configure output stream:
+    #ifndef BOOST_ASSERT_MSG_OSTREAM
+    # define BOOST_ASSERT_MSG_OSTREAM std::cerr
+    #endif
+
+    namespace boost
+    {
+      namespace assertion
+      {
+        namespace detail
+        {
+          inline void assertion_failed_msg(char const * expr, char const * msg, char const * function,
+            char const * file, long line)
+          {
+            BOOST_ASSERT_MSG_OSTREAM
+              << "***** Internal Program Error - assertion (" << expr << ") failed in "
+              << function << ":\n"
+              << file << '(' << line << "): " << msg << std::endl;
+            std::abort();
+          }
+        } // detail
+      } // assertion
+    } // detail
+  #endif
+
+  #define BOOST_ASSERT_M
download for full patch...
tpetrov 2012-02-19 13:21

Hm, what is the true purpose of this patch?

Putting boost files in our svn?

alpha0010 2012-02-23 01:45

Yes; I think it makes much more sense to include this small 3% of the Boost library that is used, rather than force the download of the entire library simply to build the Nassi Shneiderman plugin.

I believe this build convenience is a similar idea to that of, for example, the AStyle plugin.

I only patched the Windows build system, however I would assume the Linux build system could be patched to use these files as well without too much hassle.

mortenmacfly 2012-02-25 20:12

I like the idea, but if its Windows only, it makes no sense to bundle it. Resolving the dependency on Windows is as easy as to extract a 7z archive (the boost one). On Linux this is different. So either this works on all platforms, or it doesn't really bring a benefit other that stealing SVN bandwidth. :-(

alpha0010 2012-02-26 22:14

Although downloading and extracting the full boost archive is easy, it is very time (and somewhat space) consuming (at least for me), which is why I proposed this. However, you are right, this patch should be postponed consideration until I (or someone else) has a chance to complete and test it on Linux platforms (I am fairly certain it contains all - or nearly all - the correct files already, only the .cbp and Makefile.am must be patched).

tpetrov 2012-03-09 14:13

Keep in mind that most distributions don't like the bundling of common libraries in a source of a project. They feel this is a bad practice (security issues, code duplication, etc).

I don't like it, too.

The way to go with this one is to provide a downloadable archive with all the files pre-build or in build-able configuration, so users like you can save time.

What is the problem of just downloading a 50mb file and then extracting it? You have to do this once.

Or just disable the build of the only plugin requiring it? Do you use it at all?

alpha0010 2012-03-10 01:19

It would be a simple matter for me to instead provide an archive of this portion of Boost, however, I am unsure of where I would store it for others to find/make use of. I could put it on my SkyDrive, but that looks rather unofficial, likely causing many of the "would-be time saver users" to instead opt for the official version (negating any benefit).

Would you suggest I abandon this idea?

Do you have a more-official looking location the archive could be hosted at?

(With respects to my problem with Boost - as you mentioned, I like to save time. I also dislike that a library as large as Boost cannot be easily decoupled, so that one only needs carry around the parts they use. But this is just my opinion.)