You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is due to the dist directory being shared. We could have lock files on the dist directory. However, it would be better if we allowed parallel builds of different configurations. So how do we vary the dist dir location for different configurations? One tricky constraint is that stack path --dist-dir should still work (possibly with a --stack-yaml command). There are two decent ways I can think of doing this:
Hash the configuration, and use a trimmed version of it in the dist path. At first this approach seems promising, in fact possibly even handling CLI invocations that do things like modify the resolver. However, these CLI modifications would also need to be passed into stack path --dist-dir, which would be rather unwieldy.
Add a new stack.yaml option config-name: which specifies a name for the configuration, along with a CLI option --config-name. If config-name is absent, it is inferred from the configuration filename by trimming off .yml or .yaml. This name is then used as a portion of the dist-dir path.
Either way, we'd also want to have lock files on the dist dirs, since we do want to prevent simultaneous execution on the same dist dir.
I'm favoring approach (2), because it would allow for a common case to work well without even knowing about config-name. You can have multiple stack configurations in different files, and safely build them in parallel.
The text was updated successfully, but these errors were encountered:
👍 for locking the build directory. Sometimes I am not careful and start multiple stack builds at the same time. This often results in an unclean state, which needs a reset with stack clean.
I got errors like the following when running
stack build
in parallel withstack build --stack-yaml stack-8.0.yaml
This is due to the dist directory being shared. We could have lock files on the dist directory. However, it would be better if we allowed parallel builds of different configurations. So how do we vary the dist dir location for different configurations? One tricky constraint is that
stack path --dist-dir
should still work (possibly with a--stack-yaml
command). There are two decent ways I can think of doing this:Hash the configuration, and use a trimmed version of it in the dist path. At first this approach seems promising, in fact possibly even handling CLI invocations that do things like modify the resolver. However, these CLI modifications would also need to be passed into
stack path --dist-dir
, which would be rather unwieldy.Add a new stack.yaml option
config-name:
which specifies a name for the configuration, along with a CLI option--config-name
. Ifconfig-name
is absent, it is inferred from the configuration filename by trimming off.yml
or.yaml
. This name is then used as a portion of the dist-dir path.Either way, we'd also want to have lock files on the dist dirs, since we do want to prevent simultaneous execution on the same dist dir.
I'm favoring approach (2), because it would allow for a common case to work well without even knowing about
config-name
. You can have multiple stack configurations in different files, and safely build them in parallel.The text was updated successfully, but these errors were encountered: