cenotelie / hime

Apache License 2.0
27 stars 4 forks source link

Building errors #65

Closed aleksmelnikov closed 4 years ago

aleksmelnikov commented 4 years ago

Environment:

$ cd /tmp
$ git clone https://github.com/cenotelie/hime.git
$ git clone https://github.com/cenotelie/hime-grams.git
$ cd hime/

[1] $ sh .releng/build.sh

[INFO] ------------------------------------------------------------------------
-- Building Hime Redist for Rust --
    Updating crates.io index
   Compiling hime_redist v3.4.2 (/tmp/hime/runtime-rust)
warning: unnecessary parentheses around block return value
  --> runtime-rust/src/ast.rs:81:9
   |
81 |         (self.data & 0x3FFF_FFFF)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:22:5
   |
22 |     (u16::from(buffer[index + 1]) << 8 | u16::from(buffer[index]))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/ast.rs:81:9
   |
81 |         (self.data & 0x3FFF_FFFF)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:27:5
   |
27 | /     (u32::from(buffer[index + 3]) << 24
28 | |         | u32::from(buffer[index + 2]) << 16
29 | |         | u32::from(buffer[index + 1]) << 8
30 | |         | u32::from(buffer[index]))
   | |___________________________________^
   |
help: remove these parentheses
   |
27 |     u32::from(buffer[index + 3]) << 24
28 |         | u32::from(buffer[index + 2]) << 16
29 |         | u32::from(buffer[index + 1]) << 8
30 |         | u32::from(buffer[index])
   |

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:22:5
   |
22 |     (u16::from(buffer[index + 1]) << 8 | u16::from(buffer[index]))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:27:5
   |
27 | /     (u32::from(buffer[index + 3]) << 24
28 | |         | u32::from(buffer[index + 2]) << 16
29 | |         | u32::from(buffer[index + 1]) << 8
30 | |         | u32::from(buffer[index]))
   | |___________________________________^
   |
help: remove these parentheses
   |
27 |     u32::from(buffer[index + 3]) << 24
28 |         | u32::from(buffer[index + 2]) << 16
29 |         | u32::from(buffer[index + 1]) << 8
30 |         | u32::from(buffer[index])
   |

    Finished test [unoptimized + debuginfo] target(s) in 3.08s
     Running target/debug/deps/hime_redist-3f0928c9fec829ef

running 4 tests
test text::test_read_utf8 ... ok
test text::test_text_lines ... ok
test text::test_text_substring ... ok
test utils::biglist::test_big_list ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests hime_redist

running 2 tests
test src/lib.rs -  (line 35) ... ok
test src/utils/iterable.rs - utils::iterable::Iterable (line 29) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

-- Building Test Executor for Rust --
error: current package believes it's in a workspace when it's not:
current:   /tmp/hime/tests-executor-rust/Cargo.toml
workspace: /tmp/hime/Cargo.toml

this may be fixable by adding `tests-executor-rust` to the `workspace.members` array of the manifest located at: /tmp/hime/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
error: current package believes it's in a workspace when it's not:
current:   /tmp/hime/tests-executor-rust/Cargo.toml
workspace: /tmp/hime/Cargo.toml

this may be fixable by adding `tests-executor-rust` to the `workspace.members` array of the manifest located at: /tmp/hime/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
error: current package believes it's in a workspace when it's not:
current:   /tmp/hime/tests-executor-rust/Cargo.toml
workspace: /tmp/hime/Cargo.toml

this may be fixable by adding `tests-executor-rust` to the `workspace.members` array of the manifest located at: /tmp/hime/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
cp: cannot stat '/tmp/hime/tests-executor-rust/target/release/tests_executor_rust': No such file or directory
[INFO] Hime.SDK 3.4.2.0

[2] sh .releng/release.sh

Generating /tmp/hime/runtime-java/target/apidocs/help-doc.html...
[INFO] Building jar: /tmp/hime/runtime-java/target/hime-redist-3.4.2-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ hime-redist ---
gpg: skipped "contact@cenotelie.fr": No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.333 s
[INFO] Finished at: 2020-04-20T13:04:22+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project hime-redist: Exit code: 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
-- Building Hime Redist for Rust --
    Updating crates.io index
   Compiling hime_redist v3.4.2 (/tmp/hime/runtime-rust)
warning: unnecessary parentheses around block return value
  --> runtime-rust/src/ast.rs:81:9
   |
81 |         (self.data & 0x3FFF_FFFF)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:22:5
   |
22 |     (u16::from(buffer[index + 1]) << 8 | u16::from(buffer[index]))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around block return value
  --> runtime-rust/src/utils/bin.rs:27:5
   |
27 | /     (u32::from(buffer[index + 3]) << 24
28 | |         | u32::from(buffer[index + 2]) << 16
29 | |         | u32::from(buffer[index + 1]) << 8
30 | |         | u32::from(buffer[index]))
   | |___________________________________^
   |
help: remove these parentheses
   |
27 |     u32::from(buffer[index + 3]) << 24
28 |         | u32::from(buffer[index + 2]) << 16
29 |         | u32::from(buffer[index + 1]) << 8
30 |         | u32::from(buffer[index])
   |

    Finished release [optimized] target(s) in 4.56s
   Packaging hime_redist v3.4.2 (/tmp/hime/runtime-rust)
-- Building Package --
cp: cannot stat '/tmp/hime/runtime-rust/target/package/*.crate': No such file or directory
.releng/release.sh: 121: .releng/release.sh: zip: not found
woutersl commented 4 years ago

It looks like the latest change broke the build by introducing a workspace for Rust projects. This should be fix now with 488dfb0.

As to the errors with the release script, it requires the PGP signing key as it is used to produce the release artifacts. It is not surprising that it fails without it.

aleksmelnikov commented 4 years ago

@woutersl , with new version from github and with hime_redist = "3.4.1" :

[1] OK

$ sh .releng/build.sh
[INFO] 2289 tests executed, 0 failed, 0 errors

[2] Error

$ sh .releng/release.sh
-- Building Hime Redist for Rust --
    Updating crates.io index
   Compiling hime_redist v3.4.2 (/tmp/hime/runtime-rust)
    Finished release [optimized] target(s) in 4.46s
   Packaging hime_redist v3.4.2 (/tmp/hime/runtime-rust)
-- Building Package --
cp: cannot stat '/tmp/hime/runtime-rust/target/package/*.crate': No such file or directory
.releng/release.sh: 121: .releng/release.sh: zip: not found
find /tmp -name hime_redist-3.4.2.crate
/tmp/hime/target/package/hime_redist-3.4.2.crate
$cat ./.releng/release.sh | grep crate
cp $ROOT/runtime-rust/target/package/*.crate                                    "$RELENG/hime-$VERSION/rust/"

I think this line should be: cp $ROOT/target/package/*.crate "$RELENG/hime-$VERSION/rust/"

aleksmelnikov commented 4 years ago

Because rust workspace has one shared /target for all workspace crates:

/target
   /debug
   /release
/crate1
/crate2
Cargo.toml
woutersl commented 4 years ago

Yes it is the problem introduced by the usage of the Rust workspace. This should be fixed with 9f71e2a.

aleksmelnikov commented 4 years ago

Ok, it works now. Thank you! So, I close the issue.