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

Converge JLL APIs a bit more #38797

Merged
merged 1 commit into from
Dec 11, 2020
Merged

Converge JLL APIs a bit more #38797

merged 1 commit into from
Dec 11, 2020

Conversation

staticfloat
Copy link
Member

The initial draft of Fake JLLs missed some important points in JLL
API compatibility; let's close the gap somewhat, where we can. This PR
adds the following exports:

  • get_artifact_dir(): returns the Julia prefix
  • dev_jll(): Throws an error
  • best_wrapper: always set to nothing
  • get_*_path(): returns the path of the identified library product

It also converts all fake JLL modules to baremodules, and sets the
appropriate compiler options to minimize compilation.

Closes #38781

@staticfloat staticfloat added the backport 1.6 Change should be backported to release-1.6 label Dec 9, 2020
@staticfloat
Copy link
Member Author

@fingolfin Please let me know if any of these APIs don't work or are insufficient in some way.

@fingolfin
Copy link
Contributor

This also only addresses half of issue #38781 from my POV: there is still the issue of the missing headers...

@staticfloat
Copy link
Member Author

This also only addresses half of issue #38781 from my POV: there is still the issue of the missing headers...

We can't ship the GMP headers in include (since that would conflict with other GMP installs when unpacked to e.g. /usr/local). We could ship them in include/julia, but I'm personally against that. I think the best solution is for whatever build process you're using, to install the full GMP artifact manually on v1.6.

You can do that via something like:

using GMP_jll, Pkg.Artifacts
artifacts_toml = joinpath(dirname(dirname(Base.pathof(GMP_jll))), "StdlibArtifacts.toml")

# If this file exists, it's a stdlib JLL and we must download the artifact ourselves
if isfile(artifacts_toml)
    meta = artifact_meta("GMP", artifacts_toml)
    hash = Base.SHA1(meta["git-tree-sha1"])
    if !artifact_exists(hash)
        dl_info = first(meta["download"])
        download_artifact(hash, dl_info["url"], dl_info["sha256"])
    end
    global gmp_artifact_dir = artifact_path(hash)
else
	# Otherwise, we can just use the artifact directory given to us by GMP_jll
	global gmp_artifact_dir = GMP_jll.find_artifact_dir()
end

The initial draft of Fake JLLs missed some important points in JLL
API compatibility; let's close the gap somewhat, where we can.  This PR
adds the following exports:

* `get_artifact_dir()`: returns the Julia prefix
* `dev_jll()`: Throws an error
* `best_wrapper`: always set to `nothing`
* `get_*_path()`: returns the path of the identified library product

It also converts all fake JLL modules to `baremodule`s, and sets the
appropriate compiler options to minimize compilation.
@StefanKarpinski
Copy link
Member

Good to merge, @staticfloat?

@staticfloat staticfloat merged commit d8975fa into master Dec 11, 2020
@staticfloat staticfloat deleted the sf/jll_api_convergence branch December 11, 2020 04:35
KristofferC pushed a commit that referenced this pull request Dec 11, 2020
The initial draft of Fake JLLs missed some important points in JLL
API compatibility; let's close the gap somewhat, where we can.  This PR
adds the following exports:

* `get_artifact_dir()`: returns the Julia prefix
* `dev_jll()`: Throws an error
* `best_wrapper`: always set to `nothing`
* `get_*_path()`: returns the path of the identified library product

It also converts all fake JLL modules to `baremodule`s, and sets the
appropriate compiler options to minimize compilation.

(cherry picked from commit d8975fa)
@KristofferC KristofferC mentioned this pull request Dec 11, 2020
53 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Dec 19, 2020
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
The initial draft of Fake JLLs missed some important points in JLL
API compatibility; let's close the gap somewhat, where we can.  This PR
adds the following exports:

* `get_artifact_dir()`: returns the Julia prefix
* `dev_jll()`: Throws an error
* `best_wrapper`: always set to `nothing`
* `get_*_path()`: returns the path of the identified library product

It also converts all fake JLL modules to `baremodule`s, and sets the
appropriate compiler options to minimize compilation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fake JLL API discrepancies and usage concern
4 participants