This repository was archived by the owner on Jul 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
working stack+debugger #4
Open
pshirshov
wants to merge
2
commits into
hmemcpy:master
Choose a base branch
from
pshirshov:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,78 @@ | ||
| FROM hmemcpy/hie:8.6.5 | ||
| FROM alpine | ||
|
|
||
| # && nix-env -i ghc-8.6.5 \ | ||
|
|
||
| # This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" | ||
| # property in devcontainer.json to use it. On Linux, the container user's GID/UIDs | ||
| # will be updated to match your local UID/GID (when using the dockerFile property). | ||
| # See https://aka.ms/vscode-remote/containers/non-root-user for details. | ||
| ARG USERNAME=vscode | ||
| ARG USER_UID=1000 | ||
| ARG USER_GID=$USER_UID | ||
|
|
||
| # Set to false to skip installing zsh and Oh My ZSH! | ||
| ARG INSTALL_ZSH="false" | ||
|
|
||
| # Location and expected SHA for common setup script - SHA generated on release | ||
| ARG INSTALL_ZSH="true" | ||
| ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-alpine.sh" | ||
| ARG COMMON_SCRIPT_SHA="dev-mode" | ||
|
|
||
| # Configure apt and install packages | ||
| RUN apk update \ | ||
| && apk add --no-cache wget coreutils ca-certificates \ | ||
| && wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE \ | ||
| && if [ "$COMMON_SCRIPT_SHA" != "dev-mode" ]; then echo "$COMMON_SCRIPT_SHA /tmp/common-setup.sh" | sha256sum -c - ; fi \ | ||
| && /bin/ash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \ | ||
| && rm /tmp/common-setup.sh | ||
| && rm /tmp/common-setup.sh | ||
|
|
||
| RUN usermod -a -G wheel ${USERNAME} | ||
| RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
|
|
||
| # Enable HTTPS support in wget and set nsswitch.conf to make resolution work within containers | ||
| RUN apk add --no-cache --update openssl \ | ||
| && echo hosts: dns files > /etc/nsswitch.conf | ||
|
|
||
| USER ${USER_UID}:${USER_GID} | ||
| WORKDIR /home/${USERNAME} | ||
|
|
||
| # Download Nix and install it into the system. | ||
| RUN wget https://nixos.org/releases/nix/nix-2.3/nix-2.3-x86_64-linux.tar.xz \ | ||
| && tar xf nix-2.3-x86_64-linux.tar.xz \ | ||
| && sudo mkdir -m 0755 /etc/nix \ | ||
| && echo -e 'sandbox = false\nkeep-derivations = false' > sudo tee /etc/nix/nix.conf \ | ||
| && sh nix-*-x86_64-linux/install \ | ||
| && sudo rm -r nix-*-x86_64-linux* \ | ||
| && sudo rm -rf /var/cache/apk/* | ||
|
|
||
| ARG NIXUSR=/nix/var/nix/profiles/per-user/${USERNAME} | ||
| ARG NIXPROF=${NIXUSR}/profile | ||
|
|
||
| ONBUILD ENV \ | ||
| USER=${USERNAME} \ | ||
| PATH=${NIXPROF}/bin:${NIXPROF}/sbin:/home/${USERNAME}/.local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin \ | ||
| NIX_PATH=${NIXUSR}/channels | ||
|
|
||
| ENV \ | ||
| USER=${USERNAME} \ | ||
| PATH=${NIXPROF}/bin:${NIXPROF}/sbin:/home/${USERNAME}/.local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin \ | ||
| NIX_PATH=${NIXUSR}/channels | ||
|
|
||
| RUN echo ". ${NIXPROF}/etc/profile.d/nix.sh" >> ~/.profile \ | ||
| && echo ". ${NIXPROF}/etc/profile.d/nix.sh" >> ~/.zshrc \ | ||
| # Make sure the channel is gcrooted, because otherwise it wouldn't be kept with keep-derivations turned off | ||
| && nix-channel --update \ | ||
| && nix-collect-garbage --delete-old \ | ||
| && nix-store --optimise \ | ||
| && nix-store --verify --check-contents | ||
|
|
||
| ENTRYPOINT ["/bin/zsh"] | ||
|
|
||
| COPY --chown=${USERNAME}:${USERNAME} stack-config.yaml /home/${USERNAME}/.stack/config.yaml | ||
| COPY --chown=${USERNAME}:${USERNAME} stack-global-config.yaml /home/${USERNAME}/.stack/global-project/stack.yaml | ||
|
|
||
| RUN nix-env -i stack | ||
| RUN nix-env -i ghc-8.6.5 | ||
|
|
||
| RUN nix-env -iA cachix -f https://cachix.org/api/v1/install \ | ||
| && cachix use all-hies \ | ||
| && nix-env -iA \ | ||
| unstableFallback.selection \ | ||
| --arg selector 'p: { inherit (p) ghc865; }' \ | ||
| -f "https://github.com/infinisil/all-hies/tarball/85fd0be92443ca60bb649f8e7748f785fe870b7a" | ||
|
|
||
| RUN stack install haskell-dap ghci-dap haskell-debug-adapter | ||
|
|
||
| RUN nix-collect-garbage --delete-old \ | ||
| && nix-store --optimise \ | ||
| && nix-store --verify --check-contents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,22 @@ | ||
| { | ||
| "name": "GHC 8.6.5 with HIE", | ||
| "dockerFile": "Dockerfile", | ||
| "runArgs": [], | ||
|
|
||
| // Use 'settings' to set *default* container specific settings.json values on container create. | ||
| // You can edit these settings after create using File > Preferences > Settings > Remote. | ||
| "settings": { | ||
| "terminal.integrated.shell.linux": "/bin/bash" | ||
| }, | ||
|
|
||
| // Use 'appPort' to create a container with published ports. If the port isn't working, be sure | ||
| // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. | ||
| // "appPort": [], | ||
|
|
||
| // Uncomment the next line to run commands after the container is created. | ||
| // "postCreateCommand": "gcc -v", | ||
|
|
||
| // Comment out the next line if you want to run as root instead | ||
| "remoteUser": "vscode", | ||
|
|
||
| // Add the IDs of extensions you want installed when the container is created in the array below. | ||
| "extensions": [ | ||
| "alanz.vscode-hie-server" | ||
| ] | ||
| } | ||
| "name": "GHC+Stack", | ||
| "dockerFile": "Dockerfile", | ||
| // Use 'settings' to set *default* container specific settings.json values on container create. | ||
| // You can edit these settings after create using File > Preferences > Settings > Remote. | ||
| "settings": { | ||
| "terminal.integrated.shell.linux": "/bin/zsh", | ||
| }, | ||
| // Use 'appPort' to create a container with published ports. If the port isn't working, be sure | ||
| // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. | ||
| // "appPort": [], | ||
| // Uncomment the next line to run commands after the container is created. | ||
| // "postCreateCommand": "java -version", | ||
| // Comment out the next line to run as root | ||
| "remoteUser": "vscode", | ||
| // Add the IDs of extensions you want installed when the container is created in the array below. | ||
| "extensions": [ | ||
| "alanz.vscode-hie-server", | ||
| "meowcolm024.has-go", | ||
| "phoityne.phoityne-vscode", | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| nix: | ||
| enable: true | ||
| packages: [glpk, pcre, zlib, glibc] | ||
|
|
||
| # This file contains default non-project-specific settings for 'stack', used | ||
| # in all projects. For more information about stack's configuration, see | ||
| # http://docs.haskellstack.org/en/stable/yaml_configuration/ | ||
|
|
||
| # The following parameters are used by "stack new" to automatically fill fields | ||
| # in the cabal config. We recommend uncommenting them and filling them out if | ||
| # you intend to use 'stack new'. | ||
| # See https://docs.haskellstack.org/en/stable/yaml_configuration/#templates | ||
| templates: | ||
| params: | ||
| author-name: Pavel Shirshov | ||
| author-email: [email protected] | ||
| github-username: pshirshov | ||
| # copyright: | ||
|
|
||
| # The following parameter specifies stack's output styles; STYLES is a | ||
| # colon-delimited sequence of key=value, where 'key' is a style name and | ||
| # 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic | ||
| # Rendition) control codes (in decimal). Use "stack ls stack-colors --basic" | ||
| # to see the current sequence. | ||
| stack-colors: error=31:good=32:shell=35:dir=34:recommendation=32:target=95:module=35:package-component=9 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # This is the implicit global project's config file, which is only used when | ||
| # 'stack' is run outside of a real project. Settings here do _not_ act as | ||
| # defaults for all projects. To change stack's default settings, edit | ||
| # '/root/.stack/config.yaml' instead. | ||
| # | ||
| # For more information about stack's configuration, see | ||
| # http://docs.haskellstack.org/en/stable/yaml_configuration/ | ||
| # | ||
| packages: [] | ||
| resolver: lts-15.0 | ||
| compiler: ghc-8.6.5 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you change these to placeholders? I want to keep this repo as a reference and submit the updated version to the VS code gallery.
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.
done