Skip to content

Commit

Permalink
Build: Use pipenv sync --system instead of requirements.txt
Browse files Browse the repository at this point in the history
When pipenv dumps the lock file to a requirements.txt, it does not
include the `sys_platform` directive. This causes pip to attempt to
install win32 packages, which fails. By using `pypenv sync --system`
instead, only packages applicable to Linux are installed.

Fixes #1993
  • Loading branch information
mssalvatore committed Jun 9, 2022
1 parent 1b2ca74 commit b8a5245
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions build_scripts/appimage/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,10 @@ install_monkey_island_python_dependencies() {
log_message "Installing pipenv"
"$APPDIR"/AppRun -m pip install pipenv || handle_error

requirements_island="$BUILD_DIR/monkey_island/requirements.txt"
generate_requirements_from_pipenv_lock "$requirements_island"

log_message "Installing island python requirements"
"$APPDIR"/AppRun -m pip install -r "${requirements_island}" --ignore-installed || handle_error
}

generate_requirements_from_pipenv_lock () {
local requirements_island=$1

log_message "Generating a requirements.txt file with 'pipenv requirements'"
pushd "$BUILD_DIR/monkey_island"
"$APPDIR"/AppRun -m pipenv --python "$APPDIR/AppRun" requirements --hash > "$requirements_island" || handle_error
popd
log_message "Installing dependencies"
pushd "$BUILD_DIR/monkey_island" || handle_error
"$APPDIR"/AppRun -m pipenv --python "$APPDIR/AppRun" sync --system || handle_error
popd || handle_error
}


Expand Down

0 comments on commit b8a5245

Please sign in to comment.