Fix: Crash in install_linux_packages.py script #106461

Merged
Bastien Montagne merged 2 commits from bvpav/blender:install-linux-packages-fix into main 2023-04-10 21:13:11 +02:00
Contributor

There is a KeyError exception when the install_linux_packages.py build script is ran with --distro-id:

$ ./build_files/build_environment/install_linux_packages.py --distro-id arch
INFO:     Distribution identifier forced by user to arch.
Traceback (most recent call last):
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1656, in <module>
    main()
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1646, in main
    distro_package_installer = PackageInstaller(settings) if settings.show_deps else get_distro_package_installer(settings)
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1570, in get_distro_package_installer
    return DISTRO_IDS_INSTALLERS[get_distro(settings)](settings)
KeyError: None

This happens because the get_distro function returns None if the distribution ID is forced with the --distro-id option, when it should return the provided value.

There is a `KeyError` exception when the `install_linux_packages.py` build script is ran with `--distro-id`: ```console $ ./build_files/build_environment/install_linux_packages.py --distro-id arch INFO: Distribution identifier forced by user to arch. Traceback (most recent call last): File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1656, in <module> main() File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1646, in main distro_package_installer = PackageInstaller(settings) if settings.show_deps else get_distro_package_installer(settings) File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1570, in get_distro_package_installer return DISTRO_IDS_INSTALLERS[get_distro(settings)](settings) KeyError: None ``` This happens because the `get_distro` function returns `None` if the distribution ID is forced with the `--distro-id` option, when it should return the provided value.
bvpav added 1 commit 2023-04-02 17:37:04 +02:00
This fixes a KeyError exception when running `install_linux_packages.py`
with `--distro-id`. The exception was thrown, because of a bare return
in `get_distro`, which caused a dict to be indexed with `None`.
Brecht Van Lommel requested review from Bastien Montagne 2023-04-05 18:04:34 +02:00
Bastien Montagne approved these changes 2023-04-05 19:32:11 +02:00

@bvpav thanks!

Can you please update your patch against latest main branch? That way we can merge it directly from the gitea webapp. ;)

@bvpav thanks! Can you please update your patch against latest main branch? That way we can merge it directly from the gitea webapp. ;)
bvpav added 1 commit 2023-04-10 10:51:14 +02:00
Author
Contributor

@mont29 of course!

Sorry for the wait :^)

@mont29 of course! Sorry for the wait :^)
Bastien Montagne merged commit 8dae058768 into main 2023-04-10 21:13:11 +02:00
Bastien Montagne deleted branch install-linux-packages-fix 2023-04-10 21:13:12 +02:00

No problem, thanks for the update! :)

No problem, thanks for the update! :)
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#106461
No description provided.