Skip to content

Commit

Permalink
Needed to add some proxy stuff so I can test this within MIT
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Dec 27, 2024
1 parent 3be241a commit 7f16d9d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 20 deletions.
34 changes: 29 additions & 5 deletions panda/debian/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,41 @@ if [[ ! -f "../dependencies/ubuntu_${version}_base.txt" ]]; then
fi

# Build the installer to generate the wheel file
DOCKER_BUILDKIT=1 docker build --target installer -t panda_installer --build-arg BASE_IMAGE="ubuntu:${version}" ../..
DOCKER_BUILDKIT=1 docker build \
--target installer \
-t panda_installer \
--build-arg HTTP_PROXY="${HTTP_PROXY}" \
--build-arg HTTPS_PROXY="${HTTPS_PROXY}" \
--build-arg BASE_IMAGE="ubuntu:${version}" \
../..

# Copy wheel file out of container to host
# This also preserves wheel name, which is important as pip install WILL fail if you arbitarily change the generated wheel file name
docker run --rm -v $(pwd):/out panda_installer bash -c "cp /panda/panda/python/core/dist/*.whl /out"
# This also preserves wheel name, which is important as pip install WILL fail if you arbitrarily change the generated wheel file name
docker run --rm \
-v $(pwd):/out \
-e HTTP_PROXY="${HTTP_PROXY}" \
-e HTTPS_PROXY="${HTTPS_PROXY}" \
panda_installer \
bash -c "cp /panda/panda/python/core/dist/*.whl /out"

# Finish building main panda container for the target ubuntu version
DOCKER_BUILDKIT=1 docker build --cache-from panda_installer --target panda -t panda --build-arg BASE_IMAGE="ubuntu:${version}" ../..
DOCKER_BUILDKIT=1 docker build \
--cache-from panda_installer \
--target panda \
-t panda \
--build-arg HTTP_PROXY="${HTTP_PROXY}" \
--build-arg HTTPS_PROXY="${HTTPS_PROXY}" \
--build-arg BASE_IMAGE="ubuntu:${version}" \
../..

# Now build the packager container from that
DOCKER_BUILDKIT=1 docker build --cache-from panda -t packager --build-arg PACKAGE_VERSION="${tag_version}" .
DOCKER_BUILDKIT=1 docker build \
--cache-from panda \
-t packager \
--build-arg HTTP_PROXY="${HTTP_PROXY}" \
--build-arg HTTPS_PROXY="${HTTPS_PROXY}" \
--build-arg PACKAGE_VERSION="${tag_version}" \
.

# Copy deb file out of container to host
docker run --rm -v $(pwd):/out packager bash -c "cp /pandare.deb /out"
Expand Down
41 changes: 26 additions & 15 deletions panda/src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ const char* INSTALL_BIN_DIR; // libpanda-arch.so and panda-system-arch in here
const gchar *panda_bool_true_strings[] = {"y", "yes", "true", "1", NULL};
const gchar *panda_bool_false_strings[] = {"n", "no", "false", "0", NULL};

const char * panda_system_paths[] = {
"/usr/bin/panda-system-aarch64",
"/usr/bin/panda-system-arm",
"/usr/bin/panda-system-i386",
"/usr/bin/panda-system-mips",
"/usr/bin/panda-system-mips64",
"/usr/bin/panda-system-mips64el",
"/usr/bin/panda-system-mipsel",
"/usr/bin/panda-system-ppc",
"/usr/bin/panda-system-x86_64",
NULL
};

#if 0
###########################################################
WARNING: This is all gloriously thread-unsafe!!!
Expand Down Expand Up @@ -156,12 +169,12 @@ static bool load_libpanda(void) {
g_free((char *)panda_lib);
}

if (access("/usr/bin/libpanda-i386.so", F_OK) != -1) {
// File exists
INSTALL_BIN_DIR = "/usr/bin";
} else {
// File does not exist
INSTALL_BIN_DIR = "/usr/local/bin/";
INSTALL_BIN_DIR = "/usr/local/bin/";
for (int i = 0; panda_system_paths[i] != NULL; i++) {
if (access(panda_system_paths[i], F_OK) != -1) {
INSTALL_BIN_DIR = "/usr/bin";
break;
}
}

// Try standard install location
Expand Down Expand Up @@ -358,17 +371,15 @@ char* resolve_file_from_plugin_directory(const char* file_name_fmt, const char*
return plugin_path;
}
g_free(plugin_path);


if (access("/usr/bin/libpanda-i386.so", F_OK) != -1) {
// File exists
INSTALL_PLUGIN_DIR = "/usr/lib/panda";
} else {
// File does not exist
INSTALL_PLUGIN_DIR = "/usr/local/lib/panda/";

INSTALL_PLUGIN_DIR = "/usr/local/lib/panda/";
for (int i = 0; panda_system_paths[i] != NULL; i++) {
if (access(panda_system_paths[i], F_OK) != -1) {
INSTALL_PLUGIN_DIR = "/usr/lib/panda";
break;
}
}


// Third, check relative to the standard install location.
plugin_path = attempt_normalize_path(
g_strdup_printf("%s/%s/%s", INSTALL_PLUGIN_DIR,
Expand Down

0 comments on commit 7f16d9d

Please sign in to comment.