Skip to content

Fix ODK_RESOURCES_DIR default and plugin download dir - #50

Closed
matentzn wants to merge 1 commit into
mainfrom
fix-resources-dir-default
Closed

matentzn wants to merge 1 commit into
mainfrom
fix-resources-dir-default

Conversation

@matentzn

Copy link
Copy Markdown
Contributor

closes #49

@matentzn
matentzn requested a review from gouttegd October 26, 2026 13:38
{% endif -%}
PATCHESDIR = $(TMPDIR)/patches
ODK_RESOURCES_DIR ?= /tools/resources
ODK_RESOURCES_DIR ?= /odk/resources

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it makes you happy, but that doesn’t serve any purpose.

ODK-Core is deliberately disconnected from the layout of the ODK Docker images. It should always get the location of the resources from the ODK_RESOURCES_DIR variable without ever having to use the fallback value.

The variable is always set either by the Docker image (OK, until INCATools/ontology-development-kit#1391 this was not the case if you were running under root, but you should not run under root anyway – I only keep that working only for backwards compatibility, but running under root is officially a Very Bad Idea™) or by the ODK Runner if you are using a native environment. The only way for that variable to be unset (and therefore the only case you might need the fallback here) is if you somehow explicitly unset if when you start the container – and if you do that you completely deserve whatever will happen…

$(ROBOT_PLUGINS_DIRECTORY)/{{ plugin.name }}.jar:
{# -#}
{% if plugin.mirror_from -%}
@mkdir -p $(ROBOT_PLUGINS_DIRECTORY)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t hurt, but shouldn’t be needed either.

You say in #49 that this fails “if no bundled plugin was copied first”, but there should always be bundled plugins to be copied first, since the ODK comes with no less than 3 bundled plugins (the ODK plugin, the KGCL plugin, and the SSSOM plugin).

TEMPLATE_SUFFIX = ".jinja2"
DEFAULT_TEMPLATE_DIR = Path(__file__).parent.resolve() / "templates"
RESOURCES_DIR = Path(os.environ.get("ODK_RESOURCES_DIR", "/tools/resources"))
RESOURCES_DIR = Path(os.environ.get("ODK_RESOURCES_DIR", "/odk/resources"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. If it makes you happy, but this is pointless.

@matentzn

Copy link
Copy Markdown
Contributor Author

No point in merging pointless changes :P Thanks for the review!

@matentzn matentzn closed this Oct 27, 2026
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.

Fix ODK_RESOURCES_DIR default and plugin download dir in Makefile.jinja2

2 participants