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

[BUG] Cannot parser args correctly in fzn-choco #1082

Open
zy-nesime opened this issue Jan 31, 2024 · 1 comment
Open

[BUG] Cannot parser args correctly in fzn-choco #1082

zy-nesime opened this issue Jan 31, 2024 · 1 comment
Labels

Comments

@zy-nesime
Copy link
Contributor

The bug happend in "fzn-choco" script at master branch, located at "parsers/src/main/minizinc/fzn-choco".

First, i try the command bash fzn-choco -jar choco-parsers-4.10.14-light.jar output.fzn

then it output:

"-jar" is not a valid option
ChocoFZN [options...] file
 file                                   : File to parse.
 -a (--all)                             : Search for all solutions (default:
                                          false). (default: false)
(......)

Second, i modify the script and make it print the finally command it will run.

bash fzn-choco -jar choco-parsers-4.10.14-light.jar output.fzn

java -server -Xss64M -Xms2G -Xmx8G -XX:NewSize=512M -cp .:choco-parsers-4.10.14-light.jar org.chocosolver.parser.flatzinc.ChocoFZN  -limit=[-1,-1sols] -lvl COMPET "-jar"

Obviously, the script parser the "--jar" as file path.

The error caused at line 61. May be we should move FILE="$1" after case switch.

I fork and fix the issue. I read the CONTRIBUTING.md and there no more details about modify a shell script. So, can i make a PR about this issue directly?

@zy-nesime zy-nesime added the bug label Jan 31, 2024
zy-nesime added a commit to zy-nesime/choco-solver that referenced this issue Jan 31, 2024
@cprudhom
Copy link
Member

Thank you for the bug reporting.
Indeed, the last commit on this file change the order of the parameter and was not compliant with the expectations.
I just encountered the same problem this morning, before reading the issue and came to the same patch.

I am not able to test the fzn-choco.exe file but I suppose the same error occurs.

I'll push your correction for the bash version and wait for a windows user to test the other one.

mergify bot added a commit that referenced this issue Jan 31, 2024
Fix bug to correctly parse file path #1082
cprudhom added a commit that referenced this issue Feb 2, 2024
cprudhom added a commit that referenced this issue Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants