Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Default value for :artifact in deploy task does not respect *project-root* #18

Closed
steffan-westcott opened this issue Mar 5, 2022 · 4 comments
Assignees

Comments

@steffan-westcott
Copy link

I have a multi-module project using build-clj (see build.clj file) which sets *project-root* before evaluating various build tasks in build-clj. The tasks clean, jar and install all work correctly, in particular they respect the current setting for *project-root*. This isn't surprising as this is a feature of clojure.tools.build.api.

However, I encountered an issue with the deploy task, in particular the setting for the :artifact option. build-clj currently defaults :artifact to the relative path from *project-root* of the JAR file to deploy, rather than the expected value which is the relative path from the current directory.

To be clear, I believe the setting of :artifact on this line isn't quite correct. The value of jar-file is correctly set, but is not necessarily the same as the expected value for :artifact. I believe this situation has arisen due to a mismatch in expected arguments between clojure.tools.build.api and deps-deploy, as the latter has no concept of *project-root*.

In my case, I worked around this issue by explicitly providing a value for :artifact, as can be seen here : https://github.com/steffan-westcott/clj-otel/blob/c2862459652d04b8a311bc742169b9b1b5167468/build.clj#L144

@seancorfield seancorfield self-assigned this Mar 5, 2022
@seancorfield
Copy link
Owner

Probably the correct thing for me to do is call https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-resolve-path on jar-file for that line.

@seancorfield
Copy link
Owner

You can try that out via :git/sha "4d45fdd6c16a560a9d7112cfa4c7d4287dba2131" (and no :git/tag) and let me know if that works for you?

steffan-westcott added a commit to steffan-westcott/clj-otel that referenced this issue Mar 6, 2022
This is an experiment to test a bug fix in `build-clj`, reported here :
seancorfield/build-clj#18
@steffan-westcott
Copy link
Author

@seancorfield Thank you for looking at this issue 🙂

I have tried your fix as suggested and can confirm it is working as expected. Thanks for the prompt turnaround!

@seancorfield
Copy link
Owner

Thanks for testing it. I'll try to cut an official release today or tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants