-
Notifications
You must be signed in to change notification settings - Fork 841
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
Support docker integration on Windows #5315
Support docker integration on Windows #5315
Conversation
b49f6d3
to
bbda3b1
Compare
858ec93
to
d1f6289
Compare
d1f6289
to
352faf1
Compare
I added ChangeLog entry and rebased the fix to master. From my PoV this is ready for review. Is there something else that I need to provide in order to get this merged? |
Hi @gdziadkiewicz and Haskell community, any update on when we might expect this feature/fix for Windows? I really would like this thing to happen, because our open source team wants to start working with dev containers. Most of us use a Windows machine with Docker. Thx for making the effort! I haven’t been able to test this PR myself. @hanjoosten, have you? |
Not really sure how to test this, but this is what I did, and what the result was:
|
Hi @hanjoosten , to test it locally I changed version number in |
@Michiel-s Form my PoV this is ready to be reviewed and merged. @snoyberg could you please help with progressing this? |
Hmm. I ran into a probably unrelated issue, building one of the dependancies.
|
@hanjoosten I will try to reproduce and investigate. Could you share more information about your environment? Things that I'm especially interested in are your:
|
@gdziadkiewicz , sorry for the late reply. I am very busy with other stuff these days.
If you need any other info, let me know.
|
@@ -340,6 +342,13 @@ runContainerAndExit = do | |||
mountArg mountSuffix (Mount host container) = | |||
["-v",host ++ ":" ++ container ++ mountSuffix] | |||
sshRelDir = relDirDotSsh | |||
toLinuxStylePath s | osIsWindows = | |||
T.pack s | |||
& T.replace ":\\" "/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right, it would convert c:\\foo
into c/foo
, for instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will double check and then fix or try to convince you that this is the right thing to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Together with & addStartingSlashIfMissing
(line 352) C:\\foo
becomes /c/foo
which is a legal and working thing. Maybe I could share some output from how this is working on my Windows machine to convince you that the folder sharing feature is working as expected?
As legal and working does not imply right I'm ready to discuss alternatives. I could mount/share the folders in /mnt/
(for our example /mnt/c/foo
). What do you think about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly can't figure out how all of that is supposed to work out correctly. As it stands now, this seems like it's trying to slyly address a bunch of edge cases, and I'm not convinced it's handling them correctly. It would be better to start off with what the expected behavior is for these edge cases, such as "c:\foo\bar"
or relative paths like "foo\bar"
. It seems to me like these two cases are now in conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right - it may be only working thanks to the fact that all paths happened to be absolute in my scenario. I will add explicit handling for absolute/relative paths and try to remove this hacky/sly smell around this change.
@hanjoosten I will try to reproduce the problem and investigate. |
Today I was lucky to be able to upgrade to windows 10, version 2004. So now I can use wsl2. I have been playing around with that now too. Still glad to test this change, if possible though. It could be very benificial to people using other windows builds. |
5a509e3
to
2b18da4
Compare
ba0b2e8
to
79d1c0a
Compare
79d1c0a
to
6af7918
Compare
Hi all, I am closing this as I fully switched to using Haskell via wsl2 and won't have capacity to complete that. |
Fixes #2421
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!
What did I do?
I added function transforming Windows paths to Linux paths and applied it places in which the path needs to be in Linux style (because it's a path inside the container).
How did I test it?
I ran
stack --docker ghci
,stack --docker build
,stack --docker test
for https://github.com/BNFC/bnfc with and without STACK_YAML on my Windows 10 + Docker for Windows (wsl2 engine) machine.