From 3663dc3470038d3f21b6908ce905394beeeceff2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Mar 2018 19:53:05 +0200 Subject: [PATCH] Fix issue with useless project rebuilding for case insensitive file systems (Windows) --- HISTORY.rst | 6 ++++++ platformio/commands/lib.py | 7 ++++--- platformio/commands/run.py | 11 ++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index b672ab6c..0e57f504 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ Release Notes PlatformIO 3.0 -------------- +3.5.3 (2018-??-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed issue with useless project rebuilding for case insensitive file + systems (Windows) + 3.5.2 (2018-03-13) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index ee2ec01d..81400684 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -255,9 +255,10 @@ def lib_search(query, json_output, page, noninteractive, **filters): elif not click.confirm("Show next libraries?"): break result = get_api_result( - "/v2/lib/search", - {"query": " ".join(query), - "page": int(result['page']) + 1}, + "/v2/lib/search", { + "query": " ".join(query), + "page": int(result['page']) + 1 + }, cache_valid="1d") diff --git a/platformio/commands/run.py b/platformio/commands/run.py index c0aab27f..aa7c9176 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -411,7 +411,7 @@ def check_project_envs(config, environments=None): def calculate_project_hash(): check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S") - structure = [__version__] + chunks = [__version__] for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()): if not isdir(d): continue @@ -419,5 +419,10 @@ def calculate_project_hash(): for f in files: path = join(root, f) if path.endswith(check_suffixes): - structure.append(path) - return sha1(",".join(sorted(structure))).hexdigest() + chunks.append(path) + chunks_to_str = ",".join(sorted(chunks)) + if "windows" in util.get_systype(): + # Fix issue with useless project rebuilding for case insensitive FS. + # A case of disk drive can differ... + chunks_to_str = chunks_to_str.lower() + return sha1(chunks_to_str).hexdigest()