Loading ...
Sorry, an error occurred while loading the content.

Re: Quickfix Has Wrong Path to Source Files

Expand Messages
  • Ben Fritz
    ... I didn t know this tool existed. Thanks! ... Maybe. I see from the man page that ccfilter also allows specifying the compiler. Maybe you just need to do
    Message 1 of 9 , Jan 23, 2013
    • 0 Attachment
      On Wednesday, January 23, 2013 11:52:23 AM UTC-6, Stephen Rasku wrote:
      >
      >
      > ccfilter converts the make output to the errorformat format. I can
      >
      > see that it's prepending build/i586-linux/ when I pipe the output
      >
      > through ccfilter. I'll look at why this is. ccfilter is distributed
      >
      > with vim but I think you need to compile it separately.

      I didn't know this tool existed. Thanks!

      > The solution
      >
      > may be to stop using ccfilter and just write a compatible errorformat.
      >

      Maybe. I see from the man page that ccfilter also allows specifying the compiler. Maybe you just need to do that? If not writing your own errorformat should also work, but I know from experience it's easy to miss some message formats on compilers which don't use one consistent format for all messages.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Stephen Rasku
      ... No problem. ... I solved this by modifying ccfilter to not prepend the current directory to the error message. It works for me but I m not sure it s a
      Message 2 of 9 , Jan 23, 2013
      • 0 Attachment
        On Wed, Jan 23, 2013 at 10:28 AM, Ben Fritz <fritzophrenic@...> wrote:
        >
        > On Wednesday, January 23, 2013 11:52:23 AM UTC-6, Stephen Rasku wrote:
        > >
        > > ccfilter is distributed
        > > with vim but I think you need to compile it separately.
        >
        > I didn't know this tool existed. Thanks!

        No problem.

        >
        > > The solution
        > > may be to stop using ccfilter and just write a compatible errorformat.
        > >
        >
        > Maybe. I see from the man page that ccfilter also allows specifying the
        > compiler. Maybe you just need to do that? If not writing your own
        > errorformat should also work, but I know from experience it's easy to miss
        > some message formats on compilers which don't use one consistent format for
        > all messages.

        I solved this by modifying ccfilter to not prepend the current
        directory to the error message. It works for me but I'm not sure it's
        a good generic solution.

        ...Stephen

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Ben Fritz
        ... I ve never seen a makefile specify absolute paths before, they are meant to run from the current directory. Thus it makes sense to prepend the current
        Message 3 of 9 , Jan 23, 2013
        • 0 Attachment
          On Wednesday, January 23, 2013 3:19:19 PM UTC-6, Stephen Rasku wrote:
          >
          >
          > I solved this by modifying ccfilter to not prepend the current
          >
          > directory to the error message. It works for me but I'm not sure it's
          >
          > a good generic solution.
          >

          I've never seen a makefile specify absolute paths before, they are meant to run from the current directory. Thus it makes sense to prepend the current directory to messages in most cases.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Stephen Rasku
          ... I m not quite sure what you mean about makefile specify[ing] absolute paths . In a large project it s fairly common for Makefiles to call other Makefiles
          Message 4 of 9 , Jan 23, 2013
          • 0 Attachment
            On Wed, Jan 23, 2013 at 1:57 PM, Ben Fritz <fritzophrenic@...> wrote:
            >
            > On Wednesday, January 23, 2013 3:19:19 PM UTC-6, Stephen Rasku wrote:
            > >
            > > I solved this by modifying ccfilter to not prepend the current
            > > directory to the error message. It works for me but I'm not sure it's
            > > a good generic solution.
            >
            > I've never seen a makefile specify absolute paths before, they are meant
            > to run from the current directory. Thus it makes sense to prepend the
            > current directory to messages in most cases.

            I'm not quite sure what you mean about "makefile specify[ing] absolute
            paths". In a large project it's fairly common for Makefiles to call
            other Makefiles to build the whole system. If you are in the current
            directory, there's no need to prepend the current directory. Relative
            paths should work. I may be missing something, though.

            ...Stephen

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Ben Fritz
            ... You said you fixed the problem by making ccfilter not prepend the current directory. The string being prepended is build/i586-linux/ so I assume you re
            Message 5 of 9 , Jan 24, 2013
            • 0 Attachment
              On Wednesday, January 23, 2013 4:10:22 PM UTC-6, Stephen Rasku wrote:
              > I'm not quite sure what you mean about "makefile specify[ing] absolute
              >
              > paths".

              You said you fixed the problem by making ccfilter not prepend the current directory.

              The string being prepended is "build/i586-linux/" so I assume you're building from that directory.

              But the build itself gives errors from files in a completely different directory, giving absolute path "/local/work/dept/user/repo.git/src/fd_set/src/"

              I assumed that meant your makefile was specifying /local/work/dept/user/repo.git/src/fd_set.c via absolute path.

              > In a large project it's fairly common for Makefiles to call
              >
              > other Makefiles to build the whole system.

              Yes, and now that I think about it, a lot of my makefiles use environment variables built by modifying the the current working directory, which could easily result in absolute paths. Or the compiler may output absolute paths in the error output without the makefile using them. It is still strange to me that you seem to be compiling files in a location not related at all to your current directory. I was speculating as to the reason the ccfilter might be prepending current path. Apparently it fails in some situations which are more common than I thought.

              > If you are in the current
              >
              > directory, there's no need to prepend the current directory. Relative
              >
              > paths should work. I may be missing something, though.
              >

              Relative paths will only work as long as Vim stays in the same directory. Loading some build output with :cfile can be quite difficult if relative paths are used, and I think I've seen quirks even when using :make.

              Probably the correct thing to do is to prepend current directoy, but only if the path is relative. If the path is absolute, don't prepend anything.

              Or even better, resolve the full path based on current directory always, and replace the full path string with the resolved path. This will also "fix" paths like project/p1/../libs/p2 to become /home/accts/johndoe/project/libs/p2.

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Stephen Rasku
              I think we are generally in agreement here. Details below. ... I am using make to call CMake and CMake is called iteratively in each architecture (e.g,
              Message 6 of 9 , Jan 24, 2013
              • 0 Attachment
                I think we are generally in agreement here. Details below.

                On Thu, Jan 24, 2013 at 7:45 AM, Ben Fritz <fritzophrenic@...> wrote:
                >
                > On Wednesday, January 23, 2013 4:10:22 PM UTC-6, Stephen Rasku wrote:
                > > I'm not quite sure what you mean about "makefile specify[ing] absolute
                > >
                > > paths".
                >
                > You said you fixed the problem by making ccfilter not prepend the current directory.
                >
                > The string being prepended is "build/i586-linux/" so I assume you're building from that directory.

                I am using make to call CMake and CMake is called iteratively in each
                architecture (e.g, build/i586-linux, build/x86_64-linux, etc.).
                However it's prepending a local directory to an absolute directory
                which, as you note below, causes problems.

                > > If you are in the current
                > > directory, there's no need to prepend the current directory. Relative
                > > paths should work. I may be missing something, though.
                >
                > Relative paths will only work as long as Vim stays in the same directory. Loading some build output with :cfile can be quite difficult if relative paths are used, and I think I've seen quirks even when using :make.
                >
                > Probably the correct thing to do is to prepend current directoy, but only if the path is relative. If the path is absolute, don't prepend anything.
                >
                > Or even better, resolve the full path based on current directory always, and replace the full path string with the resolved path. This will also "fix" paths like project/p1/../libs/p2 to become /home/accts/johndoe/project/libs/p2.

                Sounds like a good solution.

                ...Stephen

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.