macOS: improve bpy build system support #86579

Closed
opened 2 years ago by ankitm · 17 comments
ankitm commented 2 years ago
Collaborator

[1]

ERROR: Interceptors are not working. This may be because AddressSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with:
DYLD_INSERT_LIBRARIES=/path/to/libclang_rt.asan_osx_dynamic.dylib
- [x] Fix documentation on the wiki that causes issue like in blender/blender-addons#58069 (done in https://wiki.blender.org/w/index.php?title=Building_Blender%2FOther%2FBlenderAsPyModule&type=revision&diff=22721&oldid=20461) - [x] Fix build and import issues with OpenMP ([D10657: macOS/bpy: add support for OpenMP](https://archive.blender.org/developer/D10657)) - [x] Install to correct place automatically ([D10664: macOS/bpy: install to site-packages](https://archive.blender.org/developer/D10664) + 241f05d53c) - [x] Verify the correctness of installation ( using tests ?) ([D10665: Tests/bpy: Add installation verification test](https://archive.blender.org/developer/D10665)) - [x] Disable python tests which need Blender executable, thus will not work with bpy.so. ([D10656: Tests: disable python tests for bpy module](https://archive.blender.org/developer/D10656)) - [x] Fix error - [x] with Address Sanitizer. ([D10877: macOS/bpy: Fix error in builds with Address Sanitizer](https://archive.blender.org/developer/D10877)) - [x] Install license and ~~some PDFs~~ (Icon PDFs aren't needed for bpy.so I guess) at correct place. See [F12865679](https://archive.blender.org/developer/F12865679/build-bpy.log) ([D14111: bpy module: install scripts and text files relative to bpy.so](https://archive.blender.org/developer/D14111)) - [x] Tweak "Blender successfully built.." message [1] ``` ERROR: Interceptors are not working. This may be because AddressSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with: DYLD_INSERT_LIBRARIES=/path/to/libclang_rt.asan_osx_dynamic.dylib ```
ankitm self-assigned this 2 years ago
ankitm commented 2 years ago
Poster
Collaborator

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
ankitm commented 2 years ago
Poster
Collaborator

Added subscriber: @ankitm

Added subscriber: @ankitm
brecht commented 2 years ago
Owner

Added subscriber: @brecht

Added subscriber: @brecht
brecht commented 2 years ago
Owner

Not specific to macOS, but it would be good if we could avoid installing a Resources folder in the top level site-packages. Ideally both the dynamic library and other files should be in a bpy/ folder.

Not specific to macOS, but it would be good if we could avoid installing a `Resources` folder in the top level `site-packages`. Ideally both the dynamic library and other files should be in a `bpy/` folder.
Collaborator

This issue was referenced by ad31b13f91

This issue was referenced by ad31b13f91e40b40d75222923ac48f6682476b0c
Collaborator

This issue was referenced by 0ec82477af

This issue was referenced by 0ec82477af9bc55e933694300ccd9666fd9534de
Collaborator

This issue was referenced by fbe2c3f422

This issue was referenced by fbe2c3f4227d2f2373e459cb800868f9b8edafda
Collaborator

This issue was referenced by a702ca3faa

This issue was referenced by a702ca3faa9bde7cb3a439a07d8893a692be9ca6

Added subscriber: @Yuri-Teixeira

Added subscriber: @Yuri-Teixeira

Hello 👋 The issue https://developer.blender.org/T58069 seems to persist in v3.0.1 (see attached log):

build-bpy.log

Environment info:

  • MacOS 12.2
  • Python 3.9

Let me know if you need more detail, please.

Thank you in advance!

Hello 👋 The issue https://developer.blender.org/T58069 seems to persist in `v3.0.1` (see attached log): [build-bpy.log](https://archive.blender.org/developer/F12865679/build-bpy.log) Environment info: * MacOS 12.2 * Python 3.9 Let me know if you need more detail, please. Thank you in advance!
ankitm commented 1 year ago
Poster
Collaborator

@Yuri-Teixeira do you have some environment variable interfering with module discovery ? It seems that the one built in build_darwin_bpy/bin/ is taking priority over the one installed in /Library/Frameworks/Python.framework

