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

buildsystem: add possibility to move the build paths outside the git … #3140

Merged
merged 1 commit into from
Jan 8, 2020

Conversation

InuSasha
Copy link
Member

@InuSasha InuSasha commented Nov 30, 2018

…tree

builds can be placed on different (faster) disk.
The normal behavior unchanged. To change the path only add BUILD_ROOT=/build-dev in your .libreelec/options
For use with multiple git-workspaces BUILD_ROOT=/build-dev/$(basename $ROOT) is better.

tested with: generic & rpi2 builds (incl. all addons)

@vpeter4
Copy link
Contributor

vpeter4 commented Nov 30, 2018

This is ridiculous. Just put whole LE on this faster disk and you are done. Seems LE is folowing Kodi development path lately: "let's change things just because we can".

@antonlacon
Copy link
Contributor

Does PR3147 meet your needs?

@vpeter4
Copy link
Contributor

vpeter4 commented Dec 4, 2018

My special needs/requirements are taking care with my own build. But I don't push them to LE just to make my life easier. There are lot of commits lately which would not be even considered to be included few years back. But who am I to judge. Seems messing with build system must be really fun :) Even if not broken.

@MilhouseVH
Copy link
Contributor

While I do agree this requirement is niche, it is consistent with previous changes (see #2348), so I would be inclined to accept this change but possibly not in the current form - I'd suggest introducing a BUILD_DIR override (either from the command line, or $HOME/.libreelec/options etc.).

This means in config/path, adding:

BUILD_ROOT=${BUILD_DIR:-${ROOT}}

and then in config/path, changing:

-BUILD=$ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$LIBREELEC_VERSION
+BUILD=$BUILD_ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$LIBREELEC_VERSION
 if [ "$LIBREELEC_VERSION" = "devel" ] ; then
-  BUILD=$ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$OS_VERSION-$LIBREELEC_VERSION
+  BUILD=$BUILD_ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$OS_VERSION-$LIBREELEC_VERSION
 fi

As an aside, I'm really not sure what value there is in BUILD_BASE=build and think that could be dropped entirely, so that we just hard-code build. where necessary... so we could just have, at the top of config/path, something like...

PACKAGES=packages
SOURCES=${SOURCES_DIR:-${ROOT}/sources}
BUILD_ROOT=${BUILD_DIR:-${ROOT}}
TARGET_IMG=${TARGET_DIR:-${ROOT}/target}

@MilhouseVH
Copy link
Contributor

MilhouseVH commented Dec 4, 2018

Note that @antonlacon has identified some other areas where ${ROOT}/${BUILD_BASE} is used (ie. scripts/build, scripts/clean) which may need addressing in this PR (and could justify a $BUILD_BASE variable for build.)...

@InuSasha
Copy link
Member Author

InuSasha commented Dec 4, 2018

I take a look, to adjust the change. I will compare to SOURCE_DIR and TARGET_DIR

I am a bit paranoid, after a disk crash and use only backuped or raids for working paths. These are slow, but more protected. But all run/build-paths on fast constructions.

tools/dashboard Outdated Show resolved Hide resolved
@InuSasha
Copy link
Member Author

@MilhouseVH i switchted to your BASE_PREFIXsuggestion.
Also i added -e to the shebang -> no need for die

tools/dashboard Outdated Show resolved Hide resolved
@@ -1,5 +1,6 @@
# build directorys
/build.*/
/builds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. possible name for a symlink to right location

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What symlink? AFAICS nothing uses /builds and this patch gets rid of the need to symlink anything?

Copy link
Member Author

@InuSasha InuSasha Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you moved the build-root outside, you may want to access it fast.
so a symlink builds to the new location will be fine ;)

@dhewg
Copy link
Contributor

dhewg commented Nov 21, 2019

The clean targets in the toplevel Makefile need changes too

@InuSasha
Copy link
Member Author

this will be difficult: because we do not know, if we can delete all at the new location.
Everyone who move it outside the default location, has to cleanup it self.

@dhewg
Copy link
Contributor

dhewg commented Nov 21, 2019

I don't know why this should be ridiculous, but I'm using this ;)

Usecase: fast box with lots of RAM and just a SSD. Building the whole of LE on that doesn't exactly go easy on the drive and wears it out too fast. So I build it on a 30gb ramdisk. And no, I don't want to move my git tree there ;)

@dhewg
Copy link
Contributor

dhewg commented Nov 21, 2019

this will be difficult: because we do not know, if we can delete all at the new location.
Everyone who move it outside the default location, has to cleanup it self.

Good point.

Overall, this fits in nicely with e.g. SOURCES_DIR and TARGET_DIR, so I don't see a reason for not merging it

@MilhouseVH
Copy link
Contributor

Let's see what breaks... 😄

@MilhouseVH MilhouseVH merged commit 06e0928 into LibreELEC:master Jan 8, 2020
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 this pull request may close these issues.

None yet

5 participants