Skip to content

Corrupt linux format.patch #2322

Closed

Description

@sdmaclea

My pull request introduced some CoreCLR JIT format errors.

The format.patch artifact was corrupt. It contained superfluous diffs. The superfluous diffs included files from mono which my PR didn't touch as well as a diff of format.patch itself.

diff --git a/src/coreclr/format.patch b/src/coreclr/format.patch
index 3759a98..e69de29 100644
--- a/src/coreclr/format.patch
+++ b/src/coreclr/format.patch
@@ -1,47 +0,0 @@
-diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp
-index a71c325ff48..c0569355c89 100644
---- a/src/coreclr/src/jit/importer.cpp
-+++ b/src/coreclr/src/jit/importer.cpp
-@@ -15184,41 +15184,41 @@ void Compiler::impImportBlockCode(BasicBlock* block)
-                             info.compCompHnd->compareTypesForEquality(resolvedToken.hClass, clsHnd);
- 
-                         if (compare == TypeCompareState::Must)
-                         {
-                             JITDUMP("\nOptimizing %s (%s) -- type test will succeed\n",
-                                     opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY", eeGetClassName(clsHnd));
- 
-                             // For UNBOX, null check (if necessary), and then leave the box payload byref on the stack.
-                             if (opcode == CEE_UNBOX)
-                             {
-                                 GenTree* cloneOperand;
-                                 op1 = impCloneExpr(op1, &cloneOperand, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL,
-                                                    nullptr DEBUGARG("optimized unbox clone"));
- 
-                                 GenTree* boxPayloadOffset = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
-                                 GenTree* boxPayloadAddress =
-                                     gtNewOperNode(GT_ADD, TYP_BYREF, cloneOperand, boxPayloadOffset);
-                                 GenTree* nullcheck = gtNewOperNode(GT_NULLCHECK, TYP_I_IMPL, op1);
-                                 block->bbFlags |= BBF_HAS_NULLCHECK;
-                                 optMethodFlags |= OMF_HAS_NULLCHECK;
--                                GenTree* result    = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
-+                                GenTree* result = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
-                                 impPushOnStack(result, tiRetVal);
-                                 break;
-                             }
- 
-                             // For UNBOX.ANY load the struct from the box payload byref (the load will nullcheck)
-                             assert(opcode == CEE_UNBOX_ANY);
-                             GenTree* boxPayloadOffset  = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
-                             GenTree* boxPayloadAddress = gtNewOperNode(GT_ADD, TYP_BYREF, op1, boxPayloadOffset);
-                             impPushOnStack(boxPayloadAddress, tiRetVal);
-                             oper = GT_OBJ;
-                             goto OBJ;
-                         }
-                         else
-                         {
-                             JITDUMP("\nUnable to optimize %s -- can't resolve type comparison\n",
-                                     opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY");
-                         }
-                     }
-                     else
-                     {
diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp
index f82cc2a..21f5f36 100644
--- a/src/coreclr/src/jit/codegencommon.cpp
+++ b/src/coreclr/src/jit/codegencommon.cpp
@@ -7415,41 +7415,41 @@ void CodeGen::genFnProlog()
 #ifdef TARGET_ARM
     /*-------------------------------------------------------------------------
      *
      * Now start emitting the part of the prolog which sets up the frame
      */
 
     if (regSet.rsMaskPreSpillRegs(true) != RBM_NONE)
     {
         inst_IV(INS_push, (int)regSet.rsMaskPreSpillRegs(true));
         compiler->unwindPushMaskInt(regSet.rsMaskPreSpillRegs(true));
     }
 #endif // TARGET_ARM
 
 #ifdef TARGET_XARCH
     if (doubleAlignOrFramePointerUsed())
     {
         inst_RV(INS_push, REG_FPBASE, TYP_REF);
         compiler->unwindPush(REG_FPBASE);
 #ifdef USING_SCOPE_INFO
         psiAdjustStackLevel(REGSIZE_BYTES);
-#endif                 // USING_SCOPE_INFO
+#endif               // USING_SCOPE_INFO
 #ifndef TARGET_AMD64 // On AMD64, establish the frame pointer after the "sub rsp"
         genEstablishFramePointer(0, /*reportUnwindData*/ true);
 #endif // !_TARGET_AMD64_
 
 #if DOUBLE_ALIGN
         if (compiler->genDoubleAlign())
         {
             noway_assert(isFramePointerUsed() == false);
             noway_assert(!regSet.rsRegsModified(RBM_FPBASE)); /* Trashing EBP is out.    */
 
             inst_RV_IV(INS_AND, REG_SPBASE, -8, EA_PTRSIZE);
         }
 #endif // DOUBLE_ALIGN
     }
 #endif // TARGET_XARCH
 
 #ifdef TARGET_ARM64
     // Probe large frames now, if necessary, since genPushCalleeSavedRegisters() will allocate the frame. Note that
     // for arm64, genAllocLclFrame only probes the frame; it does not actually allocate it (it does not change SP).
     // For arm64, we are probing the frame before the callee-saved registers are saved. The 'initReg' might have
diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp
index cfa4b1f..236eceb 100644
--- a/src/coreclr/src/jit/emit.cpp
+++ b/src/coreclr/src/jit/emit.cpp
@@ -7002,41 +7002,41 @@ void emitter::emitNxtIG(bool extend)
     {
         emitCurIG->igFlags |= IGF_EXTEND;
 
 #if EMITTER_STATS
         emitTotalIGExtend++;
 #endif // EMITTER_STATS
     }
 
     // We've created a new IG; no need to force another one.
     emitForceNewIG = false;
 }
 
 /*****************************************************************************
  *
  *  emitGetInsSC: Get the instruction's constant value.
  */
 
 target_ssize_t emitter::emitGetInsSC(instrDesc* id)
 {
 #ifdef TARGET_ARM // should it be TARGET_ARMARCH? Why do we need this? Note that on ARM64 we store scaled immediates
-                    // for some formats
+                  // for some formats
     if (id->idIsLclVar())
     {
         int varNum = id->idAddr()->iiaLclVar.lvaVarNum();
 
         regNumber baseReg;
         int       offs = id->idAddr()->iiaLclVar.lvaOffset();
 #if defined(TARGET_ARM)
         int adr =
             emitComp->lvaFrameAddress(varNum, id->idIsLclFPBase(), &baseReg, offs, CodeGen::instIsFP(id->idIns()));
         int dsp = adr + offs;
         if ((id->idIns() == INS_sub) || (id->idIns() == INS_subw))
             dsp = -dsp;
 #elif defined(TARGET_ARM64)
         // TODO-ARM64-Cleanup: this is currently unreachable. Do we need it?
         bool FPbased;
         int  adr = emitComp->lvaFrameAddress(varNum, &FPbased);
         int  dsp = adr + offs;
         if (id->idIns() == INS_sub)
             dsp = -dsp;
 #endif
diff --git a/src/coreclr/src/jit/simd.cpp b/src/coreclr/src/jit/simd.cpp
index cb925b5..c128b92 100644
--- a/src/coreclr/src/jit/simd.cpp
+++ b/src/coreclr/src/jit/simd.cpp
@@ -1713,41 +1713,41 @@ GenTree* Compiler::impSIMDAbs(CORINFO_CLASS_HANDLE typeHnd, var_types baseType,
         // Abs is a no-op on unsigned integer type vectors
         retVal = op1;
     }
     else
     {
         assert(getSIMDSupportLevel() >= SIMD_SSE4_Supported);
         assert(baseType != TYP_LONG);
 
         retVal = gtNewSIMDNode(simdType, op1, SIMDIntrinsicAbs, baseType, size);
     }
 #elif defined(TARGET_ARM64)
     if (varTypeIsUnsigned(baseType))
     {
         // Abs is a no-op on unsigned integer type vectors
         retVal = op1;
     }
     else
     {
         retVal = gtNewSIMDNode(simdType, op1, SIMDIntrinsicAbs, baseType, size);
     }
-#else  // !defined(_TARGET_XARCH)_ && !defined(TARGET_ARM64)
+#else // !defined(_TARGET_XARCH)_ && !defined(TARGET_ARM64)
     assert(!"Abs intrinsic on non-xarch target not implemented");
 #endif // !_TARGET_XARCH_
 
     return retVal;
 }
 
 // Creates a GT_SIMD tree for Select operation
 //
 // Arguments:
 //    typeHnd          -  type handle of SIMD vector
 //    baseType         -  base type of SIMD vector
 //    size             -  SIMD vector size
 //    op1              -  first operand = Condition vector vc
 //    op2              -  second operand = va
 //    op3              -  third operand = vb
 //
 // Return Value:
 //    Returns GT_SIMD tree that computes Select(vc, va, vb)
 //
 GenTree* Compiler::impSIMDSelect(
diff --git a/src/mono/mono/arch/arm/arm-wmmx.h b/src/mono/mono/arch/arm/arm-wmmx.h
index e43ac77..6f2fc78 100644
--- a/src/mono/mono/arch/arm/arm-wmmx.h
+++ b/src/mono/mono/arch/arm/arm-wmmx.h
@@ -1,178 +1,178 @@
-/*
- * ARM CodeGen
- * XScale WirelessMMX extensions
- * Copyright 2002 Wild West Software
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-  }
-}


 Truncated ....


+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Debug",
+      "System": "Information",
+      "Microsoft": "Information"
+    }
+  }
+}
diff --git a/src/mono/netcore/sample/AspNetCore/appsettings.json b/src/mono/netcore/sample/AspNetCore/appsettings.json
index 81ff877..d9d9a9b 100644
--- a/src/mono/netcore/sample/AspNetCore/appsettings.json
+++ b/src/mono/netcore/sample/AspNetCore/appsettings.json
@@ -1,10 +1,10 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Information",
-      "Microsoft": "Warning",
-      "Microsoft.Hosting.Lifetime": "Information"
-    }
-  },
-  "AllowedHosts": "*"
-}
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  },
+  "AllowedHosts": "*"
+}

Activity

  1. added
    untriaged
    on Jan 29, 2020
  2. lpereira commented on Jan 29, 2020

    @lpereira
    Contributor

    I know that Mono has some .gitattributes forcing some files to have CRLF line endings (I don't know about why; the source history wasn't much helpful; maybe those files should be nuked?). Maybe related?

  3. sdmaclea commented on Jan 29, 2020

    @sdmaclea
    Author
  4. sdmaclea commented on Jan 29, 2020

    @sdmaclea
    ContributorAuthor

    Looks like #1735 added format.patch into src/coreclr. @erozenfeld I assume this was accidental.

    Created #2323... Merged the format.patch part of the issue is resolved. The mono part still needs investigation.

  5. sdmaclea commented on Jan 29, 2020

    @sdmaclea
    ContributorAuthor

    @BruceForstall I was pretty sure the format checking used to only check the coreclr src/jit directory. Perhaps mono also support format checking, but their formatting is broken...

  6. BruceForstall commented on Jan 29, 2020

    @BruceForstall
    Contributor

    Yes, the format job should only check src/coreclr/src/jit. If that's not true, it's a bug.

  7. added
    area-Infrastructure-coreclr
    and removed
    untriaged
    on Jan 29, 2020
  8. sdmaclea commented on Jan 29, 2020

    @sdmaclea
    ContributorAuthor

    So I understand the failure. @lpereira guess was good.

    From the logs

    2020-01-29T00:46:35.0253127Z warning: CRLF will be replaced by LF in src/mono/mono/arch/arm/arm-wmmx.h.
    2020-01-29T00:46:35.0253886Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0258191Z warning: CRLF will be replaced by LF in src/mono/mono/benchmark/bulkcpy.il.
    2020-01-29T00:46:35.0258865Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0278817Z warning: CRLF will be replaced by LF in src/mono/mono/benchmark/zipmark.cs.
    2020-01-29T00:46:35.0279504Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0283918Z warning: CRLF will be replaced by LF in src/mono/mono/cil/make-opcode-def.xsl.
    2020-01-29T00:46:35.0284514Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0313895Z warning: CRLF will be replaced by LF in src/mono/mono/metadata/normalization-tables.h.
    2020-01-29T00:46:35.0314407Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0318347Z warning: CRLF will be replaced by LF in src/mono/mono/mini/genmdesc.py.
    2020-01-29T00:46:35.0320670Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0323129Z warning: CRLF will be replaced by LF in src/mono/mono/tests/bug-335131.2.cs.
    2020-01-29T00:46:35.0323849Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0325168Z warning: CRLF will be replaced by LF in src/mono/mono/tests/bug-472600.2.cs.
    2020-01-29T00:46:35.0325802Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0328196Z warning: CRLF will be replaced by LF in src/mono/mono/tests/bug-515884.il.
    2020-01-29T00:46:35.0334778Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0335679Z warning: CRLF will be replaced by LF in src/mono/mono/tests/checked.cs.
    2020-01-29T00:46:35.0336408Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0337046Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/appdomain.out.
    2020-01-29T00:46:35.0337755Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0339012Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/delegate-async-exit.out.
    2020-01-29T00:46:35.0339541Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0340416Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/delegate-delegate-exit.out.
    2020-01-29T00:46:35.0340928Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0341311Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/delegate.out.
    2020-01-29T00:46:35.0341603Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0342370Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/finalizer-abort.out.
    2020-01-29T00:46:35.0342702Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0343391Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/finalizer-exit.out.
    2020-01-29T00:46:35.0344283Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0345321Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-exit.out.
    2020-01-29T00:46:35.0345841Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0346754Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-returns-abort-resetabort.out.
    2020-01-29T00:46:35.0347461Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0348340Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-returns-background-abort-resetabort.out.
    2020-01-29T00:46:35.0348853Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0349903Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-returns-background-resetabort.out.
    2020-01-29T00:46:35.0350459Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0351400Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-returns-background.out.
    2020-01-29T00:46:35.0352035Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0352932Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/main-returns.out.
    2020-01-29T00:46:35.0353390Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0354206Z warning: CRLF will be replaced by LF in src/mono/mono/tests/exiting/subthread-exit.out.
    2020-01-29T00:46:35.0354697Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0355896Z warning: CRLF will be replaced by LF in src/mono/mono/tests/load-missing.il.
    2020-01-29T00:46:35.0356440Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0357202Z warning: CRLF will be replaced by LF in src/mono/mono/tests/metadata-verifier/module.il.
    2020-01-29T00:46:35.0357873Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0358498Z warning: CRLF will be replaced by LF in src/mono/mono/tests/mutexes.cs.
    2020-01-29T00:46:35.0358863Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0359202Z warning: CRLF will be replaced by LF in src/mono/mono/tests/thread4.cs.
    2020-01-29T00:46:35.0359426Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0359813Z warning: CRLF will be replaced by LF in src/mono/mono/tests/verifier/unverifiable_ldobj_with_generic_type_definition.il.
    2020-01-29T00:46:35.0360112Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0360432Z warning: CRLF will be replaced by LF in src/mono/mono/tests/verifier/unverifiable_throw_with_unboxed_generic_argument.il.
    2020-01-29T00:46:35.0360757Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0361131Z warning: CRLF will be replaced by LF in src/mono/msvc/libmonoruntime.targets.
    2020-01-29T00:46:35.0361575Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0361992Z warning: CRLF will be replaced by LF in src/mono/msvc/mono_csharp.vssettings.
    2020-01-29T00:46:35.0362353Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0362699Z warning: CRLF will be replaced by LF in src/mono/msvc/monoposixhelper.def.
    2020-01-29T00:46:35.0362978Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0376176Z warning: CRLF will be replaced by LF in src/mono/msvc/win32.xml.
    2020-01-29T00:46:35.0376871Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0382552Z warning: CRLF will be replaced by LF in src/mono/netcore/sample/AspNetCore/Properties/launchSettings.json.
    2020-01-29T00:46:35.0383383Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0384026Z warning: CRLF will be replaced by LF in src/mono/netcore/sample/AspNetCore/appsettings.Development.json.
    2020-01-29T00:46:35.0384816Z The file will have its original line endings in your working directory.
    2020-01-29T00:46:35.0385299Z warning: CRLF will be replaced by LF in src/mono/netcore/sample/AspNetCore/appsettings.json.
    2020-01-29T00:46:35.0385581Z The file will have its original line endings in your working directory.
    

    So part of the problem is that the jit diff is generated by running clang-tidy to modify the files in place. Then we run git diff on the repo whole to generate the patch. Because these files are in the repo wrong they show up in the diff.

    We can make this more robust by only running the git diff on src/coreclr/src/jit

  9. BruceForstall commented on Jan 29, 2020

    @BruceForstall
    Contributor

    Related: #2222

  10. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
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

    area-Infrastructure-coreclr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions