Skip to content

aws-codepipeline-actions: Problem Cloning the AWS CDK Repository on Windows #32808

@azarboon

Description

@azarboon

Describe the bug

When cloning the AWS CDK repository on a Windows system, I encountered issues where certain files appear in the Git index but are not present on the filesystem. This causes git status to show these files as deleted, and attempts to restore or interact with them fail. The issue might be related to Windows' filesystem limitations, but the root cause remains unclear.

To fix the issue, I cloned the repository using Windows Subsystem for Linux (WSL) in VS Code, the Bash terminal in VS Code, and Git Desktop's Bash, but none of these helped. I also changed case sensitivity (through core.ignorecase), enabled long file paths (through core.longpaths), and modified the Windows registry, but this did not resolve the problem.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

The repository should clone successfully on Windows, with all files checked out to the filesystem as expected. Running git status and git diff after merging updates from upstream/main should not show any unexpected deletions or errors related to file handling. Cross-platform compatibility issues, if present, should be handled gracefully to allow contributors to work seamlessly regardless of their operating system.

Current Behavior

git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json
        deleted:    packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json

no changes added to commit (use "git add" and/or "git commit -a")

Also,

git diff
diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json
deleted file mode 100644
index 8352392771..0000000000
--- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "version": "38.0.1",
-  "files": {
-    "6ead11ac2a258f5956aa4d821020d99d8460173de308c7fd28a388dc243e3f89": {
-      "source": {
-        "path": "cross-region-stack-123456789012:us-west-2.template.json",
-        "packaging": "file"
-      },
-      "destinations": {
-        "123456789012-us-west-2": {
-          "bucketName": "cdk-hnb659fds-assets-123456789012-us-west-2",
-          "objectKey": "6ead11ac2a258f5956aa4d821020d99d8460173de308c7fd28a388dc243e3f89.json",
-          "region": "us-west-2",
-          "assumeRoleArn": "arn:${AWS::Partition}:iam::123456789012:role/cdk-hnb659fds-file-publishing-role-123456789012-us-west-2"
-        }
-      }
-    }
-  },
-  "dockerImages": {}
-}
\ No newline at end of file
diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json
deleted file mode 100644
index d37e16bccf..0000000000
--- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json
+++ /dev/null
@@ -1,167 +0,0 @@
-{
- "Resources": {
-  "CrossRegionCodePipelineReplicationBucketEncryptionKey70216490": {
-   "Type": "AWS::KMS::Key",
-   "Properties": {
-    "KeyPolicy": {
-     "Statement": [
-      {
-       "Action": "kms:*",
-       "Effect": "Allow",
-       "Principal": {
-        "AWS": "arn:aws:iam::123456789012:root"
-       },
-       "Resource": "*"
-      },
-      {
-       "Action": [
-        "kms:Decrypt",
-        "kms:DescribeKey",
-        "kms:Encrypt",
-        "kms:GenerateDataKey*",
-        "kms:ReEncrypt*"
-       ],
-       "Effect": "Allow",
-       "Principal": {
-        "AWS": "arn:aws:iam::123456789012:role/MyPipelineRoleName"
-       },
-       "Resource": "*"
-      }
-     ],
-     "Version": "2012-10-17"
-    }
-   },
-   "UpdateReplacePolicy": "Delete",
-   "DeletionPolicy": "Delete"
-  },
-  "CrossRegionCodePipelineReplicationBucketEncryptionAliasF1A0F37D": {
-   "Type": "AWS::KMS::Alias",
-   "Properties": {
-    "AliasName": "alias/ort-us-wtencryptionalias8f9701ce6a32f909886f",
-    "TargetKeyId": {
-     "Fn::GetAtt": [
-      "CrossRegionCodePipelineReplicationBucketEncryptionKey70216490",
-      "Arn"
-     ]
-    }
-   },
-   "UpdateReplacePolicy": "Delete",
-   "DeletionPolicy": "Delete"
-  },
-  "CrossRegionCodePipelineReplicationBucketFC3227F2": {
-   "Type": "AWS::S3::Bucket",
-   "Properties": {
-    "BucketEncryption": {
-     "ServerSideEncryptionConfiguration": [
-      {
-       "ServerSideEncryptionByDefault": {
-        "KMSMasterKeyID": {
-         "Fn::Join": [
-          "",
-          [
-           "arn:aws:kms:us-west-2:123456789012:",
-           {
-            "Ref": "CrossRegionCodePipelineReplicationBucketEncryptionAliasF1A0F37D"  
-           }
-          ]
-         ]
-        },
-        "SSEAlgorithm": "aws:kms"
-       }
-      }
-     ]
-    },
-    "BucketName": "cross-region-support-us-weplicationbucket8a287d3945436008ebfd",    
-    "PublicAccessBlockConfiguration": {
-     "BlockPublicAcls": true,
-     "BlockPublicPolicy": true,
-     "IgnorePublicAcls": true,
-     "RestrictPublicBuckets": true
-    }
-   },
-   "UpdateReplacePolicy": "Retain",
-   "DeletionPolicy": "Retain"
-  },
-  "CrossRegionCodePipelineReplicationBucketPolicyB7BA2BCA": {
-   "Type": "AWS::S3::BucketPolicy",
-   "Properties": {
-    "Bucket": {
-     "Ref": "CrossRegionCodePipelineReplicationBucketFC3227F2"
-    },
-    "PolicyDocument": {
-     "Statement": [
-      {
-       "Action": "s3:*",
-       "Condition": {
-        "Bool": {
-         "aws:SecureTransport": "false"
-        }
-       },
-       "Effect": "Deny",
-       "Principal": {
-        "AWS": "*"
-       },
-       "Resource": [
-        {
-         "Fn::GetAtt": [
-          "CrossRegionCodePipelineReplicationBucketFC3227F2",
-          "Arn"
-         ]
-        },
-        {
-         "Fn::Join": [
-          "",
-          [
-           {
-            "Fn::GetAtt": [
-             "CrossRegionCodePipelineReplicationBucketFC3227F2",
-             "Arn"
-            ]
-           },
-           "/*"
-          ]
-         ]
-        }
-       ]
-      }
-     ],
-     "Version": "2012-10-17"
-    }
-   }
-  }
- },
- "Parameters": {
-  "BootstrapVersion": {
-   "Type": "AWS::SSM::Parameter::Value<String>",
-   "Default": "/cdk-bootstrap/hnb659fds/version",
-   "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
-  }
- },
- "Rules": {
-  "CheckBootstrapVersion": {
-   "Assertions": [
-    {
-     "Assert": {
-      "Fn::Not": [
-       {
-        "Fn::Contains": [
-         [
-          "1",
-          "2",
-          "3",
-          "4",
-          "5"
-         ],
-         {
-          "Ref": "BootstrapVersion"
-         }
-        ]
-       }
-      ]
-     },
-     "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
-    }
-   ]
-  }
- }
-}
\ No newline at end of file

