Closed aleksmelnikov closed 4 years ago
If I try to run without shell script I get:
$mono /tmp/hime/himecc/bin/Release/net461/himecc.exe /tmp/hime-grams/ebnf/EBNF.gram -t:rust -o:assembly
[INFO] Hime.SDK 3.4.2.0
[INFO] Reading input /tmp/hime-grams/ebnf/EBNF.gram ...
[INFO] Loading grammar EBNF ...
[INFO] Preparing grammar EBNF ...
[INFO] Preparing EBNF lexer's data ...
[INFO] Preparing EBNF parser's data ...
[INFO] Exporting lexer data at EBNFLexer.bin ...
[INFO] Exporting lexer code at EBNF.rs ...
[INFO] Exporting parser data at EBNFParser.bin ...
[INFO] Exporting parser code at EBNF.rs ...
[INFO] Building assembly EBNF.crate ...
[INFO] Assembling into /tmp/8avfc7nt.q5b
[INFO] Executing command cargo build --release --manifest-path /tmp/8avfc7nt.q5b/Cargo.toml
Updating crates.io index
error: failed to select a version for the requirement `hime_redist = "^3.4.2"`
candidate versions found which didn't match: 3.4.1, 3.4.0, 3.3.2, ...
location searched: crates.io index
required by package `hime_generated v3.4.2 (/tmp/8avfc7nt.q5b)`
[ERROR] System.IO.FileNotFoundException: Could not find file '/tmp/8avfc7nt.q5b/target/release/libhime_generated.so'.
File name: '/tmp/8avfc7nt.q5b/target/release/libhime_generated.so'
at System.IO.File.Move (System.String sourceFileName, System.String destFileName) [0x0007c] in <a1ae6166591d4020b810288d19af38d4>:0
at Hime.SDK.Output.EmitterForRust.EmitAssembly () [0x000ae] in <4aeeeb2d5b964f91970f8460654916f4>:0
at Hime.SDK.Output.EmitterBase.Emit () [0x000b9] in <4aeeeb2d5b964f91970f8460654916f4>:0
at Hime.SDK.CompilationTask.ExecuteDoEmitSingleUnit (Hime.SDK.Output.Unit unit) [0x00054] in <4aeeeb2d5b964f91970f8460654916f4>:0
at Hime.SDK.CompilationTask.ExecuteDoEmit (System.Collections.Generic.List`1[T] units) [0x00011] in <4aeeeb2d5b964f91970f8460654916f4>:0
at Hime.SDK.CompilationTask.ExecuteDo () [0x00054] in <4aeeeb2d5b964f91970f8460654916f4>:0
at Hime.SDK.CompilationTask.Execute () [0x00000] in <4aeeeb2d5b964f91970f8460654916f4>:0
Crates.io doesn't have hime_redist = "^3.4.2"
.
There are multiple issues here.
First, the /tmp/hime/.releng/standalone/himecc
bash script is designed to work only in the downloadable distribution. It is not designed to be used in the context of the repository. What you can do is what you did, i.e. directly invoke the built binary : /tmp/hime/himecc/bin/Release/net461/himecc.exe
in your case.
Second, the last release of hime is 3.4.1, see https://github.com/cenotelie/hime/releases.
3.4.2 is a next version, it is not yet published. In the code base this is the version that appear. The easiest way to fix the version problem is to download and use himecc v3.4.1, the generated Rust code will depend on hime_redist 3.4.1 Rust package.
If you want to use the repository version, there is a little trick that can be used to point to the local sources of the hime rust runtime:
mono /tmp/hime/himecc/bin/Release/net461/himecc.exe /tmp/hime-grams/ebnf/EBNF.gram -t:rust /tmp/hime/runtime-rust -o:assembly
The -t:rust
option can actually take an optional argument that is the directory that contains the sources of the local runtime to use. This is most notably used in tests to point to the newest runtime. This relies on the patching mechanism of cargo
for the resolution of dependencies.
So I did:
mono /tmp/hime/himecc/bin/Release/net461/himecc.exe /tmp/hime-grams/ebnf/EBNF.gram -t:rust /tmp/hime/runtime-rust -o:assembly
cat /tmp/hime-grams/ebnf/sample.txt | ./target/release/parseit ./EBNF.so ebnf > sample.json.txt
and I've got sample.json.txt
(please see the attachment)all right? sample.json.txt
Yes, this looks fine.
@woutersl , it's good. So, I can close the issue.
Environment: