Giter Club home page Giter Club logo

haskell-stack-mirror-script's People

Contributors

alexoundos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

haskell-stack-mirror-script's Issues

Selective download to reduce mirror size

Would it suffice in many use cases to download only what's included in a single snapshot and/or only the latest versions of packages? I imagine that would significantly reduce the size of the mirror.

By the same token, including only specific packages (and their dependencies) or excluding specific packages might be useful, though perhaps less so for full offline functionality.

Format of index tarball seems to differ from what the script expects

To get the script to extract the filenames from 01-index.tar.gz, I needed to modify the grep and sed regexes slightly: I'm not sure if this is because of a change in the index tarball format?

@@ -210,8 +210,8 @@ echo "======= producing list of packages urls to download ====================="
 HACKAGE_MIRROR_ESC=$(echo $HACKAGE_MIRROR | sed -e 's/[\/&]/\\&/g')
 
 tar --list -f "$MIRROR_DIR/$(basename $HACKAGE_INDEX)" \
-  | egrep "(.*)/([[:digit:].]+)/$" \
-  | sed "s/\(.*\)\/\(.*\)\/$/$HACKAGE_MIRROR_ESC\/\1-\2.tar.gz/" \
+  | egrep "(.*)/([[:digit:].]+)/" \
+  | sed "s/\(.*\)\/\(.*\)\/.*$/$HACKAGE_MIRROR_ESC\/\1-\2.tar.gz/" \
   | sort -o download-packages-urls
 if [ $? -ne 0 ]; then
     echo "error getting list of packages urls to download"

using mirror requires to manually supply a path to the stack setup yaml for running stack setup

In order to run stack setup you have to supply a path to "mirror/stack-setup-mirror.yaml" manually with --setup-info-yaml option every time.
This is due to inability of stack to use setup-info: field in "~/.stack/config.yaml" in a proper manner. See progress on these 2 issues related to improper treatment of it and possible fix: commercialhaskell/stack#2982 and commercialhaskell/stack#2983.
The idea is that setup-info: field with a combination of urls: and package-indices in config.yaml file should be sufficient to perform any stack command using this offline mirror.

Updates needed to work with Stack versions >= 2.1.1

It looks like Stack changed a bunch of stuff in version 2 that effects this project. So far they all seem to relate to the config.yaml file:

  • package-indices now requires hackage-security (see here). I think a workaround for this could be:
    package-indices:
    - name: Hackage
       download-prefix: $MIRROR_URL/packages/
       http: $MIRROR_URL/01-index.tar.gz
       hackage-security:
         keyids: [""]
         key-threshold: 0        
  • lts-build-plans and nightly-build-plans are no longer supported. As far as I can tell, there's no alternative/workaround for this. It looks like one can workaround this on a per project basic though by specifying a snapshot location in stack.yaml (see here). So adding a note about that to the readme might be helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.