From a48c4140f9441d8e180ac90c14543c2a8fcbac03 Mon Sep 17 00:00:00 2001 From: daijro Date: Sat, 27 Jul 2024 18:10:37 -0500 Subject: [PATCH] Fix rustup not found in Docker --- Dockerfile | 4 +++- scripts/patch.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a3c9d82..7ca56d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim-bullseye +FROM ubuntu:latest WORKDIR /app @@ -9,6 +9,8 @@ COPY . /app RUN apt-get update && apt-get install -y \ # Makefile utils build-essential make git msitools wget unzip \ + # Python + python3 python3-dev python3-pip \ # Camoufox build system utils p7zip-full golang-go diff --git a/scripts/patch.py b/scripts/patch.py index bdaa7fa..6eabb1c 100644 --- a/scripts/patch.py +++ b/scripts/patch.py @@ -101,7 +101,7 @@ def list_files(root_dir, suffix='*.patch'): def add_rustup(*targets): for rust_target in targets: - os.system(f'rustup target add "{rust_target}"') + os.system(f'~/.cargo/bin/rustup target add "{rust_target}"') """ @@ -117,7 +117,6 @@ def camoufox_patches(): # Set cross building print(f'Using target: {moz_target}') _update_mozconfig() - _update_rustup() # Copy the search-config.json file run('cp -v ../assets/search-config.json services/settings/dumps/main/search-config.json') @@ -176,7 +175,7 @@ def _get_moz_target(): raise ValueError(f"Unsupported target: {target}") -def _update_rustup(): +def _update_rustup(target): if target == "linux": add_rustup("aarch64-unknown-linux-gnu", "i686-unknown-linux-gnu") elif target == "windows": @@ -257,6 +256,7 @@ if __name__ == "__main__": else: target, arch = "linux", "x86_64" moz_target = _get_moz_target() + _update_rustup(target=target) # Check if the folder exists if not os.path.exists(f'camoufox-{version}-{release}/configure.py'):