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

Can't use USER_SUPPLIED_CONFIGURE_ARGS with blank space and " #2279

Closed
joeyleeeeeee97 opened this issue Dec 2, 2020 · 4 comments · Fixed by #2284
Closed

Can't use USER_SUPPLIED_CONFIGURE_ARGS with blank space and " #2279

joeyleeeeeee97 opened this issue Dec 2, 2020 · 4 comments · Fixed by #2284
Assignees
Labels
bug Issues that are problems in the code as reported by the community
Milestone

Comments

@joeyleeeeeee97
Copy link
Contributor

What are you trying to do?
I am trying to add configureBuild arguments like

 --with-extra-cflags="-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72"
--with-extra-cxxflags="-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72"

The total BUILD_CONFIGURATION input is

{
    "ARCHITECTURE": "aarch64",
    "TARGET_OS": "linux",
    "VARIANT": "dragonwell",
    "JAVA_TO_BUILD": "jdk11u",
    "TEST_LIST": [
        "sanity.openjdk",
        "sanity.system",
        "extended.system",
        "sanity.perf",
        "sanity.external"
    ],
    "SCM_REF": "dragonwell-11.0.9.4_jdk-11.0.9+0",
    "BUILD_ARGS": "",
    "NODE_LABEL": "build&&linux&&aarch64",
    "ACTIVE_NODE_TIMEOUT": "",
    "CODEBUILD": false,
    "DOCKER_IMAGE": "joeylee97/dragonwell_centos7_gcc9_build_image",
    "DOCKER_FILE": "",
    "DOCKER_NODE": "",
    "CONFIGURE_ARGS": "--enable-dtrace=auto  --with-extra-cflags=\"-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72\"  --with-extra-cxxflags=\"-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72\"",
    "OVERRIDE_FILE_NAME_VERSION": "",
    "RELEASE": false,
    "PUBLISH_NAME": "",
    "ADOPT_BUILD_NUMBER": "",
    "ENABLE_TESTS": true,
    "ENABLE_INSTALLERS": true,
    "CLEAN_WORKSPACE": true
}

http://ci.dragonwell-jdk.io/job/build-scripts/job/jobs/job/jdk11u/job/jdk11u-linux-aarch64-dragonwell/10/parameters/

Expected behaviour:
I added " to make it a legal json, but after this is parsed the " seems got lost.

12:37:41  /root/jenkins/workspace/build-scripts/jobs/jdk11u/jdk11u-linux-aarch64-dragonwell/build-farm/../makejdk-any-platform.sh --clean-git-repo --jdk-boot-dir /usr/lib/jvm/jdk-10 --configure-args  --disable-warnings-as-errors --enable-ccache --enable-dtrace=auto  --with-extra-cflags="-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72"  --with-extra-cxxflags="-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72" --target-file-name OpenJDK11U-jdk_aarch64_linux_dragonwell_2020-12-02-04-37.tar.gz --disable-shallow-git-clone -b dragonwell-11.0.9.4_jdk-11.0.9+0 --skip-freetype --use-jep319-certs --build-variant dragonwell jdk11u
12:37:41  Starting /root/jenkins/workspace/build-scripts/jobs/jdk11u/jdk11u-linux-aarch64-dragonwell/build-farm/../makejdk-any-platform.sh to configure, build (Adopt)OpenJDK binary
12:37:41  Parsing opt: --clean-git-repo
12:37:41  Possible opt arg: --jdk-boot-dir
12:37:41  Parsing opt: --jdk-boot-dir
12:37:41  Possible opt arg: /usr/lib/jvm/jdk-10
12:37:41  Parsing opt: --configure-args
12:37:41  Possible opt arg:  --disable-warnings-as-errors --enable-ccache --enable-dtrace=auto  --with-extra-cflags=-march=armv8.2-a+fp16+rcpc+dotprod+crypto
12:37:41  Parsing opt: -mtune=cortex-a72  --with-extra-cxxflags=-march=armv8.2-a+fp16+rcpc+dotprod+crypto
12:37:41  Possible opt arg: -mtune=cortex-a72

Observed behaviour:
This is pars
Any other comments:

@joeyleeeeeee97
Copy link
Contributor Author

I also tried to add directly into scripts like


if [ "${ARCHITECTURE}" == "aarch64" ]
then
  DRAGONWELL_CFLAGS="-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=cortex-a72"
  export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-cflags=${DRAGONWELL_CFLAGS} --with-extra-cxxflags=${DRAGONWELL_CFLAGS}"
fi

But this is no good either.

@adamfarley
Copy link
Contributor

adamfarley commented Dec 2, 2020

Joey has been informed that there's a hacky workaround for this, as detailed below. However, this problem is still a problem, and should be properly fixed.

Note: Any argument with a space in it is unlikely to work well with make, so we may be setting ourselves up for future problems here.


Inside our scripts, we pass configure args as a parameter to another script on the command line, which may be where your quotation marks are being lost.
If you need a cheap+nasty hack, try adding them to the end of this string:
https://github.com/AdoptOpenJDK/openjdk-build/blob/da329f4019b8ba4a61dcea13fba8229cfa42fd0f/sbin/build.sh#L403

e.g.
FULL_CONFIGURE="bash ./configure --verbose ${CONFIGURE_ARGS} --testargaddedhere=\"potato\""

This adds --testargaddedhere="potato" to the configure script args at execution time, including quotation marks.

@M-Davies M-Davies added the bug Issues that are problems in the code as reported by the community label Dec 2, 2020
@adamfarley adamfarley assigned adamfarley and unassigned adamfarley Dec 2, 2020
@adamfarley
Copy link
Contributor

Ok, here's one form the fix could take.

#2284

Note that make tends to react poorly to spaces inside single arguments. Something you may wish to keep in mind when using configure args with spaces in them.

@M-Davies M-Davies linked a pull request Dec 3, 2020 that will close this issue
@karianna karianna added this to the December 2020 milestone Dec 4, 2020
@adamfarley
Copy link
Contributor

Ok, the PR fixing this was resolved, so the next build job using a fresh copy of the build scripts should be able to accept speech marks in the CONFIGURE_ARGS parameter, so long as you escape them (just the inner ones, not the ones around the entire CONFIGURE_ARGS value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are problems in the code as reported by the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants