Skip to content

CMake build issues #604

Closed
Closed

Description

@mihaipopescu

@jibsen I've just tested cmake build on windows and apparently it works but:

  • there are no instructions on how to build with cmake
  • cmake fails when it tries to create a /Testing directory because there is another file with the same name /TESTING
  • seems like process is rather messy. It creates everything in the root and pollutes the repository with untracked files.
  • modify appveyor.yml and .travis.yml to switch to cmake
  • Add appveyor build status badge in README.md
  • add helper script for running tests
  • make_version.py is not working
  • repository has to be cleaned of old build system files (gnu automake, mingw32 scripts, VS and Xcode solution files)

Activity

  1. mihaipopescu commented on Aug 3, 2016

    @mihaipopescu
    CollaboratorAuthor

    Other related issues #470, #538, #600.

  2. jibsen commented on Aug 3, 2016

    @jibsen
    Contributor

    I would always recommend doing an out-of-source build with CMake, so all the files created do not end up in the source tree:

    mkdir build
    cd build
    cmake ..

    Cleaning up is just a matter of removing the build folder.

  3. mihaipopescu commented on Aug 3, 2016

    @mihaipopescu
    CollaboratorAuthor

    Can't the output/temp folders be specified ? I would be very surprised if not.

  4. jibsen commented on Aug 3, 2016

    @jibsen
    Contributor

    I may be wrong, but I think CMake always creates them in the folder cmake is run from. Perhaps it would be worth adding a check to the CMake script that warns the user if attempting an in-source build?

    Regarding cleaning up the other build systems, I think it is up to the authors if they feel comfortable enough with CMake as the only option.

  5. mihaipopescu commented on Aug 3, 2016

    @mihaipopescu
    CollaboratorAuthor

    I have no problem with changing the cwd if that's the only way for cmake. I have little to none experience with CMake.

    I would agree with any build system as long as it's cross platform and can create native executables for that OS.

  6. added a commit that references this issue on Aug 3, 2016
  7. mihaipopescu commented on Aug 3, 2016

    @mihaipopescu
    CollaboratorAuthor

    @jibsen I've branched the discussion into a new issue #606. We can keep this one only for CMake related issues.

  8. added
    Engineering
    on Aug 3, 2016
  9. added a commit that references this issue on Aug 3, 2016
  10. jibsen commented on Aug 3, 2016

    @jibsen
    Contributor

    Thanks. I've opened #605 and #608 to address some of these.

  11. mihaipopescu commented on Aug 4, 2016

    @mihaipopescu
    CollaboratorAuthor

    Thanks @jibsen. I'll try them out.

  12. mihaipopescu commented on Aug 4, 2016

    @mihaipopescu
    CollaboratorAuthor

    Let me know if you think there should be something else.

  13. jibsen commented on Aug 4, 2016

    @jibsen
    Contributor

    The output files from the tests should probably go into the build folder somewhere (using the --results option). I'll take a look at that.

  14. mihaipopescu commented on Aug 4, 2016

    @mihaipopescu
    CollaboratorAuthor

    Why ? I think it's good where they are right now in the tests folder. The test fw just has to find the executable, that's all I guess.

  15. jibsen commented on Aug 4, 2016

    @jibsen
    Contributor

    It would keep generated files out of the source tree, so cleaning up is just removing the build folder. Also, for testing, I have different build folders for mingw-w64 and MSVC, and this would keep the results with the corresponding build.

    But perhaps I am overcomplicating things?

  16. 37 remaining items

  17. mihaipopescu commented on Aug 16, 2016

    @mihaipopescu
    CollaboratorAuthor

    I don't think the argument that you can run many tests in parallel can counter the fact that the testing framework has been significantly slowed down for single thread usage. Parallelization can be achieved even with previous framework simply by running multiple commands in parallel: python run_tests.py c & python run_tests.py cpp & .... Counting also the fact that uncrustify has also the batch option even faster testing can be achieved.

  18. mihaipopescu commented on Aug 22, 2016

    @mihaipopescu
    CollaboratorAuthor

    We need to port more functionality from run_scripts.py to call that script redundant. Till then we need it.

    Still, I've found a new issue identified while running the make_version.py which doesn't work with cmake. We have to figure it out how to fix this but I would just call it from cmake.

  19. jibsen commented on Aug 23, 2016

    @jibsen
    Contributor

    Still, I've found a new issue identified while running the make_version.py which doesn't work with cmake. We have to figure it out how to fix this but I would just call it from cmake.

    Since you cannot necessarily count on people building Uncrustify having cloned the git repository, I don't think we can do what make_version.py does (git describe) as part of the regular build process.

    We could put set(PACKAGE_VERSION "0.63") in CMakeLists.txt and then update that in the Python script, or we could write a version tag file and read that from the CMake script?

  20. mihaipopescu commented on Aug 26, 2016

    @mihaipopescu
    CollaboratorAuthor

    @jibsen make_version.py is doing some checks to see if there is a .git or an .hg repository and then runs respective commands to find the commit hashes. I won't be a good idea though to make it part of the build system, that's not what I'm saying. We just have to make it work with cmake.

    We could put set(PACKAGE_VERSION "0.63") in CMakeLists.txt and then update that in the Python script, or we could write a version tag file and read that from the CMake script?

    Agree. We have to clean the dependency on configure.ac dependency. Also we can send the build directory as a parameter to be used as an output directory instead of the src folder.

    What do you think ?

  21. mihaipopescu commented on Aug 26, 2016

    @mihaipopescu
    CollaboratorAuthor

    We also have a fix for users that are using hg-git extension.

    --- C:\Users\mihai\AppData\Local\Temp\thg._cjm9b\uncrustify.6.1765\make_version.py  2016-08-26 15:32:51.000000000 +0200
    +++ C:\Users\mihai\AppData\Local\Temp\thg._cjm9b\uncrustify.6\make_version.py   2016-08-26 15:32:51.000000000 +0200
    @@ -16,14 +16,15 @@
                 txt = subprocess.check_output(['git', 'describe', '--long', '--always', '--dirty']).strip()
             except:
                 print "Failed to retrieve version from git"
                 return 1
         elif os.path.exists(hg_path):
             try:
    -            branch = subprocess.check_output(['hg', 'log', '-r', '.', '--template', '{latesttag}']).strip()
    -            txt = subprocess.check_output(['git', '--git-dir=.hg/git', 'describe', '--long', '--always', branch]).strip()
    +            subprocess.check_call(['hg', 'gexport'])
    +            node = subprocess.check_output(['hg', '--config', 'defaults.log=', 'log', '-r', '.', '--template', '{gitnode}']).strip()
    +            txt = subprocess.check_output(['git', '--git-dir=.hg/git', 'describe', '--long', '--tags', '--always', node]).strip()
             except:
                 print "Failed to retrieve version from hg"
                 return 1
         else:
             print "Unknown version control system."
             return 1

    We can add this to the patch.

  22. mihaipopescu commented on Sep 10, 2016

    @mihaipopescu
    CollaboratorAuthor

    I've made a patch for the last issue I've noted before doing the full rollout to cmake.
    Do you guys have anything else to add ? I may have missed something.

  23. gmaurel commented on Sep 26, 2016

    @gmaurel
    Collaborator

    Do we have anything else to do?
    May I close?

  24. dirk-thomas commented on Sep 26, 2016

    @dirk-thomas
    Contributor

    I think the last bullet from the first comment is still pending (repository has to be cleaned of old build system files).

  25. gmaurel commented on Sep 26, 2016

    @gmaurel
    Collaborator

    Which one may I remove?

  26. dirk-thomas commented on Sep 26, 2016

    @dirk-thomas
    Contributor

    I haven't tried it but from looking at the file system I would guess the following should not be used anymore:

    • autotools/
    • uncrustify.xcodeproj/
    • win32/
    • Makefile.am
    • autogen.sh
    • configure.ac
    • make_win32.sh

    It looks like the following files need to be update to use the new build system / remove / replace autotools related stuff:

    • INSTALL
    • README.md
    • TESTING
    • package.json
    • release-steps.txt
  27. dzenanz commented on Sep 26, 2016

    @dzenanz
    Contributor

    What about folders man and osx, and files Comments.txt, extras.vpj, uncrustify.vpj, uncrustify.vpw and working.txt?

  28. mihaipopescu commented on Sep 26, 2016

    @mihaipopescu
    CollaboratorAuthor

    It's a good time for cleanup. I think we should create two different PRs. One for the old build system cleanup and one for general cleanup.

    # gnu autotools cleanup
    rm -rf autotools/
    rm -rf uncrustify.xcodeproj/
    rm -rf win32/
    rm -rf Makefile.am
    rm autogen.sh
    rm configure.ac
    rm make_win32.sh
    rm make_token_names.*
    mv make_version scripts/
    rm src/Makefile.am
    # general cleanup
    rm -rf osx
    rm commit.log
    rm extras.vpj
    mv forUncrustifySources.* etc/
    rm uncrustify.vp*
    mv working.txt documentation/
    rm NEWS

    I think man it's still used from cmake to generate the manual. We have to check if all files are required.

  29. jibsen commented on Sep 27, 2016

    @jibsen
    Contributor

    I started a PR for cleaning up the build system files.

    We should probably also resolve #650 before any new release.

  30. mihaipopescu commented on Nov 14, 2016

    @mihaipopescu
    CollaboratorAuthor

    I'm going to close this now as very few lingering issues remained.

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