stepchowfun / toast

Containerize your development and continuous integration environments. 🥂
Other
1.57k stars 39 forks source link

Mount_paths on Windows not working properly #456

Closed raennor closed 1 year ago

raennor commented 1 year ago

Description Each path which is configured on mount_paths section will result in a not usable path for Docker on Windows. The problem seams to be, that toast uses the function canonicalize to create the absolute source dir which produces a extended length path on Windows which Docker cannot interpret. The Result of this is a error message like following from Docker: Error response from daemon: \\?\C:\Users\Testuser\Downloads%!(EXTRA string=is not a valid Windows path)

Instructions to reproduce the bug Configure a mount_path in toast.yml and run toast.

Environment information:

stepchowfun commented 1 year ago

Hi @raennor, thank you for filing this bug report! Oh dear.

This is unfortunate, because to me it looks like the path is valid according to my (weak) understanding of Windows paths, and Docker is just not equipped to handle it (as you mentioned). So maybe this should be a bug for Docker, not Toast.

But of course it is not acceptable that mount_paths doesn't work on Windows, so maybe we can come up with a workaround on our end. I'm not sure exactly what to do at this moment, but suggestions/pull requests are welcome. Maybe instead of std::fs::canonicalize-ing source_dir, we should just join source_dir with the current directory (std::env::current_dir).

stepchowfun commented 1 year ago

I'm attempting a fix here: https://github.com/stepchowfun/toast/pull/457

It's worth noting that although we run the unit tests on all platforms, we don't run the integration tests on Windows because the way Docker on GitHub-hosted runners can only run Windows containers, but Toast (currently) only supports Linux containers. So unfortunately we have this gap in our testing process.

I will ship the attempted fix, but please re-open this issue if you still encounter issues after upgrading to Toast v0.46.1

raennor commented 1 year ago

Hi @stepchowfun, currently I found another problem which could prevent usage on Windows. The PR #459 could hopefully address this problem.

stepchowfun commented 1 year ago

Hi @raennor, I've merged your PR and followed it with a larger refactoring in https://github.com/stepchowfun/toast/pull/460 to leverage static typing to help catch path-related bugs. I was finally able to boot up my Windows machine to verify that mount_paths (as well as the other main filesystem related features) work as intended on that platform, and the new version has been released as v0.46.2. Let me know if you run into any further issues, and thanks again for your contributions!