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

haskell-opencv: fix build and #47595 #50192

Closed
wants to merge 1 commit into from

Conversation

typetetris
Copy link
Contributor

applied patch can be removed, when
LumiGuide/haskell-opencv@cd613e2
hits hackage and later nixpkgs.

Motivation for this change

get opencv to build again and fix #47595

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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

applied patch can be removed, when
LumiGuide/haskell-opencv@cd613e2
hits hackage and later nixpkgs.
Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

Can we download that patch from somewhere instead of committing it into the Nixpkgs repository?

@typetetris
Copy link
Contributor Author

I tried that, but the repository for haskell-opencv contains two packages at the same time and the patch assumes subdirectories opencv and opencv-extra which are uploaded separately to hackage and are therefore (I assume) not contained in the source of opencv for nixpkgs.

@typetetris
Copy link
Contributor Author

On hackage the --with-ld=c++ is still in the Setup.hs file.

if you want to wait, until that gets updated on hackage and the patch is unnecessary, I can change my pull request to just strip the configure flags cabal2nix generates.

If you want to update cabal2nix to not generate those configure flags in this case any more and wait
for that, I can close the pull request.

So, what shall it be?

@peti
Copy link
Member

peti commented Nov 13, 2018

I'm not sure I follow. Are you saying that the configure flags https://github.com/NixOS/cabal2nix/blob/master/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs#L354-L355 are unnecessary today, i.e. we could just remove them and there'd be no harm done?

@typetetris
Copy link
Contributor Author

If I understood matters correctly: No.

At the moment opencv doesn't build in master.

The fix are two parts:

  1. Remove --with-ld=c++ from Setup.hs
  2. Remove the configure flags cabal2nix generates.

Applying 1. doesn't change the cabal file, so I assumed, cabal2nix would still generate the configure flags, which we need to remove, so 2. is still necessary.

The part 1. will eventually be fixed, if a new version of opencv gets uploaded to hackage event.
The part 2. could be fixed in two ways, either (a) through that part of my pull request, or (b) through a change in cabal2nix (whatever that could be, should cabal2nix look at Setup.hs?)

So if we wait for the change of Setup.hs to hit hackage and hence nixpkgs, we don't need 1. in the pull request.

And if the maintainer of cabal2nix (I assume that is you?) decides to "fix" it, we wouldn't need 2. from my pull request.

Hopefully that is clearer now.

peti added a commit to NixOS/cabal2nix that referenced this pull request Nov 13, 2018
According to NixOS/nixpkgs#50192 (comment),
this won't be necessary any more with modern versions of the package.
@peti
Copy link
Member

peti commented Nov 13, 2018

OK, now I understand what is going on. Thank you!

I modified cabal2nix in NixOS/cabal2nix@1b0c0c3 and merged (a slightly modified version of) this PR into haskell-updates as 7fee1034ef7. These changes allow me to build opencv and will be merged into master in a minute. I could not build opencv-extra, however, because ghc crashed trying to compile this code. The result may depend on the exact version of the compiler that's being used, though. I'm inclined to just ignore this issue.

On a side note, it might be a good idea to open a ticket with upstream to make sure that they are aware that their test suite does not compile.

@peti peti closed this in 5966c56 Nov 13, 2018
peti added a commit to NixOS/cabal2nix that referenced this pull request Nov 13, 2018
According to NixOS/nixpkgs#50192 (comment),
this won't be necessary any more with modern versions of the package.
@typetetris typetetris deleted the fix-47595 branch November 13, 2018 14:06
@typetetris
Copy link
Contributor Author

Thank you! I wasn't aware that there is package specific knowledge in cabal2nix already.

Profpatsch pushed a commit to Profpatsch/cabal2nix that referenced this pull request Mar 7, 2022
According to NixOS/nixpkgs#50192 (comment),
this won't be necessary any more with modern versions of the package.
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.

haskell opencv doesn't build anymore
3 participants