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

helpers: Share sb2 target per family instead of per device and allow overriding scratchbox2 target used during build #324

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Thaodan
Copy link
Contributor

@Thaodan Thaodan commented Apr 25, 2022

  • helpers: Share sb2 target per family instead of per device
  • helpers: Allow overriding of scratchbox2 target used during build

Copy link
Contributor

@sledges sledges left a comment

Choose a reason for hiding this comment

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

We have renamed the terms to "build target" instead of "sb2 target", please revise your commit descriptions.

Minor typos:
would be than build per device ->
would be then build per device

SailfishOS -> Sailfish OS

--
This PR lays the groundwork for target override to be able to support multi-device multi-version build environments in the future.

helpers/util.sh Outdated Show resolved Hide resolved
helpers/util.sh Outdated Show resolved Hide resolved
@@ -70,6 +70,10 @@ LOCAL_REPO=$ANDROID_ROOT/droid-local-repo/$DEVICE
mkdir -p $LOCAL_REPO
PLUS_LOCAL_REPO="--plus-repo $LOCAL_REPO"

if [ -z $HABUILD_TARGET ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

If build target override is used to build for another Sailfish OS version, the MW packages in the droid-local-repo built against another SFOS version should not be pulled into the new target.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we check for that or ask the to take care of this? The SFOS version isn't directly an indicator of breaking changes, it can but it doesn't have too.
Often breaking changes are in this repo or droid-configs and its dependencies.

$PACKAGE_TIMELINE $NO_AUTO_VERSION \
--output-dir "$LOCAL_REPO" \
build >>$LOG 2>&1|| die "building of package failed"
build --no-check >>$LOG 2>&1|| die "building of package failed"
Copy link
Contributor

Choose a reason for hiding this comment

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

I've built packages for i3113, then ran export DEVICE=i4113 and mb2 is still checking places of the previous device:

PlatformSDK $ANDROID_ROOT $ rpm/dhd/helpers/build_packages.sh --version
* Building rpm/droid-hal-version-i4113.spec 
Checking whether to refresh metadata for dir:$ANDROID_ROOT/hybris/droid-hal-version-i3113/.mb2/filtered-output-dir

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm for kumano this works fine for me:

bidar@odin:~/dev/sailfish/hadk/kumano|21:59$ ./rpm/dhd/helpers/build_packages.sh --version
* Building rpm/droid-hal-version-j9210.spec 
Checking whether to refresh metadata for dir:/home/bidar/dev/sailfish/hadk/kumano/hybris/droid-hal-version-sony-kumano/.mb2/filtered-output-dir

@@ -71,7 +71,7 @@ mkdir -p $LOCAL_REPO
PLUS_LOCAL_REPO="--plus-repo $LOCAL_REPO"
Copy link
Contributor

Choose a reason for hiding this comment

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

Two lines above it sets LOCAL_REPO=$ANDROID_ROOT/droid-local-repo/$DEVICE so even when using target for common family of boards, middleware RPMs would still need to somehow be made available for each $DEVICE in its local repo (TMTOWTDI).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the local repo to be shared too.

@Thaodan Thaodan force-pushed the use_family_for_sb2_target_override branch from 361c34e to 7ff1122 Compare April 28, 2022 22:01
Thaodan added 3 commits April 29, 2022 01:06
This allows overriding of the scratchbox2 build target used during build by
setting $HABUILD_TARGET before building.
This can be useful to use different targets with e.g. different
Sailfish OS versions during build.

[helpers] Allow overriding of build target used during build. JB#58030

Signed-off-by: Björn Bidar <[email protected]>
When building for devices with a common family of boards it makes
sense to just reuse that target instead of having a target per device.
This also allows skipping of building every middleware package that
would be than build per device.

[helpers] Share build target between devices of the same family instead of per device. JB#58030

Signed-off-by: Björn Bidar <[email protected]>
[helpers] Share local repositories between per family instead of device. JB#58030
@Thaodan Thaodan force-pushed the use_family_for_sb2_target_override branch from 7ff1122 to f27cec1 Compare April 28, 2022 22:07
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.

2 participants