@Yuri-Teixeira do you have some environment variable interfering with module discovery ? It seems that the one built in `build_darwin_bpy/bin/` is taking priority over the one installed in `/Library/Frameworks/Python.framework`
ankitm commented 1 year ago
Poster
Collaborator

@Yuri-Teixeira also apply D14110 to your code and see if there's any helpful info.

EDIT also suggest opening a new bug report for further discussion.

@Yuri-Teixeira also apply [D14110](https://archive.blender.org/developer/D14110) to your code and see if there's any helpful info. EDIT also suggest opening a new bug report for further discussion.
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Owner

Re: Remove "Blender successfully built.." message

-- Install configuration: "Release"

Edit build configuration with: "/src/build_linux_bpy_lite/CMakeCache.txt" run make again to rebuild.
Blender successfully built as a Python module, "bpy" can be imported from: /src/build_linux_bpy_lite/bin
Re: `Remove "Blender successfully built.." message` ``` -- Install configuration: "Release" Edit build configuration with: "/src/build_linux_bpy_lite/CMakeCache.txt" run make again to rebuild. Blender successfully built as a Python module, "bpy" can be imported from: /src/build_linux_bpy_lite/bin ```
Owner

It seems the only remaining issue is using ASAN, unless someone on macOS is interested to investigate a solution, we could disable the combination.

Suggest: P3220: (An Untitled Masterwork)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8adf6c396f..9d369d2d453 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1296,6 +1296,15 @@ if(WITH_PYTHON_MODULE)
     message(STATUS "GTests not compatible with Python module, disabling WITH_GTESTS")
     set(WITH_GTESTS OFF)
   endif()
+  if(APPLE)
+    if(WITH_COMPILER_ASAN)
+      message(STATUS
+        "ASAN is not compatible with Python module on APPLE, "
+        "disabling WITH_COMPILER_ASAN"
+      )
+      set(WITH_COMPILER_ASAN OFF)
+    endif()
+  endif()
 endif()
 
 

It seems the only remaining issue is using ASAN, unless someone on macOS is interested to investigate a solution, we could disable the combination. Suggest: [P3220: (An Untitled Masterwork)](https://archive.blender.org/developer/P3220.txt) ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index d8adf6c396f..9d369d2d453 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1296,6 +1296,15 @@ if(WITH_PYTHON_MODULE) message(STATUS "GTests not compatible with Python module, disabling WITH_GTESTS") set(WITH_GTESTS OFF) endif() + if(APPLE) + if(WITH_COMPILER_ASAN) + message(STATUS + "ASAN is not compatible with Python module on APPLE, " + "disabling WITH_COMPILER_ASAN" + ) + set(WITH_COMPILER_ASAN OFF) + endif() + endif() endif() ```
Owner

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
brecht closed this issue 5 months ago
Owner

I committed a fix for the asan issue based on a patch by @ankitm, I think we can consider this task resolved now.

I committed a fix for the asan issue based on a patch by @ankitm, I think we can consider this task resolved now.
Sign in to join this conversation.
No Label
Interest/Alembic
Interest/Animation & Rigging
Interest/Asset Browser
Interest/Asset Browser Project Overview
Interest/Audio
Interest/Automated Testing
Interest/Blender Asset Bundle
Interest/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
Interest/Eevee & Viewport
Interest/Freestyle
Interest/Geometry Nodes
Interest/Grease Pencil
Interest/ID Management
Interest/Images & Movies
Interest/Import/Export
Interest/Line Art
Interest/Masking
Interest/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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/Virtual Reality
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
Module › Animation & Rigging
Module › Core
Module › Development Management
Module › Eevee & Viewport
Module › Grease Pencil
Module › Modeling
Module › Nodes & Physics
Module › Pipeline, Assets & IO
Module › Platforms, Builds, Tests & Devices
Module › Python API
Module › Render & Cycles
Module › Sculpt, Paint & Texture
Module › Triaging
Module › User Interface
Module › VFX & Video
Platform/FreeBSD
Platform/Linux
Platform/macOS
Platform/Windows
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information 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
5 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#86579
Loading…
There is no content yet.