Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Fix CHOLMOD version check #37

Merged
merged 1 commit into from
Aug 20, 2021
Merged

Fix CHOLMOD version check #37

merged 1 commit into from
Aug 20, 2021

Conversation

nalimilan
Copy link
Contributor

This check was supposed to ensure major versions match, as the error message indicates.
Introduced by fcaae6f at JuliaLang/julia#38919.

Without this it's very hard to build Julia packages in distributions, as patch version mismatches are common.

@ViralBShah At JuliaLang/julia#38919 (comment) you said

The PR will kick off the build process. Separately, we should tighten the version checking to closely follow CHOLMOD down to the patch level for now. Both the Yggdrasil PRs and this one should be merged in close succession - with Yggdrasil first. I'm happy to help with the merging.

I don't understand why this was needed, given that making the check stricter merely triggers a warning, which doesn't fix anything in itself. Anyway, can it be removed now? Note that we print a warning too if the version is older than the expected one.

This check was supposed to ensure major versions match, as the error message indicates.
Introduced by fcaae6f.
@nalimilan nalimilan requested a review from ViralBShah July 9, 2021 20:54
@codecov
Copy link

codecov bot commented Jul 9, 2021

Codecov Report

Merging #37 (b2d965a) into master (71002bc) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #37   +/-   ##
=======================================
  Coverage   88.70%   88.70%           
=======================================
  Files           4        4           
  Lines        1310     1310           
=======================================
  Hits         1162     1162           
  Misses        148      148           
Impacted Files Coverage Δ
src/cholmod.jl 90.28% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7685615...b2d965a. Read the comment docs.

@ViralBShah
Copy link
Member

ViralBShah commented Jul 9, 2021

IIRC, CHOLMOD was changing layouts of their internal structs in patch releases which was breaking Julia silently. I believe you have to match the exact patch versions for SuiteSparse, or you can end up with a surprise once in a while.

@andreasnoack may remember more of the details.

@nalimilan
Copy link
Contributor Author

If that's the case then we should report this to SuiteSparse. That would make it completely impossible to package Julia in distributions without also bundling SuiteSparse, which goes against distribution policies. As long as the SONAME doesn't change, one should be able to switch versions without recompiling anything.

@ViralBShah
Copy link
Member

@Wimmerer FYI.

@ViralBShah ViralBShah marked this pull request as draft July 16, 2021 15:39
@rayegun
Copy link
Member

rayegun commented Jul 21, 2021

I will look into this, and ask Dr. Davis.

@ViralBShah
Copy link
Member

I'm going to close this one - since it would be dangerous to do this - until cholmod does a major version bump and then follows semver better.

@ViralBShah ViralBShah closed this Aug 19, 2021
@nalimilan
Copy link
Contributor Author

@Wimmerer Any news from Dr Davis about this?

@ViralBShah
Copy link
Member

I wonder if @DrTimothyAldenDavis will see this on github.

@ViralBShah
Copy link
Member

Please don't delete this branch.

@DrTimothyAldenDavis
Copy link

What's the issue?

@rayegun
Copy link
Member

rayegun commented Aug 19, 2021

@ViralBShah I don't actually see any changes to the CHOLMOD structs in SuiteSparse's recent history (at least the ones referenced in the referenced PRs above), (could totally be missing them). I wonder if this will be easily fixed once we switch to Clang.jl wrappers? I can wrap any recent version and handle this internally?

@ViralBShah
Copy link
Member

@DrTimothyAldenDavis @Wimmerer I can't quite hunt up the relevant issues/PRs (maybe @andreasnoack can). Basically we noticed that some of the internal cholmod structs changed between minor releases. Since Julia mirrors the C structs (but did it with offsets), upgrading cholmod without upgrading the Julia side led to the code breaking.

The solution we thus adopted was to hardcode the Cholmod version Julia expects and check that on startup. This makes things difficult for linux distributions, who would like to use any Cholmod 4.x with Julia, rather than specifically 4.3.1 (as an example). For example, this PR tries to relax that check.

