macOS: improve bpy build system support #86579

Closed
opened 2021-03-15 12:42:54 +01:00 by Ankit Meel · 17 comments
Member

[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 ```
Ankit Meel self-assigned this 2021-03-15 12:42:54 +01:00
Author
Member

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

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

Added subscriber: @ankitm

Added subscriber: @ankitm

Added subscriber: @brecht

Added subscriber: @brecht

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.

This issue was referenced by ad31b13f91

This issue was referenced by ad31b13f91e40b40d75222923ac48f6682476b0c

This issue was referenced by 0ec82477af

This issue was referenced by 0ec82477af9bc55e933694300ccd9666fd9534de

This issue was referenced by fbe2c3f422

This issue was referenced by fbe2c3f4227d2f2373e459cb800868f9b8edafda

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!
Author
Member

@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`
Author
Member

@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.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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 ```

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() ```

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

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
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
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 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
5 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#86579
No description provided.