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
Contributor

@lorenzleutgeb lorenzleutgeb commented Oct 29, 2020

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
Contributor Author

@lorenzleutgeb lorenzleutgeb commented Jan 8, 2021

Ping @ttuegel

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

This comment has been minimized.

@ttuegel

ttuegel Jan 9, 2021
Member

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?

This comment has been minimized.

@lorenzleutgeb

lorenzleutgeb Jan 10, 2021
Author Contributor

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 714aab4.

Please reconsider.

@lorenzleutgeb lorenzleutgeb force-pushed the lorenzleutgeb:z3-java branch 3 times, most recently from ab0135f to 714aab4 Jan 10, 2021
@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Feb 26, 2021

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

@ttuegel
Copy link
Member

@ttuegel 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

@SuperSandro2000 SuperSandro2000 commented Feb 26, 2021

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 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

@SuperSandro2000 SuperSandro2000 commented Feb 27, 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.

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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants