[SERVER-41893] clang_format.py's caching mechanism should save tarballs that include the UID Created: 24/Jun/19  Updated: 06/Dec/22  Resolved: 29/Jul/19

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

Type: Task Priority: Major - P3
Reporter: Spencer Jackson Assignee: DO NOT USE - Backlog - Dev Tools
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Developer Tools
Participants:

 Description   

buildscripts/clang_format.py does this:

def get_clang_format_from_cache_and_extract(url, tarball_ext):
    """Get clang-format from mongodb's cache and extract the tarball."""
    dest_dir = tempfile.gettempdir()
    temp_tar_file = os.path.join(dest_dir, "temp.tar" + tarball_ext)
 
    # Download from file
    print("Downloading clang-format %s from %s, saving to %s" % (CLANG_FORMAT_VERSION, url,
                                                                 temp_tar_file))

It tries to download, and cache, the clang-format binary into /tmp/temp.tar.gz. Unfortunately, if two Linux accounts are trying to run clang_format.py, only one can successfully download the binary.

To fix this, the cache path the script saves the tarball into should contain something unique to the account, likely the UID.



 Comments   
Comment by Andrew Morrow (Inactive) [ 29/Jul/19 ]

I don't think this needs to be fixed given that we updated the script to look first in the toolchain. Downloads should be much less common on developer machines, especially those that get shared.

Generated at Thu Feb 08 04:58:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.