boot-clj / boot-clj/boot

Dynamic var to customize env at task creation time

Open
#468 8 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Clojure
Stars
1.7k
Forks
178
PR merge metrics
No merged PRs in 30d

Description

It would be nice to shadow the global env to better separate multiple apps running in the same boot pipeline. This shadowing is only needed at task creation time, not run time.

As discussed in Slack a dynamic var `*env*` (in `boot.pod` or `boot.core`) might be the solution.

``` clojure
;; binding *env* when creating the pipeline
(binding [*env* (get-env)]
(my-task))
```

``` clojure
(deftask my-task []
(fn [next-task]
;; bind env outside fileset-receiving fn
(let [env *env*]
(fn [fileset]
(pod/make-pod env ,,,))))
```

/cc @micha @arichiardi

Contributor guide

Open the contributing guide

Research direction

Start by reading the environment and task-creation code in boot.pod or boot.core, then trace get-env and pod/make-pod in the example. Done means a dynamically bound *env* can separate pipelines during task creation without changing the environment at run time; the issue does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.