Skip to content

Compilation build failed #5816

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

Closed
Neoblock8 opened this issue May 7, 2024 · 23 comments
Closed

Compilation build failed #5816

Neoblock8 opened this issue May 7, 2024 · 23 comments

Comments

@Neoblock8
Copy link

Neoblock8 commented May 7, 2024

Hi,
Trying to compile with some modifications getting this error.

../common/zksnark/JLibrustzcash.java:24: error: cannot find symbol
private static Librustzcash INSTANCE = LibrustzcashWrapper.getInstance();
^
symbol: class Librustzcash
location: class JLibrustzcash

/common/zksnark/JLibsodium.java:13: error: cannot find symbol
private static Libsodium INSTANCE = LibsodiumWrapper.getInstance();
^
symbol: class Libsodium
location: class JLibsodium
2 errors

How to overcome this error? Kindly guide me to solve this error

@liuyifei001
Copy link

liuyifei001 commented May 8, 2024

@Neoblock8 Can you specify your compile environment? Such as OS/JVM/JDK/Version, etc.

@317787106
Copy link
Contributor

@Neoblock8 What's your modifications?

@angrynurd
Copy link

hi, @Neoblock8
seems like the modifications result in missing Librustzcash and Libsodium class definitions.
to resolve this issue, it is recommended you do the following checking, as below:

  1. you step through your changes to ensure that the dependency libraries are correctly introduced and configured,
  2. the class paths are correct,
  3. the source files exist,
  4. the dependency library versions are compatible with the code.

By step-by-step troubleshooting the possible causes, you should be able to resolve the missing Librustzcash and Libsodium class definitions.

@Neoblock8
Copy link
Author

@Neoblock8 Can you specify your compile environment? Such as OS/JVM/JDK/Version, etc.

OS: Ubuntu
openjdk version "1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-8u372-gaus1-0ubuntu118.04-b09)
OpenJDK 64-Bit Server VM (build 25.362-b09, mixed mode)

@Neoblock8
Copy link
Author

@Neoblock8 What's your modifications?

Modified package of tron to test

@Neoblock8
Copy link
Author

hi, @Neoblock8 seems like the modifications result in missing Librustzcash and Libsodium class definitions. to resolve this issue, it is recommended you do the following checking, as below:

  1. you step through your changes to ensure that the dependency libraries are correctly introduced and configured,
  2. the class paths are correct,
  3. the source files exist,
  4. the dependency library versions are compatible with the code.

By step-by-step troubleshooting the possible causes, you should be able to resolve the missing Librustzcash and Libsodium class definitions.

Hi @endiaoekoe,
Need to run a private tron network. Without modifying tron packages it works fine, But i change all the tron packages and imported statements from tron to test. Compilation and building code successful. Getting this error while running the node.

image

@317787106
Copy link
Contributor

317787106 commented May 10, 2024

@Neoblock8 LibrustzcashJNI comes from another project:
compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'.
Source project is https://github.com/tronprotocol/zksnark-java-sdk.
You can see LibrustzcashJNI has fixed path: org_tron_common_zksnark_Librustzcash_LibrustzcashJNI.h at https://github.com/tronprotocol/zksnark-java-sdk/blob/master/cpp/src/LibrustzcashJNIImpl.cpp
If you want it to works fine, you may have to change some path, recompile this zksnark-java-sdk, import this jar directly instead of remote import. It may be a little complicated.

@Karthigasrini
Copy link

@Neoblock8 LibrustzcashJNI comes from another project: compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'. Source project is https://github.com/tronprotocol/zksnark-java-sdk. You can see LibrustzcashJNI has fixed path: org_tron_common_zksnark_Librustzcash_LibrustzcashJNI.h at https://github.com/tronprotocol/zksnark-java-sdk/blob/master/cpp/src/LibrustzcashJNIImpl.cpp If you want it to works fine, you may have to change some path, recompile this zksnark-java-sdk, import this jar directly instead of remote import. It may be a little complicated.

Hi @317787106,
Can you please guide me to import the jar file directly rather than remote import

@317787106
Copy link
Contributor

317787106 commented May 13, 2024

