-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing set-env! semantics for different keys #21
Comments
Hi! Thanks for opening this ticket! I agree that The For example: (let [deps (get-env :dependencies)]
(set-env! :dependencies (conj deps '[foo/bar "1.2.3"]))) is equivalent to (set-env! :dependencies #(conj % '[foo/bar "1.2.3"])) I've been working on the boot-clj/boot tempdirs branch which addresses the classpath problems discussed above. (There are other complications from this classpath issue in other parts of boot also, so it's something we want to get right.) In this branch the source and resource paths are not on the classpath. Instead the contents of these directories are copied into boot's classpath as necessary by a background thread. This means that you can add or remove paths from the set of paths this background thread is syncing with the boot classpath, effectively adding or removing directories from the boot classpath at will. This, combined with some other refactoring greatly simplifies the The idea behind I'll be working on full documentation for the tempdirs stuff over the next few days, in the wiki. I hope to get the docs complete before pushing any breaking changes to master. Your feedback is greatly appreciated! |
I see, thank you. |
This is probably related to #16 in a more general sense.
In the following script I tried to establish additional src/resource paths and dependencies for the dev environment (calling
set-env!
in adev
task).:which produces
Am I using the
set-env!
function correctly for the result I want to get (dev environment/profile)?In any case the semantics of
set-env!
are confusing.Currently
set-env!
works by delegating tomerge-env!
, which merges sources, overwrites resources (seems like a bug as there is adefmethod
for:src
, but not for:rsc
) and overwrites dependencies (although it seems to be callingadd-dependency!
with anold
dependency set).I'd think that
set-env!
should always overwrite, not merge, whileupdate-env!
should accept a function analogous toclojure.core/update
. There could be a simplified version ofupdate-env!
-append-env!
(orconj-env!
) which would always try to merge the values if it made sense and fail otherwise. Could you please explain the reasoning behind the current semantics ofset-env!
andmerge-env!
?I think Boot is a great project and a step forward for the Clojure ecosystem. I'd love to contribute, so understanding the design decisions a bit better would help a great deal!
The text was updated successfully, but these errors were encountered: