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

Space in ${MPR_FILENAME} will break mxbuild for the build.py script #204

Closed
eist76 opened this issue Sep 9, 2024 · 7 comments
Closed

Space in ${MPR_FILENAME} will break mxbuild for the build.py script #204

eist76 opened this issue Sep 9, 2024 · 7 comments

Comments

@eist76
Copy link

eist76 commented Sep 9, 2024

Hi,

i was testing and troubleshooting build failures with latest Docker Buildpack version v5.1.0 where a build.py script needs to be executed before actually building the final docker images:
./build.py --source <path-to-source> --destination <destination-dir> build-mda-dir

for me this was failing with this error message:
`docker start --attach --interactive da3588d8aa3ee1c126330f09601887b979acc4f65343fed92506514d34bf0f7a
Detected Java 11


| / | | _ \ () | | |
| \ / |
| |) |_ _ | | __| |
| |/| \ / / _ <| | | | | |/ ` |
| | | |> <| |
) | |
| | | | (| |
|
| |//__/ _,|||_,_|

v9.6.10.40529

ERROR: Build options are not specified.
Usage: mxbuild [OPTIONS]+ FILENAME
Build Mendix Deployment Packages (.mda files) using the command-line.
The specified FILENAME is assumed to be a Mendix App Package (.mpr) file
that is located inside a app directory.

Options:
-h, --help show this message and exit.
--serve indicates if MxBuild should be executing in
service mode.
--host=ADDRESS the listening ADDRESS (ip/hostname) used while
serving. Default ADDRESS is localhost.
--port=PORT the TCP PORT number used while serving. Default
PORT number is 6543.
--java-home=DIRECTORY the Java home DIRECTORY that is used for running
Ant.
--java-exe-path=FILENAME
the Java executable FILENAME that is used for
running Ant.
--target=VALUE the target of this build: 'package' or 'deploy'.
the default is 'package'.
--check-java-dependencies
internal option to check Java dependencies with
the 'jdeps' tool as part of the 'package' build.
-o, --output=FILENAME the FILENAME of the MDA file to create (only for
target 'package').
the default is 'out.mda' in the current
directory.
--model-version=VERSION
the model VERSION that is embedded in the
deployment package.
--model-description=DESCRIPTION
the model DESCRIPTION that is embedded in the
deployment package.
--project-name=NAME the project NAME that is registered in the
Mendix Runtime.
--loose-version-check use less strict version check, i.e., allow
conversion from earlier versions.
--write-errors=FILENAME
write all errors, warnings and deprecations in
the project to FILENAME, in JSON format.
the file is only written if the project has
errors.
--java-debug-info generate all debugging information when
compiling Java code (local variables, source
files and line numbers). By default, only source
files and line numbers are included.`

after some debugging i figured out that my MPR_FILENAME has multiple spaces in it like 'Partner Asset Management.mpr' which broke the build script or better the mxbuild/build script.
it was trying to execute:
mono /opt/mendix/modeler/mxbuild.exe --target=package --java-home=/etc/alternatives/java_sdk_11 --java-exe-path=/etc/alternatives/java_sdk_11/bin/java --model-version=unversioned --output=/workdir/output.mda /workdir/project/Partner Asset Management.mpr
and failed because it couldn't find the file apparently.

changing line 36 in mxbuild/build from:
--output=/workdir/output.mda /workdir/project/${MPR_FILENAME}
to
--output=/workdir/output.mda /workdir/project/"${MPR_FILENAME}"
resolved the issue for me.

not sure if i had done anything wrong with executing the build.py script to indicate whitespaces in my MPR filename.
i did execute
./build.py --source trunk --destination build_out build-mda-dir
and in the trunk directory it MPR file was listed like this:
➜ ll trunk total 194M -rw-r--r-- 1 xxx xxx 71M Sep 6 11:44 'Partner Asset Management.mpr' drwxr-xr-x 14 xxx xxx 4.0K Sep 6 11:43 javascriptsource drwxr-xr-x 23 xxx xxx 4.0K Sep 6 11:44 javasource drwxr-xr-x 6 xxx xxx 4.0K Sep 6 11:44 resources drwxr-xr-x 4 xxx xxx 4.0K Sep 6 11:44 theme drwxr-xr-x 3 xxx xxx 4.0K Sep 6 11:44 theme-cache drwxr-xr-x 18 xxx xxx 4.0K Sep 6 11:44 themesource drwxr-xr-x 2 xxx xxx 36K Sep 6 11:44 userlib drwxr-xr-x 2 xxx xxx 4.0K Sep 6 11:44 widgets

can you please review and update the following:
changing line 36 in mxbuild/build from:
--output=/workdir/output.mda /workdir/project/${MPR_FILENAME}
to
--output=/workdir/output.mda /workdir/project/"${MPR_FILENAME}"

@zlogic
Copy link
Member

zlogic commented Sep 10, 2024

Hi @eist76, thank you for the detailed feedback! Our team will include a fix in the next patch version of the Buildpack.

@eist76
Copy link
Author

eist76 commented Nov 14, 2024

@zlogic: any idea when the next release will be published including this fix?

@zlogic
Copy link
Member

zlogic commented Nov 15, 2024

@eist76 We're planning to make a new release by early December. There won't be any significant code changes, just updated documentation.
Would it help if we created a tag with the bugfix (as a pre-release) until then?

@eist76
Copy link
Author

eist76 commented Nov 15, 2024

@eist76 We're planning to make a new release by early December. There won't be any significant code changes, just updated documentation. Would it help if we created a tag with the bugfix (as a pre-release) until then?

not super urgent, just wanted to get a feeling for when to plan with it ... since this issue was preventing me from using the latest release ...
i can wait until early december, no worries

@zlogic
Copy link
Member

zlogic commented Nov 28, 2024

@eist76, We've released the new version of the Buildpack today (v6.0.0), can you please check if it works for you?

@eist76
Copy link
Author

eist76 commented Dec 1, 2024

@zlogic i will test next week and get back to you.
thanks for including this fix to the current released version.

@eist76
Copy link
Author

eist76 commented Dec 2, 2024

@zlogic i just tested this and it was successfully building the image with buildpack (v6.0.0) sucessfully with build.py script being able to handle whitespaces in the MPR_FILENAME.
so this is resolved and can be closed now.
thanks again.

@eist76 eist76 closed this as completed Dec 2, 2024
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