Build on MacOS missing security options.

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Build on MacOS missing security options.

Post by keithsloan52 »

https://support.apple.com/en-gb/guide/m ... a35146/mac

Describes how to control an applications access to Documents/Downloads etc.
FreeCAD does not show up as a possible application :-(, so looks like FreeCAD on a Mac is missing setting some security options.

Problem occurs on MacOS - Catalina

see also https://forum.freecadweb.org/viewtopic.php?f=3&t=62434
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Build on MacOS missing security options.

Post by doia »

I'm running on 0.19.2 and 0.20 latest master on Mac Big Sur. Haven't had a problem accessing these folders so far.

Do want to access these folders and are not able to do so? Or do you want explicitly grant (and revoke) access for FreeCAD?
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: Build on MacOS missing security options.

Post by keithsloan52 »

doia wrote: Thu Sep 23, 2021 4:54 pm Do want to access these folders and are not able to do so? Or do you want explicitly grant (and revoke) access for FreeCAD?
I have a problem when trying to load a scad file that loads an OpenSCAD library. OpenSCAD Libraries are stored in Documents
see https://forum.freecadweb.org/viewtopic.php?f=3&t=62434

What happens if you go to the python console in FreeCAD and enter

Code: Select all

os.listdir('/Users/<your_user_name>/Documents')
Do you get something like

Code: Select all

os.listdir('/Users/keithsloan/Documents')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
PermissionError: [Errno 1] Operation not permitted: '/Users/keithsloan/Documents'
If you go to 'System Preferences' | 'Security & Privacy' | 'Privacy' | 'Files and Folder'
Is FreeCAD one of the listed Application?
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Build on MacOS missing security options.

Post by doia »

Sorry, misunderstood you. Thought you were having trouble accessing the Documents and Download folders in the "Open File" dialog.

On the python console within FreeCAD I have the same errors as you.

From a separate terminal within an interactive Python session the command succeeds:
- Opening iterm on MAC and typing

Code: Select all

➜  ~ python3
Python 3.9.7 (default, Sep  3 2021, 12:37:55)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> import os
>>> os.listdir("/Users/my-username/Downloads")
//-> this lists the content of the downloads folder
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Build on MacOS missing security options.

Post by doia »

Hold up, I did a differentiated test:

code into FC Python console directly after start-up (no other action or WB change)

Code: Select all

os.listdir("/Users/my-user-name/Downloads")
v0.19-24291 --> access denied

OS: macOS 10.16
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: (HEAD detached at 0.19.2)
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.8
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

v0.20-25645 (weekly build from FreeCAD-Bundle https://github.com/FreeCAD/FreeCAD-Bund ... kly-builds) --> access to folder succeeded

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)

So, the error seems to be a v0.19 issue. -> Thats's why you always should post your version info ;)
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: Build on MacOS missing security options.

Post by keithsloan52 »

doia wrote: Fri Sep 24, 2021 8:21 am
v0.20-25645 (weekly build from FreeCAD-Bundle https://github.com/FreeCAD/FreeCAD-Bund ... kly-builds) --> access to folder succeeded

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)

So, the error seems to be a v0.19 issue. -> Thats's why you always should post your version info ;)
Thanks - I had checked v0.20-25566 and it had the problem.

As does

Code: Select all

OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2021.922.24301 +4188 (Git)
Build type: Release
Branch: LinkDaily
Hash: 3de879c7a2ba7111cc769d98636eb6d43189459d
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.1
OCC version: 7.5.2
Locale: C/Default (C)
Post Reply