-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
One build directory per branch/arch. #4286
Conversation
cslashm
commented
Aug 20, 2018
•
edited
Loading
edited
Makefile
Outdated
@@ -26,105 +26,109 @@ | |||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | |||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
|
|||
|
|||
subbuilddir:=$(shell uname -o|sed -e 's|/|_|g')/$(shell git branch |grep '\* ' |cut -f2 -d' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think windows might not like that. Can someone with mingw test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test it under win7. The sample tree is mine
Makefile
Outdated
mkdir -p build/debug | ||
cd build/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../.. | ||
mkdir -p build/$(subbuilddir)/debug | ||
cd build/$(subbuilddir)/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../../../.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a branch name in this, then you need to start quoting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And replacing / with something else (I do have a branch with a / in so it's not pedantic :P)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooops, never thought about / in a branch name :D
Ok I will add some quote here and there and test with OMG branch name.(I just mod the Makefile for my own purpose and thought it could be useful for other with too slow machine :p)
Also, check whether unit tests --data-dir need fixing to add two ../ |
dd46e3d
to
285e6c7
Compare
|
If these changes are beneficial for monero, then moneroexamples can be adopted to this change. However, I don't know how this change will propagate when checking out older monero releases, which I often do? For example if I make new branch based on v12.3.0 ( |
Is it an acceptable solution (hack?) to copy in the old scheme the last binaries build? |
285e6c7
to
e31ea98
Compare
@stoffu I only need |
I've tried it, and I realised it does spam the build tree a lot. If you have lots of branches, you end up having to manually clean all the time. |
@cslashm please rebase. |
@moneromooo-monero nice idea, I will mod @luigi1111, I merge the proposition from moneromooo and rebase that. I hope tomorrow, the day after else. |
f9006ba
to
ea96ceb
Compare
|
If I build with HEAD detached, space and parenthesis characters in the build directory name cause syntax errors:
Fix: @@ -28,7 +28,7 @@
ANDROID_STANDALONE_TOOLCHAIN_PATH ?= /usr/local/toolchain
-subbuilddir:=$(shell echo `uname | sed -e 's|[:/\\]|_|g'`/`git branch | grep '\* ' | cut -f2- -d' '| sed -e 's|[:/\\]|_|g'`)
+subbuilddir:=$(shell echo `uname | sed -e 's|[:/\\ \(\)]|_|g'`/`git branch | grep '\* ' | cut -f2- -d' '| sed -e 's|[:/\\ \(\)]|_|g'`)
ifeq ($(USE_SINGLE_BUILDDIR),)
builddir="build/$(subbuilddir)"
else |
As for 3rd party software: @moneroexamples
@sammy007 |
f62a5e7
to
02d8bfc
Compare
@stoffu add both: your last proposition-edit plus a modification of your first one in clean rule |
Makefile
Outdated
builddir="build/$(subbuilddir)" | ||
else | ||
builddir="build" | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces distinct levels of subdirectories, but the number of ../
is fixed. So for me, it doesn't work when using USE_SINGLE_BUILDDIR=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I used -C all the time...
https://paste.debian.net/hidden/3254c3ef/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault too I would have to test it...
This proposal allows to perform multiple compilation from different branch/arch in separate directories. Example: build ├── GNU_Linux │ ├── multi-compilation │ │ └── release │ └── NanoS-USBHID │ └── release └── Msys └── NanoS-USBHID └── release Edit 1: Try to handle special char as : / \ . --data-dir in unit test not yet tested Edit 2: donot use param for uname. -o is not supported by MacOS.
02d8bfc
to
b4679f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed
b4679f3 One build directory per branch/arch. (cslashm)