Also,

git restore "packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json"
git restore "packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json"

error: unable to stat just-written file packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.assets.json: No such file or directory
error: unable to stat just-written file packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/cross-region-stack-123456789012:us-west-2.template.json: No such file or directory

Reproduction Steps

# Fork the AWS CDK repository on GitHub
# Clone the forked repository
git clone https://github.com/<your-username>/aws-cdk.git
cd aws-cdk

# Add the upstream repository to fetch updates
git remote add upstream https://github.com/aws/aws-cdk.git

# Fetch the latest changes from upstream and merge them
git fetch upstream
git merge upstream/main

# Check the status to see any changes
git status

# View differences in the repository
git diff

# Attempt to restore problematic files
git restore <file>

Possible Solution

  1. Investigate and address why the files cannot be created on Windows systems.
  2. Consider renaming files with incompatible characters (e.g., replacing colons with _ or -).
  3. Provide a script or process to handle these files for Windows users specifically.

Additional Information/Context

No response

CDK CLI Version

2.173.2 (build f8e6207)

Framework Version

No response

Node.js Version

v22.9.0

OS

Windows 11 Home Single Language - version 23H2 - OS build 22631.4602

Language

TypeScript
but seems this issue is agnostic of language.

Language Version

No response

Other information

Git: Version 2.42
Cloning method: Git Bash / WSL / GitHub Desktop
Repository: AWS CDK (main branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/coreRelated to core CDK functionalitybugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions