Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17439

Perforce Quick Clean Does Not Remove All Build Files; Fails to Halt the Build

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • p4-plugin
    • None
    • Windows 2008 Server

      I hit a case where the Perforce "quick clean" option does not remove all of my class files.

      This leaves a class file in the /classes output directory, and when rebuilt, blocks the anonymous (MyClass$Anon.class) files from being generated, breaking the build.

      I do not see any error messages that indicate the root cause of this issue.

      This issues took me hours to track down and verify. If quick-clean had aborted the build when it fails, this would have saved a lot of headache.

      Here is failing directory before the clean:

      d---- 4/2/2013 3:52 PM firstperson
      d---- 4/2/2013 3:52 PM orbit
      a-- 4/2/2013 3:52 PM 16553 BasicView.class
      a-- 4/2/2013 3:52 PM 4859 BasicViewPropertyLimits.class
      a-- 4/2/2013 3:52 PM 2793 ViewElevationAnimator.class
      a-- 4/2/2013 3:52 PM 470 ViewModel.class
      a-- 4/2/2013 3:52 PM 1237 ViewPropertyAccessor$ElevationAccessor.class
      a-- 4/2/2013 3:52 PM 913 ViewPropertyAccessor$EyePositionAccessor.class
      a-- 4/2/2013 3:52 PM 876 ViewPropertyAccessor$HeadingAccessor.class
      a-- 4/2/2013 3:52 PM 868 ViewPropertyAccessor$PitchAccessor.class
      a-- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class
      a-- 4/2/2013 3:52 PM 826 ViewPropertyLimits.class
      a-- 4/2/2013 3:52 PM 1366 ViewUtil$ViewState.class
      a-- 4/2/2013 3:52 PM 11575 ViewUtil.class

      After the clean I get:

      d---- 4/2/2013 4:43 PM firstperson
      d---- 4/2/2013 4:43 PM orbit
      a-- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class

      As far as I can tell, there is no reason why this file should not have been removed.

          [JENKINS-17439] Perforce Quick Clean Does Not Remove All Build Files; Fails to Halt the Build

          Alexey Larsky added a comment - - edited

          Perforce "quick clean" doesn't remove ANY UNTRACKED file!
          Jenkins 1.532.2
          Perforce 1.3.27

          Alexey Larsky added a comment - - edited Perforce "quick clean" doesn't remove ANY UNTRACKED file! Jenkins 1.532.2 Perforce 1.3.27

          Rob Petti added a comment -

          Are you getting any warnings? What os are you using? This works fine for me in production.

          Rob Petti added a comment - Are you getting any warnings? What os are you using? This works fine for me in production.

          Alexey Larsky added a comment -

          Windows 7 SP1 x32|x64 + Debian 7 x32|x64

          No warnings.
          As far I understood p4 'quick clean' option does't try remove untracked files.
          It only restore changed tracked files.

          Using remote perforce client: boatwright_hidden-debian7
          [hidden-debian7] $ p4 workspace -o boatwright_hidden-debian7
          'Don't update client' is set. Not saving the client changes.
          Note: .repository directory in workspace (if exists) is skipped during clean.
          Quickly cleaning workspace...
          [hidden-debian7] $ p4 d views/hidden-debian7 -x have
          Workspace is clean.
          Restoring changed and deleted files...
          [hidden-debian7] $ p4 d views/hidden-debian7 -x sync -f
          [hidden-debian7] $ p4 -d views/hidden-debian7 diff -se
          //mts/cn/3rdparty/Google/Chromium/Streams/34.0/src/build/gyp_helper.pyc#8 - refreshing /home/user/views/hidden-debian7/3rdparty/Chromium/src/build/gyp_helper.pyc
          ...
          //mts/cn/Applications/ProPlus_SDK/Streams/v06/build/cmake/version.inc#2 - refreshing /home/user/views/hidden-debian7/mts/cmake/version.inc
          [hidden-debian7] $ p4 d views/hidden-debian7 -x sync -f
          [hidden-debian7] $ p4 -d views/hidden-debian7 diff -sd
          Files restored.
          Clean complete, took 863814 ms

          Alexey Larsky added a comment - Windows 7 SP1 x32|x64 + Debian 7 x32|x64 No warnings. As far I understood p4 'quick clean' option does't try remove untracked files. It only restore changed tracked files. Using remote perforce client: boatwright_hidden-debian7 [hidden-debian7] $ p4 workspace -o boatwright_hidden-debian7 'Don't update client' is set. Not saving the client changes. Note: .repository directory in workspace (if exists) is skipped during clean. Quickly cleaning workspace... [hidden-debian7] $ p4 d views/hidden-debian7 -x have Workspace is clean. Restoring changed and deleted files... [hidden-debian7] $ p4 d views/hidden-debian7 -x sync -f [hidden-debian7] $ p4 -d views/hidden-debian7 diff -se //mts/cn/3rdparty/Google/Chromium/Streams/34.0/src/build/gyp_helper.pyc#8 - refreshing /home/user/views/hidden-debian7/3rdparty/Chromium/src/build/gyp_helper.pyc ... //mts/cn/Applications/ProPlus_SDK/Streams/v06/build/cmake/version.inc#2 - refreshing /home/user/views/hidden-debian7/mts/cmake/version.inc [hidden-debian7] $ p4 d views/hidden-debian7 -x sync -f [hidden-debian7] $ p4 -d views/hidden-debian7 diff -sd Files restored. Clean complete, took 863814 ms

          Rob Petti added a comment -

          That log looks fine to me... Are you able to confirm that files are left behind?

          Rob Petti added a comment - That log looks fine to me... Are you able to confirm that files are left behind?

          Alexey Larsky added a comment - - edited

          Yes. All non tracked files is present after quick clean.
          Don't forget that .p4config file - is exception. It shouldn`t be removed during clean.

          Alexey Larsky added a comment - - edited Yes. All non tracked files is present after quick clean. Don't forget that .p4config file - is exception. It shouldn`t be removed during clean.

          Rob Petti added a comment -

          Again, this is working fine for me in production, so I honestly don't know how to debug it.

          File a separate ticket for the .p4config issue. It's more complicated than you think, because your .p4config file can actually be named anything you want (as it is configurable by the P4CONFIG environment variable, which the p4 plugin clears when it runs).

          Rob Petti added a comment - Again, this is working fine for me in production, so I honestly don't know how to debug it. File a separate ticket for the .p4config issue. It's more complicated than you think, because your .p4config file can actually be named anything you want (as it is configurable by the P4CONFIG environment variable, which the p4 plugin clears when it runs).

          Alexey Larsky added a comment -

          Which Perforce client and server versions do you use?
          Each us ws has .p4client configuration.
          Which exact command should remove untracked files?

          PS. We use perforce with local proxies.

          Server version: P4D/LINUX26X86_64/2011.1/428451 (2012/03/08)
          Proxy version: P4P/LINUX26X86/2010.2/341251 (2011/08/05)
          ...
          Broker version: P4BROKER/LINUX26X86_64/2011.1/370818

          PPS. Perforce promises native 'p4 clean' command in ver. 2014.1
          http://www.p4ideax.com/ideas/434/add-a-clean-operation-to-p4-and-p4v

          Alexey Larsky added a comment - Which Perforce client and server versions do you use? Each us ws has .p4client configuration. Which exact command should remove untracked files? PS. We use perforce with local proxies. Server version: P4D/LINUX26X86_64/2011.1/428451 (2012/03/08) Proxy version: P4P/LINUX26X86/2010.2/341251 (2011/08/05) ... Broker version: P4BROKER/LINUX26X86_64/2011.1/370818 PPS. Perforce promises native 'p4 clean' command in ver. 2014.1 http://www.p4ideax.com/ideas/434/add-a-clean-operation-to-p4-and-p4v

          Rob Petti added a comment -

          I use 2012.1, also with proxies in each office.

          There is no single command to remove untracked files. The plugin compares what you have to your p4 have list (which is presumably empty, since you appear to be using a read-only replica) then removes anything that peforce doesn't think you have synced.

          Yes, p4 clean support will come in a future version of the plugin.

          Rob Petti added a comment - I use 2012.1, also with proxies in each office. There is no single command to remove untracked files. The plugin compares what you have to your p4 have list (which is presumably empty, since you appear to be using a read-only replica) then removes anything that peforce doesn't think you have synced. Yes, p4 clean support will come in a future version of the plugin.

          Rob Petti added a comment -

          You will probably want to ensure that the broker is not configured to prevent any commands from running. That's caused the plugin problems in the past, and may be what you are experiencing.

          Rob Petti added a comment - You will probably want to ensure that the broker is not configured to prevent any commands from running. That's caused the plugin problems in the past, and may be what you are experiencing.

          Alexey Larsky added a comment -

          Update p4proxy 2010.2/341251 to 2013.3/740675 solve the issue.
          Before update p4proxy (2010.2/341251) version was less then p4d version (2011.1/428451).

          Alexey Larsky added a comment - Update p4proxy 2010.2/341251 to 2013.3/740675 solve the issue. Before update p4proxy (2010.2/341251) version was less then p4d version (2011.1/428451).

            Unassigned Unassigned
            cmcginty Casey McGinty
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: