[SERVER-46416] We should support mongo_custom_vars on Windows Created: 26/Feb/20  Updated: 27/Oct/23  Resolved: 14/Aug/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Mathew Robinson (Inactive) Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Participants:

 Description   

Right now we do this to find the mongo_custom_vars.py file:

 
def find_mongo_custom_variables():
    files = []
    paths = [path for path in sys.path if 'site_scons' in path]
    for path in paths:
        probe = os.path.join(path, 'mongo_custom_variables.py')
        if os.path.isfile(probe):
            files.append(probe)
    return files

Which works great on POSIX platforms because SCons adds $HOME/.scons/site_scons to the sys.path. However, on Windows it does no such thing, sys.path (matching our site_scons condition) will only include the site_tools\site_scons directory.

We should inject in a path like %APPDATA%\SCons\site_scons on Windows so users on that platform can have a similar development experience as those on other systems.



 Comments   
Comment by Andrew Morrow (Inactive) [ 14/Aug/20 ]

I believe this was filed in error. The described behavior definitely works. On a Windows spawn host, SCons checks the following directories:

C:\ProgramData\Application Data\scons\site_scons
C:\Users\Administrator\Local Settings\Application Data\scons\site_scons
C:\Users\Administrator\AppData\Roaming\scons\site_scons
C:\Users\Administrator/.scons\site_scons

After adding a mongo_custom_variables.py file to C:\Users\Administrator/.scons\site_scons I can confirm that it is actually loaded.

Generated at Thu Feb 08 05:11:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.