In a clean git working directory or in a "git archive" tarball, you can run "perl Makefile.PL", but if you run "make", you'll get the following error and make will crash: make: *** No rule to make target 'api/v1/swagger/swagger_bundle.json', needed by 'pm_to_blib' Bug 36546 added a file mapping for 'api/v1/swagger/swagger_bundle.json' which is used in the "pm_to_blib" target. At that time, "build-resources.PL" was run *before* "pm_to_blib" via "compile_css_js". But in Bug 37911, I moved "compile_css_js" to happen *after* "pm_to_blib", so that the Vue files could be copied into the "blib". We didn't notice this bug because on all the test builds we were doing, we forgot to "rm 'api/v1/swagger/swagger_bundle.json'" prior to the builds, so the builds were using a previously generated swagger_bundle.json file. Anyway, I think I know the solution. Let me see if I can bang it out really quickly. Otherwise, I'll do it tomorrow...
Created attachment 182014 [details] [review] Bug 39849: Fix makefile target dependency order This patch fixes the makefile target dependency order, so that it runs in this order: 1. Build CSS and JS assets 2. Run pm_to_blib, which is the step that copies over most of Koha's files into blib 3. Move 'vue/dist' files via "move_compiled_js" makefile target/step To test: 1a. Run 'git archive --format=tar HEAD > "koha.orig.tar"' 1b. sudo mkdir /opt/koha /opt/build_koha 1c. sudo chown kohadev-koha /opt/koha /opt/build_koha 1d. mv koha.orig.tar /opt/build_koha/. 1e. cd /opt/build_koha 1f. tar xvf koha.orig.tar 2. Run "perl Makefile.PL" Choose "single" Choose "/opt/koha" for target directory Choose the defaults for the rest 3. Run "make" 4. Note the first step is the CSS/JS build 5. Note the second step is the copying of files to "blib" 6. Run "find -name 'esm.js.map'" and note it appears in the regular build location as well as in "blib" 7. Run "find -name 'swagger_bundle.json'" and note it appears in the regular build location as well as in "blib" 8. Run "make install" 9. Run the above "find" commands using "/opt/koha" and note that the files appear in the installed directory
Created attachment 182024 [details] [review] Bug 39849: Fix makefile target dependency order This patch fixes the makefile target dependency order, so that it runs in this order: 1. Build CSS and JS assets 2. Run pm_to_blib, which is the step that copies over most of Koha's files into blib 3. Move 'vue/dist' files via "move_compiled_js" makefile target/step To test: 1a. Run 'git archive --format=tar HEAD > "koha.orig.tar"' 1b. sudo mkdir /opt/koha /opt/build_koha 1c. sudo chown kohadev-koha /opt/koha /opt/build_koha 1d. mv koha.orig.tar /opt/build_koha/. 1e. cd /opt/build_koha 1f. tar xvf koha.orig.tar 2. Run "perl Makefile.PL" Choose "single" Choose "/opt/koha" for target directory Choose the defaults for the rest 3. Run "make" 4. Note the first step is the CSS/JS build 5. Note the second step is the copying of files to "blib" 6. Run "find -name 'esm.js.map'" and note it appears in the regular build location as well as in "blib" 7. Run "find -name 'swagger_bundle.json'" and note it appears in the regular build location as well as in "blib" 8. Run "make install" 9. Run the above "find" commands using "/opt/koha" and note that the files appear in the installed directory Signed-off-by: Blou <philippe.blouin@inlibro.com>
Signed off. Solved my issues in my dev (git, raw, non-docker devbox environment). Big thanks.
(In reply to Blou from comment #3) > Signed off. > Solved my issues in my dev (git, raw, non-docker devbox environment). > Big thanks. Really happy to hear this, Philippe. Thanks for reporting the initial issue. I'll be smarter with my test plans in the future to avoid this kind of scenario again!
Just noticed a problem in my test plan. I wrote "esm.js.map" but it should be "erm.js.map". Little typo there!
Created attachment 182071 [details] [review] Bug 39849: Fix makefile target dependency order This patch fixes the makefile target dependency order, so that it runs in this order: 1. Build CSS and JS assets 2. Run pm_to_blib, which is the step that copies over most of Koha's files into blib 3. Move 'vue/dist' files via "move_compiled_js" makefile target/step To test: 1a. Run 'git archive --format=tar HEAD > "koha.orig.tar"' 1b. sudo mkdir /opt/koha /opt/build_koha 1c. sudo chown kohadev-koha /opt/koha /opt/build_koha 1d. mv koha.orig.tar /opt/build_koha/. 1e. cd /opt/build_koha 1f. tar xvf koha.orig.tar 2. Run "perl Makefile.PL" Choose "single" Choose "/opt/koha" for target directory Choose the defaults for the rest 3. Run "make" 4. Note the first step is the CSS/JS build 5. Note the second step is the copying of files to "blib" 6. Run "find -name 'esm.js.map'" and note it appears in the regular build location as well as in "blib" 7. Run "find -name 'swagger_bundle.json'" and note it appears in the regular build location as well as in "blib" 8. Run "make install" 9. Run the above "find" commands using "/opt/koha" and note that the files appear in the installed directory Signed-off-by: Blou <philippe.blouin@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Pushed for 25.05! Well done everyone, thank you!