@Karthigasrini There are 3 steps to import local zksnark-java-sdk.jar:

  1. mkdir directory libs in chainbase.
  2. put compiled jar zksnark-java-sdk.jar into chainbase/libs/
  3. edit file chainbase/build.gradle:
  • comment compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  • add fileTree(dir: 'libs', include: 'zksnark-java-sdk.jar')

@Karthigasrini
Copy link

@Karthigasrini There are 3 steps to import local zksnark-java-sdk.jar:

  1. mkdir directory libs in chainbase.
  2. put compiled jar zksnark-java-sdk.jar into chainbase/libs/
  3. edit file chainbase/build.gradle:
  • comment compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  • add fileTree(dir: 'libs', include: 'zksnark-java-sdk.jar')

Hi @317787106,

As you said, I modified in build.gradle file still having same issue

@Karthigasrini
Copy link

@Karthigasrini There are 3 steps to import local zksnark-java-sdk.jar:

  1. mkdir directory libs in chainbase.
  2. put compiled jar zksnark-java-sdk.jar into chainbase/libs/
  3. edit file chainbase/build.gradle:
  • comment compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  • add fileTree(dir: 'libs', include: 'zksnark-java-sdk.jar')

Hi @317787106
Kindly give me a solution

@317787106
Copy link
Contributor

@Karthigasrini It's a little complicated. I will try to test it when I am free.

@Karthigasrini
Copy link

@Karthigasrini It's a little complicated. I will try to test it when I am free.

Thanks @317787106. Kindly test and provide a best solution asap

@317787106
Copy link
Contributor

@Karthigasrini What changes have you made ? How do you modify package of tron to test ?

@Karthigasrini
Copy link

@Karthigasrini What changes have you made ? How do you modify package of tron to test ?

I have rename all tron to test and changed the tron package name to test.
Then download the ["https://github.com/tronprotocol/zksnark-java-sdk"] zksnark package and renamed tron to test then compile and make the files. And pushed this files in another github repo, putting this repo name in tron source code

@317787106
Copy link
Contributor

317787106 commented May 27, 2024

@Karthigasrini I have compiled the project successful, it is complicated and time cost. You can do it as following:

  1. Modify and recompile the project zksnark-java-sdk:
  • Add modifier public before class Librustzcash
  • compile this project, use mvn clean package
  • get zksnark-java-sdk-1.0.0.jar under directory zksnark-java-sdk/target/.
  • copy it to directory chainbase/libs/ under java-tron project
  1. modify chainbase/build.gradle
    compile fileTree(dir: 'libs', include: 'zksnark-java-sdk-1.0.0.jar')
    //compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  1. Rename Other package and java class. such as:
mv actuator/src/main/java/org/tron/ actuator/src/main/java/org/brown/
mv chainbase/src/main/java/org/tron/ chainbase/src/main/java/org/brown
mv common/src/main/java/org/tron/ common/src/main/java/org/brown/
mv consensus/src/main/java/org/tron/ consensus/src/main/java/org/brown
mv crypto/src/main/java/org/tron crypto/src/main/java/org/brown
mv example/actuator-example/src/main/java/org/tron/ example/actuator-example/src/main/java/org/brown
mv framework/src/main/java/org/tron/ framework/src/main/java/org/brown
mv framework/src/test/java/org/tron/ framework/src/test/java/org/brown/
mv plugins/src/main/java/org/tron/ plugins/src/main/java/org/brown/
mv plugins/src/test/java/org/tron/ plugins/src/test/java/org/brown/

replace import:

package org.tron. -> package org.brown.
import org.tron. -> import org.brown.  
import static org.tron. -> import static org.brown.
import org.brown.p2p -> import org.tron.p2p
org.tron.protos. -> org.brown.protos.

modify any other necessary class.

  1. Modify all .proto files:
org.tron. -> org.brown.
  1. compile to find if there is any other error:
./gradlew clean build -x test --info

@Karthigasrini
Copy link

@Karthigasrini I have compiled the project successful, it is complicated and time cost. You can do it as following:

  1. Modify and recompile the project zksnark-java-sdk:
  • Add modifier public before class Librustzcash
  • comile this project, use mvn clean package
  • get zksnark-java-sdk-1.0.0.jar under directory zksnark-java-sdk/target/.
  • copy it to directory chainbase/libs/ under java-tron project
  1. modify chainbase/build.gradle
    compile fileTree(dir: 'libs', include: 'zksnark-java-sdk-1.0.0.jar')
    //compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  1. Rename Other package and java class. such as:
