You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "mataha (via GitHub)" <gi...@apache.org> on 2023/09/13 11:31:12 UTC
[GitHub] [ant] mataha opened a new pull request, #205: Fix `--release` param check in bootstrap.bat
mataha opened a new pull request, #205:
URL: https://github.com/apache/ant/pull/205
The following check will always fail silently due to batch `echo` always taking strings literally - including double quotes:
```batchfile
echo "public class JavacVersionCheck {}" >%CLASSDIR%\JavacVersionCheck.java
"%JAVAC%" --release 8 -d %CLASSDIR% %CLASSDIR%\JavacVersionCheck.java >nul 2>&1
```
With the following error message:
```javac
JavacVersionCheck.java:1: error: class, interface, or enum expected
"public class JavacVersionCheck {}"
^
1 error
```
Even with that fixed, the next statement will crash and burn on systems that do not have Command Extensions enabled (e.g. invoked with `cmd /y`):
```batchfile
IF %ERRORLEVEL% EQU 0 SET JAVAC_RELEASE_VERSION="--release 8"
```
With the following error message:
```
equ was unexpected at this time.
```
In order to accommodate that, those checks have been corrected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] mataha commented on pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "mataha (via GitHub)" <gi...@apache.org>.
mataha commented on PR #205:
URL: https://github.com/apache/ant/pull/205#issuecomment-1722502639
The pleasure is mine!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] jaikiran commented on pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "jaikiran (via GitHub)" <gi...@apache.org>.
jaikiran commented on PR #205:
URL: https://github.com/apache/ant/pull/205#issuecomment-1722169214
Hello @mataha, what you propose here looks OK to me. However, I haven't been able to reproduce the issue that prompted this change. Is there some specific Windows version where this can be reproduced or how did you notice this issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] asfgit closed pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #205: Fix `--release` param check in bootstrap.bat
URL: https://github.com/apache/ant/pull/205
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] mataha commented on pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "mataha (via GitHub)" <gi...@apache.org>.
mataha commented on PR #205:
URL: https://github.com/apache/ant/pull/205#issuecomment-1722247407
> Hello @mataha, what you propose here looks OK to me. However, I haven't been able to reproduce the issue that prompted this change. Is there some specific Windows version where this can be reproduced or how did you notice this issue?
Hello,
Try these minimal examples:
```batchfile
cmd /d /y /c "echo "public class JavacVersionCheck {}" >check.java && javac check.java"
```
```batchfile
cmd /d /y /c "if %ERRORLEVEL% equ 0 echo Success."
```
As for how I've noticed the issue: I wanted to analyze the bootstrapping code (having come here from [Bootstrappable Builds](https://bootstrappable.org/best-practices.html)); as I write a lot of Batch scripts as a result of my hobby, the quotes in `echo` struck me as a red flag immediately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] jaikiran commented on pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "jaikiran (via GitHub)" <gi...@apache.org>.
jaikiran commented on PR #205:
URL: https://github.com/apache/ant/pull/205#issuecomment-1722366666
Thank you @mataha for those details. I have now merged this PR and added you (`Mateusz Kazimierczuk`) as a contributor to our contributors list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
[GitHub] [ant] mataha commented on pull request #205: Fix `--release` param check in bootstrap.bat
Posted by "mataha (via GitHub)" <gi...@apache.org>.
mataha commented on PR #205:
URL: https://github.com/apache/ant/pull/205#issuecomment-1722284523
These, of course, can be run on all Windows versions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org