Fix rustup not found in Docker

This commit is contained in:
daijro 2024-07-27 18:10:37 -05:00
parent 5b6de88f97
commit a48c4140f9
2 changed files with 6 additions and 4 deletions

View file

@ -1,4 +1,4 @@
FROM python:3.11-slim-bullseye FROM ubuntu:latest
WORKDIR /app WORKDIR /app
@ -9,6 +9,8 @@ COPY . /app
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
# Makefile utils # Makefile utils
build-essential make git msitools wget unzip \ build-essential make git msitools wget unzip \
# Python
python3 python3-dev python3-pip \
# Camoufox build system utils # Camoufox build system utils
p7zip-full golang-go p7zip-full golang-go

View file

@ -101,7 +101,7 @@ def list_files(root_dir, suffix='*.patch'):
def add_rustup(*targets): def add_rustup(*targets):
for rust_target in 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 # Set cross building
print(f'Using target: {moz_target}') print(f'Using target: {moz_target}')
_update_mozconfig() _update_mozconfig()
_update_rustup()
# Copy the search-config.json file # Copy the search-config.json file
run('cp -v ../assets/search-config.json services/settings/dumps/main/search-config.json') 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}") raise ValueError(f"Unsupported target: {target}")
def _update_rustup(): def _update_rustup(target):
if target == "linux": if target == "linux":
add_rustup("aarch64-unknown-linux-gnu", "i686-unknown-linux-gnu") add_rustup("aarch64-unknown-linux-gnu", "i686-unknown-linux-gnu")
elif target == "windows": elif target == "windows":
@ -257,6 +256,7 @@ if __name__ == "__main__":
else: else:
target, arch = "linux", "x86_64" target, arch = "linux", "x86_64"
moz_target = _get_moz_target() moz_target = _get_moz_target()
_update_rustup(target=target)
# Check if the folder exists # Check if the folder exists
if not os.path.exists(f'camoufox-{version}-{release}/configure.py'): if not os.path.exists(f'camoufox-{version}-{release}/configure.py'):