Skip to content

make_version.py doesn't work properly #1137

Closed

Description

@guy-maurel

I want to make a new release.

git archive -o uncrustify-0.nn.tar.gz e1181d3b3a78ef9fe0f52af53678fdf3340233c5
ls -l uncrustify-0.nn.tar.gz 
-rw-r--r-- 1 guy users 1373927 Mai  5 18:27 uncrustify-0.nn.tar.gz
mkdir 0.65-test
cd 0.65-test
cp ../uncrustify/uncrustify-0.nn.tar.gz .
gunzip uncrustify-0.nn.tar.gz
tar xvf uncrustify-0.nn.tar
mkdir build
cd build
cmake ..
< snip>
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- 
CMake Warning at CMakeLists.txt:137 (message):
  64: Unknown version control system.

  , scripts/make_version.py doesn't work properly

Can anybody help?

Activity

  1. added
    Engineering
    on May 5, 2017
  2. CDanU commented on May 5, 2017

    @CDanU
    Collaborator

    This is supposed to happen, the make_version.py is checking if the .git dir is existing in order to use git to extract the current version info. It bails with this warning because with the posted steps the .git is missing. CMake will use the fallback version string in this case. You should be able to proceed building.


    ref: #1083

  3. CDanU commented on May 5, 2017

    @CDanU
    Collaborator

    Could you postpone the new release until #945 is fixed? I am working on it.

  4. guy-maurel commented on May 6, 2017

    @guy-maurel
    ContributorAuthor

    Well. The message is not complete: something is missing before the comma.
    If it is "... supposed to happen...", I prefer a better message, which explains what happens.
    I have not understood I could make the job.
    I can wait a little, but I wish to push 0.65 in May.

  5. mihaipopescu commented on May 6, 2017

    @mihaipopescu
    Collaborator

    It's been a while but I can check.
    By the way, how are you running this script? I thought make_version is part of CI as well.

  6. guy-maurel commented on May 6, 2017

    @guy-maurel
    ContributorAuthor

    As shown above, the script was run from the "make" command.

  7. mihaipopescu commented on May 6, 2017

    @mihaipopescu
    Collaborator

    Made a PR to improve messaging but yes, as @CDanU said, you that was a warning and can be ignored.

  8. mihaipopescu commented on May 6, 2017

    @mihaipopescu
    Collaborator

    And as said in #767, you can create a new milestone for 0.65 so we can select what issues we would like have fixed for this milestone. What do you think ?

  9. guy-maurel commented on May 7, 2017

    @guy-maurel
    ContributorAuthor

    #1138 shows a better (warning) message.
    I think this is not a warning but an info. Let us use:
    message(STATUS, ...

  10. guy-maurel commented on May 7, 2017

    @guy-maurel
    ContributorAuthor

    0.64 is written in the CMakeLists.txt file.
    Is it possible to generate this with xyz ?

  11. CDanU commented on May 7, 2017

    @CDanU
    Collaborator

    Do you mean automatic generation?
    Well we use make_version.py for this, which internally uses the information provided by git.
    We need a fallback if git is missing. I don't see any way how this could be done in a fail save way other than doing it manually.
    I therefore chose to store that info in the CMakeLists.txt file. We can pull that information from some file or something but we will have to manually increment that info on every release no matter where it is stored.

  12. gmaurel commented on May 8, 2017

    @gmaurel
    Collaborator

    Another place is package.json.
    If anybody find a solution, it would be fine!

  13. CDanU commented on May 11, 2017

    @CDanU
    Collaborator

    This would pull the info form the package.json file:

    set(FALLBACK_VERSION "")
    file(READ "package.json" content)
    string(REPLACE "\n" ";" lines "${content}")
    foreach(line ${lines})
        string(STRIP "${line}" line)
        if("${line}" MATCHES "^\"version\" *: *\"([0-9.]+)\"")
            set(FALLBACK_VERSION "Uncrustify-${CMAKE_MATCH_1}")
            break()
        endif()
    endforeach()
    if ("${FALLBACK_VERSION}" STREQUAL "")
        message(FATAL_ERROR "Could not extract version info from package.json")
    endif()
  14. guy-maurel commented on May 11, 2017

    @guy-maurel
    ContributorAuthor

    Can you make a PR?

  15. CDanU commented on May 11, 2017

    @CDanU
    Collaborator

    Yes, but we should discuss this first. With the above changes the build would depend on the package.json file. Is that a good thing?

    I am not sure why we have this file in the first place. It existed before I made the emscripten interface, back then I would count that as an abuse of the npm infrastructure. With the emscripten interface we kinda have an excuse now.
    I am conflicted on this: On the one hand I would want to separate all the npm/JavaScript stuff from the C++ build as much as possible on the other hand I get that you want to increment the version only in one place.

    Is there any possibility that this will cause problems somewhere? I currently don't see anything other that someone could delete the package.json file. Could there be a chance that some distributor will do that?


    Btw. give me a note before you start with the new release so that I can add all new options to the emscripten interface

  16. mihaipopescu commented on May 11, 2017

    @mihaipopescu
    Collaborator

    I had the same reluctance but yeah, package.json can be thought as a manifest file. It's a lot clearer than to have it hardcoded in the CMakeLists.

  17. guy-maurel commented on May 12, 2017

    @guy-maurel
    ContributorAuthor

    OK. I am ready to fill up the version number two times.
    @CDanU : could you make a PR for that? and give a signal to push the release.

  18. CDanU commented on May 12, 2017

    @CDanU
    Collaborator

    Ok, no PR is needed if both version strings in CMakeLists.txt and pacakge.json will be bumped manually.
    What's the status on the current open PRs? If you plan to include them I would need your new else/if option to be merged in.

    It would be nice if you could look at issue 1140.

    Before releasing we should check/correct the documentation, and make a change log. The change log should be getting quiet long, do you need help on that?

  19. gmaurel commented on May 12, 2017

    @gmaurel
    Collaborator

    OK. We can stay with two places with the version number.
    @CDanU you can close the PR.

  20. mihaipopescu commented on May 13, 2017

    @mihaipopescu
    Collaborator

    Continuing this trend (with two releases per year) it means we will reach the maximum of 0.99 in 2034.

    Does this version means anything to our users other than is different ?
    Semantic versioning could be an option but it will also imply a change in mentality and the way we develop features, fix bugs, doing large-scale refactoring or changing of API.

  21. guy-maurel commented on May 15, 2017

    @guy-maurel
    ContributorAuthor

    Correct.
    But, is the numbering a quality of a product?
    Changing the number doesn't change anything inside the software.
    It might be prettier!
    I am open to any proposal.

  22. CDanU commented on May 15, 2017

    @CDanU
    Collaborator

    I would increment the first number when we make breaking changes, for example renaming/removing of options

  23. mihaipopescu commented on May 19, 2017

    @mihaipopescu
    Collaborator

    Semantic versioning is the widely adopted de-facto standard for software versioning. Also, versions under 1.0.0 they can be generally understood that they are before first public release (beta/alpha version). This is the reason why I raised this problematic not that I'm necessarily in favor of us starting to use semver.

    Breaking changes are a little bit complicated to define. I think we're always trying not to regress behavior when adding new options using with default values that keeps previous behavior. We have tests, we have CI and we have known issues. At the same time, I have seen a lot of regressions while checking against our code base which is actually the main reason why we are so far away from upstream. Virtually every change can produce possible regressions. Our code base evolves as well. Uncrustify doesn't support the entire C++ language for instance so it can not make educated guesses about how to tokenize the code resulting in breaking changes. A breaking change is difficult to define because it is supposed to be done when you have a specific contract.

    So basically I propose to stay using the current version system we have but clearly specify that we're not using semantic version. It's just a number with no meaning other than an incremented stamp id on a package.

  24. guy-maurel commented on May 22, 2017

    @guy-maurel
    ContributorAuthor

    A question:
    How much is missing in the code to be C++11 compatible?
    Are there any test suite for this?
    After filling up to C++11 we could change the version number to 1.0
    Please, give your opinion!

  25. CDanU commented on May 23, 2017

    @CDanU
    Collaborator

    I am not entirely sure what you mean by that. C++ has always bee backwards compatible. The code is therefore ok with that standard.
    If you mean if we have (mostly) all the options that we need to format the new C++11 features than I would say: No we still miss a ton. Drop me a mail for further clarification on this.

  26. mihaipopescu commented on May 24, 2017

    @mihaipopescu
    Collaborator

    There are compilers that are not fully compatible with c++11 so I don't even think about making this our goal. I think we need to support a bit of everything, even from newer standards but the most common things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Engineering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions