aaronpowell / FSharp.CosmosDb

An F# wrapper around Cosmos DB's .NET SDK to make it more friendly for F# developers
MIT License
79 stars 12 forks source link

Cannot open in dev container when on Windows #67

Closed mderriey closed 2 years ago

mderriey commented 2 years ago

Hey 🙋‍♀️

Thanks for the repo, which I wanted to give a try after your latest post on Cosmos DB in a dev container.

I'm on a Windows machine:

C:\Users\me\dev\FSharp.CosmosDb [main ≡]
λ  git config --get core.autocrlf
true

Steps I took

  1. Clone the repo
  2. Open in VS Code
  3. Click the "Reopen in container" button in the pop-up notification

Result

Building the container fails.

Toggle me to see the errors
#7 3.064 /tmp/library-scripts/common-debian.sh: line 11: $'\r': command not found: invalid optionbrary-scripts/common-debian.sh: line 12: set: -
#7 3.064 set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
#7 3.065 /tmp/library-scripts/common-debian.sh: line 13: $'\r': command not found
#7 3.068 /tmp/library-scripts/common-debian.sh: line 23: $'\r': command not found
#7 3.068 /tmp/library-scripts/common-debian.sh: line 38: syntax error near unexpected token `$'do\r''
#7 3.068 /tmp/library-scripts/common-debian.sh: line 38: `    for CURRENT_USER i' ${POSSIBLE_USERS[@]}; do
------
executor failed running [/bin/sh -c apt-get update     && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true"     && /bin/bash /tmp/library-scripts/docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}"     && apt-get autoremove -y && apt-get clean -y &&rm -rf /var/lib/apt/lists/* /tmp/library-scripts/]: exit code: 2
ERROR: Service 'app' failed to build : Build failed
[10452 ms] Error: Command failed: docker-compose --project-name fsharpcosmosdb_devcontainer -f c:\Users\me\dev\FSharp.CosmosDb\.devcontainer\docker-compose.yml build
[10453 ms]     at gu (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:220:419)
[10453 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[10453 ms]     at async _S (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:220:2358)
[10454 ms]     at async AS (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:204:2361)
[10454 ms]     at async KS (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:261:2177)
[10455 ms]     at async co (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:261:3110)
[10456 ms]     at async LP (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:360:9352)
[10456 ms]     at async DP (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js:360:9108)
[10470 ms] Exit code 1
[10476 ms] Command failed: C:\Users\me\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-containers-0.245.2\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\me\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\me\dev\FSharp.CosmosDb --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\me\dev\FSharp.CosmosDb --log-level debug --log-format json --config c:\Users\me\dev\FSharp.CosmosDb\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true

Quick analysis

All the Bash files in the .devcontainer folder were checked out CRLF-style. Manually changing them to LF-style made the error disappear.

Should we enforce LF line endings on these files through EditorConfig and .gitattributes or am I holding part of it wrong?

aaronpowell commented 2 years ago

Goddamn line endings.

Yeah, should enforce it using .gitattributes - I pretty much only use Linux these days so I don't hit it. Want to send me a PR with how the file should be?

mderriey commented 2 years ago

Will do

On Fri 26 Aug 2022 at 02:42, Aaron Powell @.***> wrote:

Goddamn line endings.

Yeah, should enforce it using .gitattributes - I pretty much only use Linux these days so I don't hit it. Want to send me a PR with how the file should be?

— Reply to this email directly, view it on GitHub https://github.com/aaronpowell/FSharp.CosmosDb/issues/67#issuecomment-1227890742, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOR436H43MAMPXYMBIUVVTV3AHHHANCNFSM57S7FRKA . You are receiving this because you authored the thread.Message ID: @.***>