-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8294549: configure script should detect unsupported path #10477
Conversation
👋 Welcome back mduigou! A progress list of the required criteria for merging this PR into |
To avoid this situation, create a new branch for your changes and reset the
Then proceed to create a new pull request with |
Webrevs
|
configure
Outdated
@@ -26,8 +26,29 @@ | |||
# make sure that is called using bash. | |||
|
|||
# Get an absolute path to this script, since that determines the top-level directory. | |||
this_script_dir=`dirname $0` | |||
this_script_dir=`cd $this_script_dir > /dev/null && pwd` | |||
source_path="${BASH_SOURCE[0]:-$0}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we (do we want to) rely the shell running this script itself supporting BASH_SOURCE and/or other potential bash-isms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is explicitly a bash script so I believe it is OK to use bash-isms. I usually write pure POSIX scripts because of the issues with MacOS compatibility (they use a very old GPLv2 version of BASH) and compatibility with other shells but didn't feel it was an issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script is just a very thin wrapper of the script in make/autoconf/configure
. That script is explicitly called with bash
so using bash-isms there (and in the rest of the configure script and build system) is fine. In this wrapper however, I think it's better to stick with compatible shell as much as possible. The shebang in this file isn't really relevant as we can't make files executable. I suspect plenty of users are still running this as sh configure
out of habit.
I would recommend moving the space check to make/autoconf/configure
instead.
I agree that However, this is done in the wrong place. At the very least it should move to But I think we can do even better. Normally, all checks that requirements are fulfilled are done by the actual autoconf script. We already do some checking on the top-level dir in Or is it the case that we cannot even start to execute the real autoconf script if there are spaces in the path? If so, I think we should fix those issues by proper quoting. We can't do that over the entire code base, but I think we can afford to do that in the bootstrapping part, so we can actually get to the real configure script. |
Oh, and hi Mike! :) Long time no see... (Didn't at first understand this was you) |
My apologies for delay in responding. I had opted to make these changes to this file because I could isolate the changes to a single file. In order to implement the same logic in the "real" configure file at least some changes would be needed to this file in order to correctly pass a path containing spaces. I will look at moving the path check to the real configure file. |
The OpenJDK build system does not support building when the source code resides on a path that contains a space. This requirement is documented in the build instructions but not enforced by the configure script. This change adds an explicit checks to the wrapper `configure` script that fail the build if the source code to be built is located in a directory who's path contains a space character or the build path cannot be determined.
@bondolo Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
I have removed the path checking from the top level configure script but changes are still required in the |
this_script_dir="$(cd -- "${source_path}" > /dev/null && pwd)" | ||
|
||
if [ -z "${this_script_dir}" ]; then | ||
echo "# Could not determine location of configure script" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the initial #
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just habit. Some style guides for shell commands suggest putting a "#" before error output.
Does this patch work for you? I'm getting errors before even launching the autoconf script:
(Also, in the future, please don't rebase once you've opened a PR, it makes it difficult to go back and check older versions of the patch) |
I think you need to restore you original space-checking part, but put it in With the patch as currently in the PR, and this addition, this works fine for me:
|
@bondolo Do you want me to take over this bug, add you as a contributor, and get it committed? Otherwise I think if you incorporate my patch above, you're good to go. |
I had gotten stuck at how to regenerate the configure script but based on your suggested edit it appears the configure script is not a generated configure. I will take a look a tomorrow and either accept your suggestion or propose an alternative. |
My apologies for the delays. |
@bondolo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@magicus I am fine with your solution, please proceed. Thank you for helping get this change over the line and I apologize for the slow followup. |
@bondolo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Stayin' alive, bot! |
@bondolo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@bondolo This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
The OpenJDK build system does not support building when the source code resides on a path that contains a space. This requirement is documented in the build instructions but not enforced by the configure script.
This change adds an explicit checks to the wrapper
configure
script that fail the build if the source code to be built is located in a directory who's path contains a space character or the build path cannot be determined.Includes some idiom modernization and shell scripting best practices changes.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10477/head:pull/10477
$ git checkout pull/10477
Update a local copy of the PR:
$ git checkout pull/10477
$ git pull https://git.openjdk.org/jdk pull/10477/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10477
View PR using the GUI difftool:
$ git pr show -t 10477
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10477.diff