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

DTL templating fails when path contains percent character #957

Open
artman41 opened this issue Aug 16, 2022 · 1 comment
Open

DTL templating fails when path contains percent character #957

artman41 opened this issue Aug 16, 2022 · 1 comment

Comments

@artman41
Copy link
Contributor

Unsure whether this is an issue that you can fix through some path hacks @essen or whether you want to close this as a known issue

If your DTL template path contains a percentage character (%) then the path substitution doesn't work.

I encountered this because Jenkins was substituting %2F in place of a slash / in my git branch name.

Issue seems to be the path substitution at

DTL_NAMES = $(addprefix $(DTL_PREFIX),$(addsuffix $(DTL_SUFFIX),$(DTL_FILES:$(DTL_PATH)/%.dtl=%)))

Jenkins logs with some debug $(info ...)s thrown into erlang.mk show the following info

DTL_PATH is /jenkins/thughes%2Fmybranch/myapp/templates
DTL_FILES is /jenkins/thughes%2Fmybranch/myapp/templates/status_page.dtl
zxz Make version: 13.82
zxz DTL_FILES w/ extension removed:: /jenkins/thughes%2Fmybranch/myapp/templates/status_page.dtl
zxz DTL_FILES suffixed:: /jenkins/thughes%2Fmybranch/myapp/templates/status_page.dtl_dtl
zxz DTL_FILES prefixed:: /jenkins/thughes%2mybranch/myapp/templates/status_page.dtl_dtl
DTL_NAMES is /jenkins/thughes%2Fmybranch/myapp/templates/status_page.dtl_dtl
DTL_MODULES is status_page.dtl_dtl

This causes the eunits to fail as they attempt to load status_page.dtl_dtl.beam which doesn't exist

 GEN    eunit
======================== EUnit ========================
...
undefined
*** test module not found ***
**'status_page.dtl_dtl'
@essen
Copy link
Member

essen commented Aug 16, 2022

Right, makes sense. The % in the path can probably just be escape with \ via $(subst %,\%,$(DTL_PATH)) at the end of the line instead of $(DTL_PATH). But it's worth having a test to confirm.

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

No branches or pull requests

2 participants