Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use python3 to run MakeMacBundleRelocatable.py #6784

Merged
merged 5 commits into from May 5, 2022

Conversation

ageeye
Copy link
Contributor

@ageeye ageeye commented Apr 23, 2022

Python 2.7 was removed from macOS in update Monterey 12.3.
Feature request in the forum upgrade MakeMacBundleRelocatable.py to work with python 3.

Closes #6773

@ageeye
Copy link
Contributor Author

ageeye commented Apr 23, 2022

@ipatch
@looooo

Please test it.

@freecadci
Copy link

pipeline status for feature branch PR_6784. Pipeline 523031767 was triggered at c39b635. All CI branches and pipelines.

@ipatch
Copy link
Contributor

ipatch commented Apr 23, 2022

awesome i'll take a look at this in a few.

@luzpaz luzpaz added Packaging/building Related to building, compiling or packaging FreeCAD OS: macOS labels Apr 23, 2022
@luzpaz luzpaz added this to the 0.20 milestone Apr 23, 2022
@ipatch
Copy link
Contributor

ipatch commented Apr 24, 2022

okay finally got around to testing this PR locally on my vm mojave build box, and im seeing the below error running make install

-- INFO: Analyzing bundle dependencies...
Traceback (most recent call last):
  File "/opt/code/freecad-git/freecad-src/src/Tools/MakeMacBundleRelocatable.py", line 391, in <module>
    main()
  File "/opt/code/freecad-git/freecad-src/src/Tools/MakeMacBundleRelocatable.py", line 374, in main
    build_deps_graph(graph, bundle_path, dir_filter, search_paths)
  File "/opt/code/freecad-git/freecad-src/src/Tools/MakeMacBundleRelocatable.py", line 229, in build_deps_graph
    for k in visited.keys():
RuntimeError: dictionary changed size during iteration

@ageeye
Copy link
Contributor Author

ageeye commented Apr 24, 2022

Whatever with python3.10.2 method keys work fine. I think you used python3.9.7. I replace keys with list. See the new commit. Please test it again.

// edit:

The views returned by dict.keys(), dict.values() and dict.items() ...

@freecadci
Copy link

pipeline status for feature branch PR_6784. Pipeline 523252207 was triggered at 3c91839. All CI branches and pipelines.

@freecadci
Copy link

pipeline status for feature branch PR_6784. Pipeline 523256367 was triggered at 2934820. All CI branches and pipelines.

@ipatch
Copy link
Contributor

ipatch commented Apr 24, 2022

rebuilding now with your updates, will let you know in a few.

@ageeye
Copy link
Contributor Author

ageeye commented Apr 28, 2022

rebuilding now with your updates, will let you know in a few.

Have you had a chance to check it?

@ipatch
Copy link
Contributor

ipatch commented Apr 28, 2022

rebuilding now with your updates, will let you know in a few.

Have you had a chance to check it?

working on it now. hopefully ill have something of meaning to share before COB CST 🤞

working with broken wrist so im down to one hand for typing 🤕

@ageeye
Copy link
Contributor Author

ageeye commented Apr 29, 2022

Best wishes for a speedy recovery. No sweat!

@ipatch
Copy link
Contributor

ipatch commented Apr 29, 2022

i'm pretty sure we should be good to go on this 👍 there was issue where this only worked with python ≥ 3.10 but has since been amended to work with python ≥ 3.9. 👍

ive been testing this PR on my movaje build box and with this PR python3 provided by homebrew is able to produce a FreeCAD.app bundle. so at this point i feel confident this is working.

and i just got access to an m1 box again the other so will test again on m1 shortly. (hopefully later today).


something non related however, is when the python script is Updating dynamic loader paths... it sometimes produces an app bundle that will halt on launch ie. double clicking the FreeCAD.app starts the launch process then the app never finishes launching and then macos opens with a crash report. i can only speculate why certain app bundles do this and others don't at this time unfortunately. i have found a very crude way to know that is the part where the script is Updating dynamic loader paths... but much more than that i don't know why the app bundle is failing to launch in certain instances. once again this is not related to this PR.


but once again, i consider this working, and should be merged ✅

@ageeye
Copy link
Contributor Author

ageeye commented Apr 29, 2022

Thanks for the feedback.


If the App do not start, please start it with lldb:

lldb FreeCAD.app/Contents/MacOS/freecad

r

The prime suspect is shiboken. In the MacAppBundle CMake copy some libs like numpy to the bundle. But Homebrew do not allow keg_only formula to write the .pth in the lib path. So, the script do not find the dependencies.

@ipatch
Copy link
Contributor

ipatch commented Apr 29, 2022

@ageeye

thanks for sharing that. 🙏 next time i run into an app bundle that won't launch ill give this a go.

@ageeye
Copy link
Contributor Author

ageeye commented May 1, 2022

In the forum looooo wrote, that conda do not use this script. So for my part it is possible to merge this PR.

@freecadci
Copy link

pipeline status for feature branch PR_6784. Pipeline 528781363 was triggered at c79b38a. All CI branches and pipelines.

@luzpaz
Copy link
Contributor

luzpaz commented May 5, 2022

@donovaly ping

@donovaly donovaly merged commit b107498 into FreeCAD:master May 5, 2022
abdullahtahiriyo pushed a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this pull request May 16, 2022
* To use this script with python 3, fix the incompatible types text and bytes.
berniev pushed a commit to berniev/FreeCAD that referenced this pull request Jul 16, 2022
* To use this script with python 3, fix the incompatible types text and bytes.
coreyoconnor pushed a commit to coreyoconnor/FreeCAD that referenced this pull request Aug 5, 2022
* To use this script with python 3, fix the incompatible types text and bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: macOS Packaging/building Related to building, compiling or packaging FreeCAD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] [macos] [mac] [osx] update MakeMacBundleRelocatable.py to work with python 3
5 participants