Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity files keep getting rebuilt (Version: rippled develop branch checkout) #3885

Closed
guidovranken opened this issue Jul 20, 2021 · 1 comment

Comments

@guidovranken
Copy link
Contributor

Issue Description

All the unity_*_cxx.cxx.o keep getting built anew after they've been built already.

The reason for this is that in the build step for soci, the include/soci/unsigned-types.h file is patched. This leads the build script to believe that a dependency (soci, in particular include/soci/unsigned-types.h) is newer than the target (unity_*_cxx.cxx.o) and a rebuild is in order.

Environment

Ubuntu x64

Supporting Files

To resolve this:

--- a/Builds/CMake/soci_patch.cmake
+++ b/Builds/CMake/soci_patch.cmake
@@ -1,6 +1,7 @@
 # This patches unsigned-types.h in the soci official sources
 # so as to remove type range check exceptions that cause
 # us trouble when using boost::optional to select int values
+if(NOT EXISTS "include/soci/unsigned-types.h.orig")
 file (STRINGS include/soci/unsigned-types.h sourcecode)
 foreach (line_ ${sourcecode})
   if (line_ MATCHES "^[ \\t]+throw[ ]+soci_error[ ]*\\([ ]*\"Value outside of allowed.+$")
@@ -10,6 +11,7 @@ foreach (line_ ${sourcecode})
 endforeach ()
 file (RENAME include/soci/unsigned-types.h include/soci/unsigned-types.h.orig)
 file (RENAME include/soci/unsigned-types.h.patched include/soci/unsigned-types.h)
+endif()
 # also fix Boost.cmake so that it just returns when we override the Boost_FOUND var
 file (APPEND cmake/dependencies/Boost.cmake.patched "if (Boost_FOUND)\n")
 file (APPEND cmake/dependencies/Boost.cmake.patched "  return ()\n")

I can put up a PR if you prefer that.

@ximinez
Copy link
Collaborator

ximinez commented Jul 20, 2021

I for one would love it if you would open a PR for this fix. I do ask that you indent the lines that are now inside the if/endif block.

ximinez pushed a commit to ximinez/rippled that referenced this issue Aug 26, 2021
ximinez pushed a commit to ximinez/rippled that referenced this issue Aug 27, 2021
ximinez pushed a commit to ximinez/rippled that referenced this issue Sep 8, 2021
* Patch the soci unsigned-types.h file. If no changes are made, delete
  the patched file and exit. If there are changes, backup the original
  and replace it with the patched file.
* Fixes XRPLF#3885
manojsdoshi pushed a commit to manojsdoshi/rippled that referenced this issue Sep 9, 2021
* Patch the soci unsigned-types.h file. If no changes are made, delete
  the patched file and exit. If there are changes, backup the original
  and replace it with the patched file.
* Fixes XRPLF#3885

Patch Rocksdb only once:

* The repeated patches do not appear to affect build times, but avoiding
  unnecessary copies is good for its own sake.
manojsdoshi pushed a commit to manojsdoshi/rippled that referenced this issue Sep 9, 2021
* Patch the soci unsigned-types.h file. If no changes are made, delete
  the patched file and exit. If there are changes, backup the original
  and replace it with the patched file.
* Fixes XRPLF#3885

Patch Rocksdb only once:

* The repeated patches do not appear to affect build times, but avoiding
  unnecessary copies is good for its own sake.
manojsdoshi pushed a commit to manojsdoshi/rippled that referenced this issue Sep 9, 2021
* Patch the soci unsigned-types.h file. If no changes are made, delete
  the patched file and exit. If there are changes, backup the original
  and replace it with the patched file.
* Fixes XRPLF#3885

Patch Rocksdb only once:

* The repeated patches do not appear to affect build times, but avoiding
  unnecessary copies is good for its own sake.
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 a pull request may close this issue.

2 participants