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

monosat: Fix Linux build #63827

Merged
merged 2 commits into from Oct 15, 2019
Merged

monosat: Fix Linux build #63827

merged 2 commits into from Oct 15, 2019

Conversation

acairncross
Copy link
Contributor

@acairncross acairncross commented Jun 26, 2019

Motivation for this change

The Linux build was broken because the CMake build process for this package builds both static and shared libraries, but the static library dependencies weren't being provided. For some reason this doesn't seem to be a problem for the Darwin build:
Linux: https://hydra.nixos.org/job/nixpkgs/trunk/monosat.x86_64-linux
Darwin: https://hydra.nixos.org/job/nixpkgs/trunk/monosat.x86_64-darwin

The closure size seems large compared to the Darwin build. Is this normal?
/nix/store/1n2vwa7hc2wr882szg8s4dcajqc46m5b-monosat-09yhym2 511.3M

I'm not sure how to build the accompanying Python package.

@copumpkin

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@acairncross
Copy link
Contributor Author

Ah, the Python package (python37Packages.monosat) build successfully too.

@acairncross
Copy link
Contributor Author

And maybe the Darwin/Linux closure size difference is because the Darwin build doesn't includeJava?

@Taneb
Copy link
Contributor

Taneb commented Jun 27, 2019

@GrahamcOfBorg build monosat python37Packages.monosat

@copumpkin
Copy link
Member

Thanks! I'll try to test this over the weekend

@worldofpeace
Copy link
Contributor

Can we disable static builds and just have it shared? setup.sh already has it set to do --disable-static so that's a guideline for other packages.

@acairncross
Copy link
Contributor Author

I don't think that's straightforward to do. I think there would need to be changes made upstream to provide separate shared/static builds. I've made an issue on the monosat repo asking about this.

@acairncross
Copy link
Contributor Author

I've made a PR on the monosat repo to add an option to do a dynamically linked build only. If that gets merged I should be able to use that option for the Nix package. Would it not make sense to have that as a separate PR from this, since this is just fixing a currently broken build, whereas removing the static build is more of an improvement?

@worldofpeace
Copy link
Contributor

Your patch seems fine @acairncross. Can we use sambayless/monosat#24 downstream here?

@worldofpeace
Copy link
Contributor

Also, just for clarity, the build fails because it needs static libraries, which isn't really something we should curate in nixpkgs unless it's for the pkgsStatic overlay. So I'd think disabling them in anyway would be the most idiomatic fix to the build. Although in this case it required an improvement upstream.

@acairncross
Copy link
Contributor Author

My patch was merged upstream so I've bumped up the version here to use it. Is that ok?

@worldofpeace
Copy link
Contributor

The diff looks, umm... Huge? You should upgrade it to the beta release

have that in your commit message

monosat: $old_version -> $new_version

and apply that patch on top of it.

As you're the only (and new) maintainer of this I'm fine deferring to you as to what's acceptable.
Currently it's broken so it doesn't matter greatly.

Though I will mention, the preferred practice would be to make a derivative of the patch upstream to apply to this version... but as stated 😄

@worldofpeace
Copy link
Contributor

Edit: it appears the commit is in the 1.8.0 tag sambayless/monosat@033ac0f

@acairncross
Copy link
Contributor Author

acairncross commented Oct 15, 2019

The diff looks, umm... Huge?

Definitely a huge diff, although I think the majority of it is from applying a code formatter!

the preferred practice would be to make a derivative of the patch upstream to apply to this version

Ah, ok!

Anyway, I've bumped it to 1.8.0 (and done a bit of commit squashing).

This fixes the broken Linux build by only building the dynamic library/
executable (an option that was only added in the latest tagged version).
@worldofpeace
Copy link
Contributor

Thanks @acairncross for the fix and the patience ✨ .
Luckily @Taneb brought this to my attention so we could get this merged.

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

5 participants