Skip to content
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

Profiles include files should be more specific #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iarenaza
Copy link

@iarenaza iarenaza commented Jan 8, 2025

The default profile includes in the base config.edn file conflict with other libraries artifact names, if those artifact names have dev or local as their fist "path component".

The base config.edn declares two profile includes:

:duct.profile/dev #duct/include "dev"
:duct.profile/local #duct/include "local"

This is a problem for artifact names that start with either dev or local.

For example, if you add the following depenency library to your (Leiningen) project:

[dev.gethop/sql-utils "0.4.13"]

When Duct starts reading the configuration it will throw the following exception:

Execution error at integrant.core/read-string (core.cljc:155).
EOF while reading

The root of the problem is the line at
https://github.com/duct-framework/core/blob/28de7df11af9c95ceb157d0c5163c061a75554b3/src/duct/core.clj#L89 in the core library. Because if you run the following code snippet in a REPL from the a project containing the above dependency:

user=> (dev)
:loaded
dev=> (io/resource "dev")
#object[java.net.URL 0x482a879d "jar:file:/home/hop/.m2/repository/dev/gethop/sql-utils/0.4.13/sql-utils-0.4.13.jar!/dev"]
dev=>

you can see that the return value is not the expected one from the Duct point of view (the dev.edn file in the project directory), but the dev directory from the dependency jar file.

The profile includes in the base config of the Duct template should point to the project files explicitly.

[Fixes: #112]

@weavejester
Copy link
Collaborator

Thanks for the fix. Can you change the commit message to:

Make profile includes mode explicit (fixes #112)

Include file extension for dev.edn and local.edn configurations in order
to prevent conflicts with dev and local resource directories.

It's also worth mentioning that a major new version of Duct will be released within the next month or two that will make this template obsolete.

Include file extension for dev.edn and local.edn configurations in order
to prevent conflicts with dev and local resource directories.
@iarenaza
Copy link
Author

iarenaza commented Jan 8, 2025

I just updated the commit message.

Thanks a lot for your time and patience 😄

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

Successfully merging this pull request may close these issues.

Base config.edn dev profile include conflicts with other libraries artifact name
2 participants