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

Return of the build script via Preferences #483

Merged
merged 26 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f00f8de
Add old builder script at a GRPrefrences submodule
mkitti Nov 1, 2022
0911720
Make sure deps directory is created
mkitti Nov 1, 2022
351aa87
Cleanup some old code
mkitti Nov 1, 2022
2f41c77
Refactor build.jl into downloader.jl
mkitti Nov 1, 2022
5322ba6
Implement JLL overrides
mkitti Nov 1, 2022
941b490
Add a friendly suggestion to use `force = true`
mkitti Nov 2, 2022
3151f4f
Use GR_jll's UUID rather than the GR_jll symbol in case GR_jll fails …
mkitti Nov 2, 2022
c240f95
Add a force keyword to download
mkitti Nov 2, 2022
994807f
Add repair instructions to GR_jll import failure message.
mkitti Nov 2, 2022
1829619
Apply suggestions from code review
mkitti Nov 2, 2022
a0f7240
Apply suggestions from code review
mkitti Nov 2, 2022
6802ac6
Add diagnostics function
mkitti Nov 2, 2022
5f6fc70
Allow install_dir to include "gr" basename, use parent as install_dir
mkitti Nov 2, 2022
fe6ccff
Reinitialize GRPreferences.jl after changing binaries
mkitti Nov 2, 2022
6fc46ea
Fix resolved_dir in diagnostics
mkitti Nov 3, 2022
833468e
Fix svgplugin.dll issues on Windows
mkitti Nov 3, 2022
9a74f89
Pin GR_jll version to 0.69.1
mkitti Nov 3, 2022
38cb1c8
Fix libpath on Windows, maybe?
mkitti Nov 3, 2022
84c69ae
Add README documentation for GRPreferences
mkitti Nov 3, 2022
2472394
Fix funcptrs.jl
mkitti Nov 3, 2022
ea529f5
Resolve svgplugin issues by rebuilding LIBPATH
mkitti Nov 3, 2022
fbbada0
Apply suggestions from code review
mkitti Nov 3, 2022
1390e5d
Improve Overrides.toml diagnostic
mkitti Nov 3, 2022
9a82ca6
Rename get_override to get_overrides
mkitti Nov 3, 2022
375a59f
Add some GRPreferences tests
mkitti Nov 3, 2022
005b721
Fix tests
mkitti Nov 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ author = ["Josef Heinen (@jheinen)"]
version = "0.69.5"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
GR_jll = "d2c73de3-f751-5644-a686-071e5b155ba9"
Expand All @@ -17,11 +18,15 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

[compat]
Preferences = "1"
HTTP = "0.8, 0.9, 1"
JSON = "0.20, 0.21, 1"
Preferences = "1"
GR_jll = "0.69.1"
julia = "1.6"
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,43 @@ However, if you want to permanently use your own GR run-time, you have to set th

Please note that with the method shown here, `GR_jll` is not imported.

### Switching binaries via GR.GRPreferences

To aid in switching between BinaryBuilder and upstream framework binaries, the `GR.GRPReferences` module implements three methods `use_system_binary()`, `use_upstream_binary()`, and `use_jll_binary()`. These use [Preferences.jl](https://github.com/JuliaPackaging/Preferences.jl) to configure GR.jl
and GR_jll.jl.

To use an existing GR install, invoke `use_system_binary`.

```julia
using GR
GR.GRPreferences.use_system_binary("/path/to/gr"; force = true)
```

To download and switch to [upstream binaries](https://github.com/sciapp/gr/releases) invoke `use_upstream_binary`.

```julia
using GR # repeat this if there is an error
GR.GRPreferences.use_upstream_binary(; force = true)
```

`use_system_binary` and `use_upstream_binary` accept an `override` keyword. This may be set to one of the following:
* `:depot` (default) - Use Overrides.toml in the Julia depot. This normally resides in `.julia/artifacts/Overrides.toml`
* `:project` - Use LocalPreferences.toml. This is usually located near the Project.toml of your active project environment.
* `(:depot, :project)` - Use both of the override mechanisms above.

To switch back to BinaryBuilder binaries supplied with [GR_jll](https://github.com/JuliaBinaryWrappers/GR_jll.jl), invoke `use_jll_binary`:

```julia
using GR # repeat this if there is an error
GR.GRPreferences.use_jll_binary(; force = true)
```

This will reset both the `:depot` and `:project` override mechanisms above.

If you encounter difficulties switching between binaries, the `diagnostics()` function will provide useful information.
Please include this information when asking for assistance.

```julia
using GR
GR.GRPreferences.diagnostics()
```
Loading