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

z3: Add output for Java bindings (*.jar and *.so) #102086

Closed
wants to merge 0 commits into from

Conversation

lorenzleutgeb
Copy link
Member

Motivation for this change

I couldn't find com.microsoft.z3.jar and libz3java.so, then I found out that they ended up in the lib output. I think having a separate output is better.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@lorenzleutgeb
Copy link
Member Author

Ping @ttuegel

Comment on lines 54 to 55
mv com.microsoft.z3.jar $java
mv $lib/lib/libz3java.${stdenv.hostPlatform.extensions.sharedLibrary} $java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the preferred way to move files to another output:

Suggested change
mv com.microsoft.z3.jar $java
mv $lib/lib/libz3java.${stdenv.hostPlatform.extensions.sharedLibrary} $java
moveToOutput com.microsoft.z3.jar $java
moveToOutput lib/libz3java.${stdenv.hostPlatform.extensions.sharedLibrary} $java

Are you sure the JAR file should end up in the root of the output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for introducing me to moveToOutput.

I did some more searching, and found addPkgToClassPath which suggests to use $java/share/java/com.microsoft.z3.jar. Also matches this suggestion.

I could not use moveToOutput for the JAR, because it is not copied to $out above.

Fixed in 714aab4f477.

Please reconsider.

@SuperSandro2000
Copy link
Member

Please do not merge master into PRs to resolve merge conflicts.

@ttuegel
Copy link
Member

ttuegel commented Feb 26, 2021

Please do not merge master into PRs to resolve merge conflicts.

@SuperSandro2000 Where may I read about this policy?

@SuperSandro2000
Copy link
Member

Please do not merge master into PRs to resolve merge conflicts.

@SuperSandro2000 Where may I read about this policy?

This is a general anti pattern not specific to nix because it usually obfuscates the git history and makes it hard to follow changes back because the history is no longer linear.

@ttuegel
Copy link
Member

ttuegel commented Feb 26, 2021

This is a general anti pattern not specific to nix because it usually obfuscates the git history and makes it hard to follow changes back because the history is no longer linear.

@SuperSandro2000 Can you please show me where the Nixpkgs project has adopted this policy?

If this policy has been adopted by the organization, then an administrator can disable the feature in the repository settings. This will prevent confusion with new contributors, and save you a lot of work besides.

@SuperSandro2000
Copy link
Member

This is a general anti pattern not specific to nix because it usually obfuscates the git history and makes it hard to follow changes back because the history is no longer linear.

@SuperSandro2000 Can you please show me where the Nixpkgs project has adopted this policy?

If this policy has been adopted by the organization, then an administrator can disable the feature in the repository settings. This will prevent confusion with new contributors, and save you a lot of work besides.

This is not written anywhere down but just generally good manner for creating pull request on GitHub and a standard rule when working with git.

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

Successfully merging this pull request may close these issues.

None yet

3 participants