I suppose going forward, if SuiteSparse libraries can use semantic versioning to ensure that APIs only change across major releases (and remains fully compatible across minor and patch releases), it will become a lot easier.

Hope I have accurately captured the issue, and that someone can correct me if I have got it wrong.

@DrTimothyAldenDavis
Copy link

DrTimothyAldenDavis commented Aug 19, 2021 via email

@DilumAluthge DilumAluthge deleted the nl/version branch August 19, 2021 21:12
@rayegun
Copy link
Member

rayegun commented Aug 19, 2021

@DilumAluthge see above from Viral

@DilumAluthge DilumAluthge restored the nl/version branch August 19, 2021 23:55
@DilumAluthge
Copy link
Contributor

Whoops thanks. Thank goodness for the "Restore branch" button.

@rayegun
Copy link
Member

rayegun commented Aug 20, 2021

E: https://github.com/DrTimothyAldenDavis/SuiteSparse/blame/master/CHOLMOD/Include/cholmod_core.h

This is difficult for me to read but it looks like maybe something was changed in v2.1.1 and 4.3.0? This was probably the issue.

@DrTimothyAldenDavis
Copy link

DrTimothyAldenDavis commented Aug 20, 2021 via email

@rayegun
Copy link
Member

rayegun commented Aug 20, 2021

https://github.com/DrTimothyAldenDavis/SuiteSparse/blame/master/CHOLMOD/Include/cholmod_core.h

This is difficult for me to read but it looks like maybe something was changed in v2.1.1 and 4.3.0? This was probably the issue.

@rayegun
Copy link
Member

rayegun commented Aug 20, 2021

Note that we have v2.1.1 as the minimum, so the changes there aren't the issue. So I think this was about changes to cholmod_common_struct in v4.3.0.

@ViralBShah
Copy link
Member

No that's not it. Anyways we need to dig up the exact issue. Perhaps @andreasnoack may remember.

@andreasnoack
Copy link
Member

The relevant issues are JuliaLang/julia#10362 and JuliaLang/julia#10342. It looks like the issue was caused by a change in the major CHOLMOD vesion, see JuliaLang/julia#10342 (comment), so the check I implemented seems to be too strict and that this PR is correct.

@ViralBShah ViralBShah reopened this Aug 20, 2021
@ViralBShah
Copy link
Member

ViralBShah commented Aug 20, 2021

@DrTimothyAldenDavis Sorry for the noise! Thanks @andreasnoack.

@ViralBShah
Copy link
Member

@nalimilan We'll merge this, and presumably we want to bump the SuiteSparse version in julia base and also backport to 1.7.

@DrTimothyAldenDavis
Copy link

DrTimothyAldenDavis commented Aug 20, 2021 via email

@ViralBShah
Copy link
Member

I believe in this case, we are following the CHOLMOD version. We saw breakage across major versions of CHOLMOD - which is expected as per semver. However, when we saw the breakage, we put in a change that checked the exact version of CHOLMOD that the Julia interface was designed for. That check turns out to be too severe.

This PR will only check for compatibility between CHOLMOD and its Julia interface and enforce that the major version number matches on both sides.

@ViralBShah ViralBShah marked this pull request as ready for review August 20, 2021 14:54
@ViralBShah ViralBShah merged commit 6e570c6 into master Aug 20, 2021
@ViralBShah ViralBShah deleted the nl/version branch August 20, 2021 14:54
@nalimilan
Copy link
Contributor Author

Glad we sorted this out! Thanks everyone! A backport to 1.7 would indeed be welcome.

@DrTimothyAldenDavis
Copy link

DrTimothyAldenDavis commented Aug 20, 2021 via email

@ViralBShah
Copy link
Member

It was a bug in the Julia part. All good on the CHOLMOD/SuiteSparse front.

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

Successfully merging this pull request may close these issues.

6 participants