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

P4 plugin removed BOM from utf8 files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      CloudBees Jenkins Enterprise 2.89.1.7-rolling
      P4 Plugin version: 1.80
      OS: happens on both windows 10+ and Centos
    • Similar Issues:

      Description

      Since version 1.80, the P4 Plugin removes the BOM from all UTF8 files when syncing. Without the BOM files may be incorrectly decoded. This behaviour does not mirror the behaviour of P4.EXE (2015.2 onwards). Furthermore, you are not able to use '-Dcom.perforce.p4java.filesys.utf8bom=1` as a work around (I believe this is because the value is now hardcoded: https://swarm.workshop.perforce.com/changes/23042). I personally would always want the default behaviour of the P4 Plugin to match the default behaviour of P4.exe.

      Repo Steps:

      • Create UTF8 file with UTF8 characters
      • Submit that file to perforce (ensuring its type is utf8)
      • Make sure you have the P4 plugin installed, version 1.8.0 or later
      • Create a job to sync the file
      • Install P4 and compare¬†
        • I did this all on the master with the following commands:¬†

          head -c 50 /var/lib/jenkins/workspace/TestJob/test_utf8.ps1 | hexdump -C

          p4 -p <server> -u <user> print -o ~/test/test_utf8.ps1 //CM/DREUK/Prod/Scripts/Config/Windows/test_utf8.ps1head -c 50 ~/test/test_utf8.ps1 | hexdump -C

          p4 -V | grep "Rev"

          cat /etc/sysconfig/jenkins | grep "JENKINS_JAVA_OPTIONS="

        Attachments

        1. Opened_in_HxD_on_Windows_using_p4_exe.png
          Opened_in_HxD_on_Windows_using_p4_exe.png
          6 kB
        2. P4_1.7.7.png
          P4_1.7.7.png
          24 kB
        3. P4_1.8.0.png
          P4_1.8.0.png
          29 kB
        4. P4_1.8.3.png
          P4_1.8.3.png
          23 kB
        5. test.ps1
          0.1 kB

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Paul Allen
            Path:
            UNICODE.md
            docs/images/node-advanced.png
            docs/images/node-jvmoptions.png
            src/main/java/org/jenkinsci/plugins/p4/client/ConnectionFactory.java
            http://jenkins-ci.org/commit/p4-plugin/b45fa1f221622efda37713a85cd278a6798eea57
            Log:
            Leave the filesys.utf8bom property unset.

            Updated docs to explain how to set the undoc configurable for builds
            slaves.

            JENKINS-49141

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: UNICODE.md docs/images/node-advanced.png docs/images/node-jvmoptions.png src/main/java/org/jenkinsci/plugins/p4/client/ConnectionFactory.java http://jenkins-ci.org/commit/p4-plugin/b45fa1f221622efda37713a85cd278a6798eea57 Log: Leave the filesys.utf8bom property unset. Updated docs to explain how to set the undoc configurable for builds slaves. JENKINS-49141
            Hide
            p4paul Paul Allen added a comment -

            Ready for release.

            Show
            p4paul Paul Allen added a comment - Ready for release.
            Hide
            p4paul Paul Allen added a comment -

            Released in 1.8.8

            Show
            p4paul Paul Allen added a comment - Released in 1.8.8
            Hide
            ramkrishna67 ram Shukla added a comment - - edited

            am facing the the same issue on P4Plugin version 1.10.6 and jenkins version 2.190.3
            error CNDL0104 : Not a valid source file; detail: Data at the root level is invalid. Line 1, position 1.

            Show
            ramkrishna67 ram Shukla added a comment - - edited am facing the the same issue on P4Plugin version 1.10.6 and jenkins version 2.190.3 error CNDL0104 : Not a valid source file; detail: Data at the root level is invalid. Line 1, position 1.
            Hide
            p4karl Karl Wirth added a comment -

            Hi ram Shukla - Please provide a screenshot of where you are seeing this error. Is it with the file you synced when you try to use it or when running the job?

            Show
            p4karl Karl Wirth added a comment - Hi ram Shukla - Please provide a screenshot of where you are seeing this error. Is it with the file you synced when you try to use it or when running the job?

              People

              Assignee:
              p4paul Paul Allen
              Reporter:
              peanderson peter anderson
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: