aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Stop convert windows path to posix style

Open y-stm opened this issue 11 months ago • 5 comments

Which issue(s) does this change fix?

#7807

Why is this change necessary?

This change make enable to work sam local invoke or sam local start-api with some container management tools other than Docker Desktop in Windows (such as Rancher Desktop and Podman Desktop.)

How does it address the issue?

The cause of disturbing other tools is converting windows path to posix style when binds host directory to container. (that converts 'C:\path\to\built\Function' to '/c/path/to/built/Function') However, this conversion suits only for Docker Toolkit and other docker engines don't handle correctly unix-style-path as host directory path. Removing converting function and uses will fix this issue.

What side effects does this change have?

This change may affect only in windows. Because removed function works as if identity function when given path is already unix style. After this PR, sam cli will lose Docker Toolbox support.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • [ ] Add input/output type hints to new functions/methods
  • [ ] Write design document if needed (Do I need to write a design document?)
  • [x] Write/update unit tests
  • [ ] Write/update integration tests
  • [ ] Write/update functional tests if needed
  • [x] make pr passes
  • [ ] make update-reproducible-reqs if dependencies were changed
  • [ ] Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

y-stm avatar Jan 09 '25 14:01 y-stm

Hi @y-stm, thank you for raising this PR! I see some tests are failing due to linting issues, can you please update this PR to fix them?

seshubaws avatar Jan 09 '25 17:01 seshubaws

Can you elaborate on this following statement?

After this PR, sam cli will lose Dropbox Toolbox support.

vicheey avatar Jan 22 '25 02:01 vicheey

@vicheey oh I'm sorry for word-typo. It means Docker Toolbox, not Dropbox. I updated the comment above.

I also rebased the branch onto upstream/develop and run ./Make.ps1 -Pr .

y-stm avatar Jan 25 '25 15:01 y-stm

Thank you. Approved the workflow and waiting for test result.

vicheey avatar Feb 17 '25 09:02 vicheey

We just need to make sure we test this properly in Windows (cmd, Powershell, Git bash, etc).

But Docker Toolbox is deprecated since a few years ago, so it would be okay to drop support at this point https://github.com/docker-archive/toolbox

valerena avatar Feb 20 '25 19:02 valerena