Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patchSet fails when localRoot contains subdirectory #176

Open
ndhaller opened this issue Aug 18, 2023 · 1 comment
Open

patchSet fails when localRoot contains subdirectory #176

ndhaller opened this issue Aug 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ndhaller
Copy link
Contributor

When a Combination Source uses a localRoot with a sub-directory name, and that Source uses a patchSet, the dynamic branch JSON file is attempted to be created in the wrong directory location and errors out.

Example:

  <PatchSets>
    <PatchSet remote="Edk2PlatformsRepo" name="edk2platforms_test" parentSha="84ccada59257a8151a592a416017fbb03b8ed3cf" fetchBranch="master">
      <Revert sha="84ccada59257a8151a592a416017fbb03b8ed3cf" />
    </PatchSet> 
  </PatchSets>


  <CombinationList>
    <Combination name="sandbox-subDirectory-patchSet-test" description="combo will fail">
      <Source localRoot="test/edk2-platforms" remote="Edk2PlatformsRepo" patchSet="edk2platforms_test" sparseCheckout="true" />
    </Combination>
    <Combination name="sandbox-main" description="combo will succeed">
      <Source localRoot="test/edk2-platforms" remote="Edk2PlatformsRepo" branch="master" sparseCheckout="true" />
    </Combination>
  </CombinationList>

Attempting to checkout "sandbox-subDirectory-patchSet-test" combination will crash after the dynamic branch has been created.

edkrepo checkout sandbox-subDirectory-patchSet-test -v
Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\edkrepo\edkrepo_cli.py", line 183, in main
    command.run_command(command_name, parsed_args, config)
  File "C:\Python39\lib\site-packages\edkrepo\commands\composite_command.py", line 38, in run_command
    return command.run_command(args, config)
  File "C:\Python39\lib\site-packages\edkrepo\commands\checkout_command.py", line 45, in run_command
    checkout(args.Combination, global_manifest_path, args.verbose, args.override, get_repo_cache_obj(config))
  File "C:\Python39\lib\site-packages\edkrepo\common\common_repo_functions.py", line 621, in checkout
    checkout_repos(verbose, override, repo_sources, workspace_path, manifest, global_manifest_path)
  File "C:\Python39\lib\site-packages\edkrepo\common\common_repo_functions.py", line 367, in checkout_repos
    patchset_branch_creation_flow(repo_to_checkout, repo, workspace_path, manifest, global_manifest_path, override)
  File "C:\Python39\lib\site-packages\edkrepo\common\common_repo_functions.py", line 422, in patchset_branch_creation_flow
    create_local_branch(repo.patch_set, patchset, global_manifest_path, manifest, repo_obj)
  File "C:\Python39\lib\site-packages\edkrepo\common\common_repo_functions.py", line 885, in create_local_branch
    with open(json_path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\git3\\Edkrepo_Sandbox\\test\\repo\\patchset_edk2-platforms.json'
Error: [Errno 2] No such file or directory: 'C:\\git3\\Edkrepo_Sandbox\\test\\repo\\patchset_edk2-platforms.json'

Edkrepo_Sandbox\repo\patchset_edk2-platforms.json should have been created.
Instead, "Edkrepo_Sandbox\test\repo\patchset_edk2-platforms.json" is attempted to be created, and fails.

Reproduced with edkrepo 3.1.1, python 3.9.13, and git version 2.39.1.windows.1 , on Windows 11 Enterprise

@ashedesimone
Copy link
Contributor

We do not currently support a local root definition that would result in all repositories not being at the root of the workspace. This is a valid enhancement request and I have updated the tags accordingly.

@ashedesimone ashedesimone added the enhancement New feature or request label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants