-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8341641: Make %APPDATA% and %LOCALAPPDATA% env variables available in *.cfg files #23923
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
8341641: Make %APPDATA% and %LOCALAPPDATA% env variables available in *.cfg files #23923
Conversation
👋 Welcome back asemenyuk! A progress list of the required criteria for merging this PR into |
@alexeysemenyukoracle This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 9 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@alexeysemenyukoracle The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
@sashamatveev PTAL |
Webrevs
|
If you do |
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.
Looks good overall with minor comment and question.
for (; it != end; ++it) { | ||
if (it->type() == ESCAPED_CHAR) { | ||
ss << it->value().substr(1); | ||
} |
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.
} else {
in one line for consistency.
src/jdk.jpackage/share/classes/jdk/jpackage/internal/util/TokenReplace.java
Outdated
Show resolved
Hide resolved
|
This is true for any shell behavior. It is also true that some shells fail to expand undefined variables if configured accordingly. Bash, for example:
Output:
.cfg files are not scripts and jpackage app launcher is not an interpreter. Performed string substitution is less variable expansion and more token replacement; if token value is not available, it is not replaced. |
/csr |
@alexeysemenyukoracle has indicated that a compatibility and specification (CSR) request is needed for this pull request. @alexeysemenyukoracle please create a CSR request for issue JDK-8341641 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@alexeysemenyukoracle this pull request can not be integrated into git checkout JDK-8341641-master
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
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.
Latest changes looks good.
I'll update the tests to cover case sensitivity differences on Unix and Windows. |
2697acd
to
3b439c9
Compare
@alexeysemenyukoracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
…nReplace.java Co-authored-by: Andrey Turbanov <[email protected]>
3b439c9
to
01270d3
Compare
@alexeysemenyukoracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
… are case-insesitive on Windows)
01270d3
to
2b22c14
Compare
@alexeysemenyukoracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Updated the implementation and tests to comply with the CSR. @sashamatveev PTAL |
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.
Looks good.
/integrate |
Going to push as commit 45b7c74.
Your commit was automatically rebased without conflicts. |
@alexeysemenyukoracle Pushed as commit 45b7c74. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
||
An expandable substring should be enclosed between the dollar | ||
sign character ($) and the first following non-alphanumeric | ||
character. Alternatively, it can be enclosed between "${" and "}" |
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 did not sit well with pandoc, that reports:
[WARNING] Could not convert TeX math ) and the first following non-alphanumeric character. Alternatively, it can be enclosed between ", rendering as TeX:
e enclosed between "
^
unexpected '"'
expecting "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "\\", "\\hyperref" or end of input
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.
I'm guessing a possible fix would be to use
`${`
or
"`${`"
instead.
Alternatively, we need to tell pandoc to not try and use any encoded TeX math in markdown files.
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.
I filed https://bugs.openjdk.org/browse/JDK-8354320 to fix the warning
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.
Adding backslash character (\
) before the dollar character ("${"
-> "\${"
) suppressed the warning, and the man page looks as expected.
PR #24585
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.
As I said in that PR, yes, it silences the warning, but it is not standard markdown, and will be rendered incorrectly by a standard markdown renderer.
jpackage app laucnher will expand environment variables in .cfg files.
Previously jpackage app launcher only replaced
$APPDIR
,$BINDIR
, and$ROOTDIR
tokens with the corresponding path values. With this patch, any environment variable can be expanded. The syntax is shell-like$ENV_VAR_NAME
or${ENV_VAR_NAME}
. If$ENV_VAR_NAME
syntax is used, the variable name stops at the first character outside of[a-zA-Z0-9_]
character range. If${ENV_VAR_NAME}
syntax is used, the variable name stops at the first}
character after${
substring. E.g:USER-2
is likely to be an invalid env variable name, but jpackage launcher is not validating names.\$
character combination prevents variable expansion:\\
character combination escapes\
:If
\
character is not followed by another\
character or$
character, it is interpreted as a regular character:Expansion is non-recursive:
Values of
APPDIR
,BINDIR
, andROOTDIR
environment variables are ignored, and these names are substituted by values calculated by jpackage app launcher as previously.$APPDIR
is equivalent to${APPDIR}
.$BINDIR
is equivalent to${BINDIR}
.$ROOTDIR
is equivalent to${ROOTDIR}
.You will find two entities dealing with token replacement in this patch:
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23923/head:pull/23923
$ git checkout pull/23923
Update a local copy of the PR:
$ git checkout pull/23923
$ git pull https://git.openjdk.org/jdk.git pull/23923/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23923
View PR using the GUI difftool:
$ git pr show -t 23923
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23923.diff
Using Webrev
Link to Webrev Comment