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

Use variables to allow overriding build tools #108

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

dylanmccall
Copy link
Contributor

@dylanmccall dylanmccall commented Apr 18, 2022

In particular, this is useful for a situation where we want to use podman instead of docker, or where adb is not in $PATH.


# Run the docker image.
# TODO Would be better to just specify the file here?
run_docker: build_docker
./scripts/rundocker.sh
env DOCKER="$(DOCKER)" ./scripts/rundocker.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Equivalently, you can export DOCKER where it's set above like you would in a shell script. Otherwise this is basically the same as what I have locally to allow DOCKER=podman. I kind of like the export approach so you don't have to think about the places you want to pass it down, but there aren't many places it happens here so probably not a big deal.

@@ -21,6 +21,11 @@ ANDROIDNDKVER := 21.4.7075529

SDK := ${ANDROID_HOME}/android-sdk-$(PLATFORM)

ADB := adb
DOCKER := docker
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're handling DOCKER as an environment variable and not just a make variable, I think it might be nice to change this to DOCKER ?= docker. Then you could do export DOCKER=podman in your shell and not have to pass it in every time.

Copy link
Contributor

@dbnicholson dbnicholson left a comment

Choose a reason for hiding this comment

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

Looking this over again, I think it's fine the way you have it. However, I did find a couple spots you missed. Also, this will need to be rebased now since rundocker.sh is quite a bit different.

@@ -68,7 +73,7 @@ src/kolibri: clean

.PHONY: p4a_android_distro
p4a_android_distro: needs-android-dirs
p4a create --arch=$(P4A_ARCH)
$(P4A) create --arch=$(P4A_ARCH)
Copy link
Contributor

Choose a reason for hiding this comment

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

You missed a couple of instances of p4a below.

In particular, this is useful for a situation where we want to use
podman instead of docker, or where adb is not in $PATH.
Copy link
Contributor

@dbnicholson dbnicholson left a comment

Choose a reason for hiding this comment

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

I took the liberty of doing the rebase and fixing the p4a issue since I was trying to do something on top of this. From my perspective this is good to merge.

Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

Looks good to me as well! Tested with podman.

@dbnicholson dbnicholson mentioned this pull request Apr 22, 2022
@rtibbles rtibbles merged commit 4679d86 into learningequality:develop Apr 29, 2022
@dbnicholson dbnicholson deleted the add-tool-variables branch May 5, 2022 17:51
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.

4 participants