Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4941

thrift compiler will not auto update gen-cpp directory

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 0.13.0
    • 0.13.0
    • C++ - Compiler
    • None

    Description

      thrift compiler will not auto update the files in the gen-cpp directory.

      when we call t_generator::generate_program() and init_generator() in compiler\cpp\src\thrift\generate\t_generator.cc ,

      'MKDIR' macro will ignore EEXIST, and throw on any other error, this will not give any reponse print on terminal. we used to update and generate the .h .cpp files in the whole directory.

      1. delete the old folder and create new one, generate the file again.

      2. throw errno directly and exit the terminal.

      what`s your opinion about this?

      code details:

      // ignore EEXIST, throw on any other error
      #ifdef _WIN32
      #define MKDIR(x) { int r = _mkdir(x); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
      #else
      #define MKDIR(x) { int r = mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
      #endif
      

      Thanks.
      Zhouhu.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jensg Jens Geyer
            pengzhouhu pengzhouhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment