Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible/roles/caret/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
pip:
requirements: "{{ requirements_path }}"
executable: pip3
extra_args: "{{ '--break-system-packages' if ansible_distribution_version >= '24.04' else '' }}"
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/caret_iron/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
pip:
requirements: "{{ requirements_path }}"
executable: pip3
extra_args: "{{ '--break-system-packages' if ansible_distribution_version >= '24.04' else '' }}"
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/caret_jazzy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
pip:
requirements: "{{ requirements_path }}"
executable: pip3
extra_args: "{{ '--break-system-packages' if ansible_distribution_version >= '24.04' else '' }}"
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/ros-tracing/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pip:
requirements: "{{ requirements_path }}"
executable: pip3
extra_args: "{{ '--break-system-packages' if ansible_distribution_version >= '24.04' else '' }}"
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/visualizer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pip:
requirements: "{{ requirements_path }}"
executable: pip3
extra_args: --ignore-installed
extra_args: --ignore-installed "{{ '--break-system-packages' if ansible_distribution_version >= '24.04' else '' }}"
become: false
args:
chdir: "{{ WORKSPACE_ROOT }}"
20 changes: 19 additions & 1 deletion setup_caret.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ function show_usage() {
echo " -c or --no-interactive"
echo " -n or --no-package-install"
echo " -d or --ros-distro"
echo ""
echo "Required for ROS 2 Jazzy (Ubuntu 24.04+):"
echo " export ALLOW_BREAK_SYSTEM_PACKAGES=true"
echo " (Allows pip to install packages into the system Python environment / PEP 668)"
exit 0
}

Expand Down Expand Up @@ -62,6 +66,20 @@ done
# Check ROS Distribution
validate_ros_distro "$ros_distro"

# Jazzy Specific Check for PEP 668 ---
if [ "$ros_distro" = "jazzy" ]; then
if [ "${ALLOW_BREAK_SYSTEM_PACKAGES:-false}" != "true" ]; then
echo -e "\e[31m[ERROR] Ubuntu 24.04 (Jazzy) detected.\e[0m"
echo "Starting from this version, pip installation into system packages is restricted by default."
echo "To proceed with the installation, please run the following command first to acknowledge the risk:"
echo ""
echo -e " \e[36m"export ALLOW_BREAK_SYSTEM_PACKAGES=true"\e[0m"
echo ""
echo "Then, run this setup script again."
exit 1
fi
fi

# Confirm whether to start installation
if [ $noninteractive -eq 0 ]; then
# Prevent root execution in interactive mode
Expand Down Expand Up @@ -97,7 +115,7 @@ fi
# Run ansible if confirmed
# Install ansible
if [ "$ros_distro" = "jazzy" ]; then
pip3 install -U ansible
pip3 install -U ansible --break-system-packages
else
ansible_version=$(pip3 list | grep -oP "^ansible\s+\K([0-9]+)" || true)
if [ "$ansible_version" != "6" ]; then
Expand Down
Loading