mv actuator/src/main/java/org/tron/ actuator/src/main/java/org/brown/
mv chainbase/src/main/java/org/tron/ chainbase/src/main/java/org/brown
mv common/src/main/java/org/tron/ common/src/main/java/org/brown/
mv consensus/src/main/java/org/tron/ consensus/src/main/java/org/brown
mv crypto/src/main/java/org/tron crypto/src/main/java/org/brown
mv example/actuator-example/src/main/java/org/tron/ example/actuator-example/src/main/java/org/brown
mv framework/src/main/java/org/tron/ framework/src/main/java/org/brown
mv framework/src/test/java/org/tron/ framework/src/test/java/org/brown/
mv plugins/src/main/java/org/tron/ plugins/src/main/java/org/brown/
mv plugins/src/test/java/org/tron/ plugins/src/test/java/org/brown/

replace import:

package org.tron. -> package org.brown.
import org.tron. -> import org.brown.  
import static org.tron. -> import static org.brown.
import org.brown.p2p -> import org.tron.p2p
org.tron.protos. -> org.brown.protos.

modify any other necessary class.

  1. Modify all .proto files:
org.tron. -> org.brown.
  1. compile to find if there is any other error:
./gradlew clean build -x test --info

Thanks a lot @317787106. I will check and let you know

@Karthigasrini
Copy link

@Karthigasrini I have compiled the project successful, it is complicated and time cost. You can do it as following:

  1. Modify and recompile the project zksnark-java-sdk:
  • Add modifier public before class Librustzcash
  • comile this project, use mvn clean package
  • get zksnark-java-sdk-1.0.0.jar under directory zksnark-java-sdk/target/.
  • copy it to directory chainbase/libs/ under java-tron project
  1. modify chainbase/build.gradle
    compile fileTree(dir: 'libs', include: 'zksnark-java-sdk-1.0.0.jar')
    //compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
  1. Rename Other package and java class. such as:
mv actuator/src/main/java/org/tron/ actuator/src/main/java/org/brown/
mv chainbase/src/main/java/org/tron/ chainbase/src/main/java/org/brown
mv common/src/main/java/org/tron/ common/src/main/java/org/brown/
mv consensus/src/main/java/org/tron/ consensus/src/main/java/org/brown
mv crypto/src/main/java/org/tron crypto/src/main/java/org/brown
mv example/actuator-example/src/main/java/org/tron/ example/actuator-example/src/main/java/org/brown
mv framework/src/main/java/org/tron/ framework/src/main/java/org/brown
mv framework/src/test/java/org/tron/ framework/src/test/java/org/brown/
mv plugins/src/main/java/org/tron/ plugins/src/main/java/org/brown/
mv plugins/src/test/java/org/tron/ plugins/src/test/java/org/brown/

replace import:

package org.tron. -> package org.brown.
import org.tron. -> import org.brown.  
import static org.tron. -> import static org.brown.
import org.brown.p2p -> import org.tron.p2p
org.tron.protos. -> org.brown.protos.

modify any other necessary class.

  1. Modify all .proto files:
org.tron. -> org.brown.
  1. compile to find if there is any other error:
./gradlew clean build -x test --info

Hi @317787106,
Geeting same error while compiling "zksnark-java-sdk"

@317787106
Copy link
Contributor

@Karthigasrini what's the error?

@Karthigasrini
Copy link

@Karthigasrini what's the error?

328849617-0af01110-d15a-4ba8-9db7-9618410406d6

@317787106
Copy link
Contributor

317787106 commented Jun 14, 2024

@Karthigasrini Please make sure this not changed:

private static org.tron.common.zksnark.Librustzcash INSTANCE;

I have successfully run the node after changed. Don't forget to modify .gradle, logback.xml, TransactionRegister and CommonConfig class.

@317787106
Copy link
Contributor

@Karthigasrini Have you fix this problem? If you did, please tell me.

@vivian1912
Copy link
Contributor

Thanks for your contribution to java-tron, this issue will be closed as no update for a long time. Please feel free to re-open it if you still see the issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants