Skip to content

CMake warning - policy CMP0135 #116866

Description

@Asmitta-01

Hey
I reinstall windows on my laptop then flutter and all the needed components. I clone my project from git (i was working on it since 3 weeks) and launch it but while debugging a get this warning message:

CMake Warning (dev) at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.

Call Stack (most recent call first):
  C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  CMakeLists.txt:9 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

How can i remove this ?

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Dec 12, 2022
  2. exaby73 commented on Dec 12, 2022

    @exaby73
    Member

    Hi @Asmitta-01
    This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this,
    you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
    Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
    Thank you

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 12, 2022
  4. JaredEzz commented on Feb 15, 2023

    @JaredEzz

    I'm also getting this issue, is it not an issue with the flutter implementation of windows?

  5. github-actions commented on Mar 3, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Mar 3, 2023
  7. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-windowsBuilding on or for Windows specifically
    a: buildBuilding flutter applications with the tool
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Mar 29, 2023
  8. stuartmorgan-g commented on Mar 29, 2023

    @stuartmorgan-g
    Contributor

    @cbracken I see this with recent versions of VS; I think it just needs a CMakeList.txt migrator to add the policy (and a corresponding template update for new projects). See

    # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
    # versions of CMake.
    cmake_policy(SET CMP0063 NEW)
    for existing policy settings for similar warnings.

  9. 1 remaining item

  10. unlocked this conversation on Mar 30, 2023
  11. added
    P2Important issues not at the top of the work list
    on Mar 30, 2023
  12. stuartmorgan-g commented on Apr 25, 2023

    @stuartmorgan-g
    Contributor

    Important repro information I had missed (because I mostly build our 1P plugin examples, and they use FetchContent for gtest) is that you need to be building a project that has a download step. In the original report it's Modules/ExternalProject.cmake, and with 1P (and I'm sure a number of 3P) plugins it's Modules/FetchContent.cmake.

    It might be possible to set the policy in individual files (e.g., our plugin template which also uses FetchContent), but I'm not sure what happens if there are multiple conflicting declarations. It seems like we should probably still set this at the root level to just avoid the warning for all projects across the board.

  13. stuartmorgan-g commented on Apr 25, 2023

    @stuartmorgan-g
    Contributor

    Alternately, we may want to just migrate our existing cmake_policy to be version-based instead, so this kind of thing can be fixed in the future by just updating a single version number in the file.

  14. stuartmorgan-g commented on Apr 25, 2023

    @stuartmorgan-g
    Contributor

    but I'm not sure what happens if there are multiple conflicting declarations

    It looks like this is harmless, according to the docs:

    CMake keeps policy settings on a stack, so changes made by the cmake_policy command affect only the top of the stack. A new entry on the policy stack is managed automatically for each subdirectory to protect its parents and siblings.

    But it'll still be easiest for the ecosystem if everyone doesn't have to do this themselves, and the version-based approach seems like a sustainable way to manage this in a single place.

  15. added
    r: fixedIssue is closed as already fixed in a newer version
    on May 6, 2023
  16. github-actions commented on May 20, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  17. locked as resolved and limited conversation to collaborators on May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toola: desktopRunning on desktopplatform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions