@@ -96,18 +96,22 @@ fi
96# Get latest stack
96# Get latest stack
97curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack'
97curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C $EXTRA_BIN_DIR '*/stack'
99−# Do all of the pre-build actions:
99+# Determine the new build plan unless NOPLAN is set
101# * Update the package index
101# * Update the package index
102# * Create a new plan
102# * Create a new plan
103−# * Check that the plan is valid
104−# * Fetch all needed tarballs (the build step does not have write access to the tarball directory)
105−# * Do a single unpack to create the package index cache (again due to directory perms)
106if [ "${NOPLAN:-}x" = "x" ]
103if [ "${NOPLAN:-}x" = "x" ]
108− docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stack update && stackage-curator create-plan --plan-file $PLAN_FILE --target $TARGET ${CONSTRAINTS:-} && stackage-curator check --plan-file $PLAN_FILE && stackage-curator fetch --plan-file $PLAN_FILE && cd /tmp && exec stack unpack random"
105+ docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stack update && exec stackage-curator create-plan --plan-file $PLAN_FILE --target $TARGET ${CONSTRAINTS:-}"
108+# Do the rest of the pre-build actions:
110+# * Check that the plan is valid
111+# * Fetch all needed tarballs (the build step does not have write access to the tarball directory)
112+# * Do a single unpack to create the package index cache (again due to directory perms)
113+docker run $ARGS_PREBUILD $IMAGE /bin/bash -c "stackage-curator check --plan-file $PLAN_FILE && stackage-curator fetch --plan-file $PLAN_FILE && cd /tmp && exec stack unpack random"
111# Now do the actual build. We need to first set the owner of the home directory
115# Now do the actual build. We need to first set the owner of the home directory
112# correctly, so we run the command as root, change owner, and then use sudo to
116# correctly, so we run the command as root, change owner, and then use sudo to
113# switch back to the current user
117# switch back to the current user