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

[pull] master from JuliaLang:master #4

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
83e1363
Run CI on backport branch too (#4094)
IanButterworth Nov 23, 2024
814949e
Increase version of `StaticArrays` in `why` tests (#4077)
fhagemann Dec 2, 2024
b610661
rename FORMER_STDLIBS -> UPGRADABLE_STDLIBS (#4070)
IanButterworth Dec 2, 2024
cd75456
Fix heading (#4102)
nilshg Dec 2, 2024
d84a1a3
Allow use of a url and subdir in [sources] (#4039)
tecosaur Dec 3, 2024
f9ad1c0
Fix a couple of bad JULIA_DEPOT_PATH settings (#4110)
IanButterworth Dec 9, 2024
e7c37f3
status: highlight when deps have different loaded versions (#4109)
IanButterworth Dec 9, 2024
47ad7e3
add some explicit precompile statements for `Pkg.status`. For some re…
KristofferC Dec 16, 2024
a1cfc6d
Improve latency for `Pkg.add` (#4115)
KristofferC Dec 17, 2024
b995782
avoid writing and reparsing the artifact usage file once per artifact…
KristofferC Dec 17, 2024
c7e611b
support before/after openssl switch (#4123)
IanButterworth Dec 30, 2024
739a64a
check source path is found when getting package_info (#4126)
IanButterworth Jan 1, 2025
8d3cf02
Fix OpenSSL_jll detection (#4127)
IanButterworth Jan 1, 2025
1eb09be
slightly improve memory in resolver code (#4119)
KristofferC Jan 2, 2025
bc9fb21
Fix JLL version fix fix (#4130)
IanButterworth Jan 10, 2025
2609a94
don't set up callbacks if using cli git (#4128)
IanButterworth Jan 16, 2025
df1931a
Use copy_test_packages in some places, and ensure that the copied tes…
rbvermaa Jan 16, 2025
938e9b2
app support in Pkg (#3772)
KristofferC Jan 24, 2025
a3626bf
add `PREV_ENV_PATH` to globals getting reset and move the reset to be…
KristofferC Jan 28, 2025
ecdf6aa
rename rot13 app in test to avoid name conflicts on systems where suc…
KristofferC Jan 28, 2025
6091533
fix ambiguity in apps `rm` (#4144)
KristofferC Jan 29, 2025
7aeec76
Update LineEdit internal for hints (#4146)
IanButterworth Feb 3, 2025
834c62d
reset caching of STDLIBs reading after precompilation is done (#4148)
KristofferC Feb 5, 2025
5e6c457
Add Aqua tests. Add missing compats (#4150)
IanButterworth Feb 11, 2025
ebfc041
Fix artifact directories not having traversal permissions (#4075)
staticfloat Feb 11, 2025
0333d55
Fixes for julia_version. Expand and consolidate julia_version tests. …
IanButterworth Feb 13, 2025
c54ee59
tests: make sure we're in an active project and that it's clean (#4155)
IanButterworth Feb 13, 2025
92595ec
Add more tests for BinaryBuilder usage (#4156)
IanButterworth Feb 16, 2025
14831ed
enable windows tree_hash checking (#4167)
IanButterworth Feb 23, 2025
f517489
Changed Pkg.test to prioritise julia_args --threads over current proc…
stemann Feb 25, 2025
2779d42
Update toml-files.md (#4177)
Heptazhou Feb 28, 2025
cf6191b
Pidlock source and artifact installation. Registry pidlock fixes. (#4…
IanButterworth Mar 1, 2025
6fa32d5
use temp dir on same filesystem for source install (#4180)
IanButterworth Mar 1, 2025
61115be
fix the right temp dir (#4181)
IanButterworth Mar 2, 2025
60e3185
Test fix: handle if tested Pkg is shipped version (#4182)
IanButterworth Mar 2, 2025
c0ba694
rename depot tmp dir to temp (#4183)
IanButterworth Mar 7, 2025
c9d161f
store temp packages in packages/temp (#4188)
IanButterworth Mar 14, 2025
26bdeee
`Project` construction, `Manifest` construction: improve type stabili…
nsajko Mar 15, 2025
6ac0df4
allow authors to be a TOML array (#3710)
simonbyrne Mar 16, 2025
ab53704
Create dependabot.yml (#4190)
vtjnash Mar 19, 2025
dfd0b83
Update codecov-action to v5 (#4191)
vtjnash Mar 19, 2025
b808cb1
Add a helper script for making missing Pkg tags (#4194)
IanButterworth Mar 20, 2025
b323a38
Artifacts: Add download size to `Artifacts.toml` (#4171)
staticfloat Mar 25, 2025
93fb66d
help debug freebsd test failure (#4199)
IanButterworth Mar 29, 2025
895e9d3
Lock io within printpkgstyle to avoid print tearing (#4202)
IanButterworth Mar 30, 2025
6f309f1
fix eagerly stopping hint completions (#4201)
IanButterworth Mar 30, 2025
5210c0d
Use `git -C` instead of `cd` (#4206)
fredrikekre Apr 1, 2025
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
all-actions:
patterns:
- "*"
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
branches:
- 'master'
- 'release-*'
- 'backports-release-*'
push:
branches:
- 'master'
- 'release-*'
- 'backports-release-*'
tags: '*'
defaults:
run:
Expand Down Expand Up @@ -82,9 +84,10 @@ jobs:
- uses: julia-actions/julia-processcoverage@v1
env:
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
docs:
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Pkg v1.12 Release Notes
- Pkg now has support for "workspaces" which is a way to resolve multiple project files into a single manifest.
The functions `Pkg.status`, `Pkg.why`, `Pkg.instantiate`, `Pkg.precompile` (and their REPL variants) have been updated
to take a `workspace` option. Read more about this feature in the manual about the TOML-files.
- `status` now shows when different versions/sources of dependencies are loaded than that which is expected by the manifest ([#4109])

Pkg v1.11 Release Notes
=======================
Expand Down
16 changes: 16 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,20 @@ REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
REPLExt = "REPL"

[compat]
Artifacts = "1.11"
Dates = "1.11"
Downloads = "1.6"
FileWatching = "1.11"
LibGit2 = "1.11"
Libdl = "1.11"
Logging = "1.11"
Markdown = "1.11"
Printf = "1.11"
Random = "1.11"
REPL = "1.11"
SHA = "0.7"
TOML = "1"
Tar = "1.10"
UUIDs = "1.11"
julia = "1.12"
p7zip_jll = "17.5"
89 changes: 89 additions & 0 deletions contrib/list_missing_pkg_tags.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using LibGit2

const JULIA_REPO_URL = "https://github.com/JuliaLang/julia.git"
const JULIA_REPO_DIR = "julia"
const PKG_VERSION_PATH = "stdlib/Pkg.version"
const PKG_REPO_URL = "https://github.com/JuliaLang/Pkg.jl.git"
const PKG_REPO_DIR = "Pkg.jl"

function checkout_or_update_repo(url, dir)
if isdir(dir)
println("Updating existing repository: $dir")
repo = LibGit2.GitRepo(dir)
LibGit2.fetch(repo)
else
println("Cloning repository: $url")
LibGit2.clone(url, dir)
end
end

function get_tags(repo)
refs = LibGit2.ref_list(repo)
tags = filter(ref -> startswith(ref, "refs/tags/"), refs)
return sort!(replace.(tags, "refs/tags/" => ""))
end

function is_stable_v1_release(tag)
return occursin(r"^v\d+\.\d+\.\d+$", tag) && VersionNumber(tag) >= v"1.0.0"
end

function extract_pkg_sha1(text::AbstractString)
m = match(r"PKG_SHA1\s*=\s*([a-f0-9]{40})", text)
return m !== nothing ? m[1] : nothing
end

function get_commit_hash_for_pkg_version(repo, tag)
try
tag_ref = LibGit2.GitReference(repo, "refs/tags/" * tag)
LibGit2.checkout!(repo, string(LibGit2.GitHash(LibGit2.peel(tag_ref))))
version_file = joinpath(JULIA_REPO_DIR, PKG_VERSION_PATH)
if isfile(version_file)
return extract_pkg_sha1(readchomp(version_file))
else
println("Warning: Pkg.version file missing for tag $tag")
return nothing
end
catch
println("Error processing tag $tag")
rethrow()
end
end

tempdir = mktempdir()
cd(tempdir) do
# Update Julia repo
checkout_or_update_repo(JULIA_REPO_URL, JULIA_REPO_DIR)
julia_repo = LibGit2.GitRepo(JULIA_REPO_DIR)

# Get Julia tags, filtering only stable releases
julia_tags = filter(is_stable_v1_release, get_tags(julia_repo))
version_commit_map = Dict{String, String}()

for tag in julia_tags
println("Processing Julia tag: $tag")
commit_hash = get_commit_hash_for_pkg_version(julia_repo, tag)
if commit_hash !== nothing
version_commit_map[tag] = commit_hash
end
end

# Update Pkg.jl repo
checkout_or_update_repo(PKG_REPO_URL, PKG_REPO_DIR)
pkg_repo = LibGit2.GitRepo(PKG_REPO_DIR)

# Get existing tags in Pkg.jl
pkg_tags = Set(get_tags(pkg_repo))

# Filter out versions that already exist
missing_versions = filter(v -> v ∉ pkg_tags, collect(keys(version_commit_map)))

# Sort versions numerically
sort!(missing_versions, by=VersionNumber)

# Generate `git tag` commands
println("\nGit tag commands for missing Pkg.jl versions:")
for version in missing_versions
commit = version_commit_map[version]
println("git tag $version $commit")
end
end
59 changes: 59 additions & 0 deletions docs/src/apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# [**?.** Apps](@id Apps)

!!! note
The app support in Pkg is currently considered experimental and some functionality and API may change.

Some inconveniences that can be encountered are:
- You need to manually make `~/.julia/bin` available on the PATH environment.
- The path to the julia executable used is the same as the one used to install the app. If this
julia installation gets removed, you might need to reinstall the app.
- You can only have one app installed per package.

Apps are Julia packages that are intended to be run as a "standalone programs" (by e.g. typing the name of the app in the terminal possibly together with some arguments or flags/options).
This is in contrast to most Julia packages that are used as "libraries" and are loaded by other files or in the Julia REPL.

## Creating a Julia app

A Julia app is structured similar to a standard Julia library with the following additions:

- A `@main` entry point in the package module (see the [Julia help on `@main`](https://docs.julialang.org/en/v1/manual/command-line-interface/#The-Main.main-entry-point) for details)
- An `[app]` section in the `Project.toml` file listing the executable names that the package provides.

A very simple example of an app that prints the reversed input arguments would be:

```julia
# src/MyReverseApp.jl
module MyReverseApp

function (@main)(ARGS)
for arg in ARGS
print(stdout, reverse(arg), " ")
end
return
end

end # module
```

```toml
# Project.toml

# standard fields here

[apps]
reverse = {}
```
The empty table `{}` is to allow for giving metadata about the app but it is currently unused.

After installing this app one could run:

```
$ reverse some input string
emos tupni gnirts
```

directly in the terminal.

## Installing Julia apps

The installation of Julia apps are similar to installing julia libraries but instead of using e.g. `Pkg.add` or `pkg> add` one uses `Pkg.Apps.add` or `pkg> app add` (`develop` is also available).
2 changes: 1 addition & 1 deletion docs/src/environments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [**4.** Working with Environment](@id Working-with-Environments)
# [**4.** Working with Environments](@id Working-with-Environments)

The following discusses Pkg's interaction with environments. For more on the role, environments play in code loading, including the "stack" of environments from which code can be loaded, see [this section in the Julia manual](https://docs.julialang.org/en/v1/manual/code-loading/#Environments-1).

Expand Down
36 changes: 31 additions & 5 deletions docs/src/toml-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,38 @@ are described below.

### The `authors` field

For a package, the optional `authors` field is a list of strings describing the
package authors, in the form `NAME <EMAIL>`. For example:
For a package, the optional `authors` field is a TOML array describing the package authors.
Entries in the array can either be a string in the form `"NAME"` or `"NAME <EMAIL>"`, or a table keys following the [Citation File Format schema](https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md) for either a
[`person`](https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md#definitionsperson) or an[`entity`](https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md#definitionsentity).

For example:
```toml
authors = ["Some One <[email protected]>",
"Foo Bar <[email protected]>"]
authors = [
"Some One <[email protected]>",
"Foo Bar <[email protected]>",
{given-names = "Baz", family-names = "Qux", email = "[email protected]", orcid = "https://orcid.org/0000-0000-0000-0000", website = "https://github.com/bazqux"},
]
```

If all authors are specified by tables, it is possible to use [the TOML Array of Tables syntax](https://toml.io/en/v1.0.0#array-of-tables)
```toml
[[authors]]
given-names = "Some"
family-names = "One"
email = "[email protected]"

[[authors]]
given-names = "Foo"
family-names = "Bar"
email = "[email protected]"

[[authors]]
given-names = "Baz"
family-names = "Qux"
email = "[email protected]"
orcid = "https://orcid.org/0000-0000-0000-0000"
website = "https://github.com/bazqux"
```

### The `name` field

Expand Down Expand Up @@ -100,6 +125,7 @@ corresponding manifest file.
```toml
[sources]
Example = {url = "https://github.com/JuliaLang/Example.jl", rev = "custom_branch"}
WithinMonorepo = {url = "https://github.org/author/BigProject", subdir = "SubPackage"}
SomeDependency = {path = "deps/SomeDependency.jl"}
```

Expand Down Expand Up @@ -161,7 +187,7 @@ For the details, see [`Pkg.instantiate`](@ref).

### Different Manifests for Different Julia versions

Starting from Julia v1.11, there is an option to name manifest files in the format `Manifest-v{major}.{minor}.toml`.
Starting from Julia v1.10.8, there is an option to name manifest files in the format `Manifest-v{major}.{minor}.toml`.
Julia will then preferentially use the version-specific manifest file if available.
For example, if both `Manifest-v1.11.toml` and `Manifest.toml` exist, Julia 1.11 will prioritize using `Manifest-v1.11.toml`.
However, Julia versions 1.10, 1.12, and all others will default to using `Manifest.toml`.
Expand Down
4 changes: 2 additions & 2 deletions ext/REPLExt/REPLExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function create_mode(repl::REPL.AbstractREPL, main::LineEdit.Prompt)
end
else
LineEdit.edit_insert(s, ';')
LineEdit.check_for_hint(s) && LineEdit.refresh_line(s)
LineEdit.check_show_hint(s)
end
end
end
Expand All @@ -181,7 +181,7 @@ function repl_init(repl::REPL.LineEditREPL)
end
else
LineEdit.edit_insert(s, ']')
LineEdit.check_for_hint(s) && LineEdit.refresh_line(s)
LineEdit.check_show_hint(s)
end
end
)
Expand Down
35 changes: 27 additions & 8 deletions ext/REPLExt/completions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ end


const JULIA_UUID = UUID("1222c4b2-2114-5bfd-aeef-88e4692bbb3e")
function complete_remote_package(partial; hint::Bool)
found_match = false
isempty(partial) && return String[]
function complete_remote_package!(comps, partial; hint::Bool)
isempty(partial) && return true # true means returned early
found_match = !isempty(comps)
cmp = Set{String}()
for reg in Registry.reachable_registries()
for (uuid, regpkg) in reg
Expand All @@ -80,9 +80,9 @@ function complete_remote_package(partial; hint::Bool)
if is_julia_compat === nothing || is_julia_compat
push!(cmp, name)
# In hint mode the result is only used if there is a single matching entry
# so we abort the search
# so we can return no matches in case of more than one match
if hint && found_match
return sort!(collect(cmp))
return true # true means returned early
end
found_match = true
break
Expand All @@ -91,7 +91,8 @@ function complete_remote_package(partial; hint::Bool)
end
end
end
return sort!(collect(cmp))
append!(comps, sort!(collect(cmp)))
return false # false means performed full search
end

function complete_help(options, partial; hint::Bool)
Expand Down Expand Up @@ -149,13 +150,31 @@ function complete_add_dev(options, partial, i1, i2; hint::Bool)
if occursin(Base.Filesystem.path_separator_re, partial)
return comps, idx, !isempty(comps)
end
comps = vcat(comps, sort(complete_remote_package(partial; hint)))
if !isempty(partial)
returned_early = complete_remote_package!(comps, partial; hint)
# returning early means that no further search should be done here
if !returned_early
append!(comps, filter!(startswith(partial), [info.name for info in values(Types.stdlib_infos())]))
end
return comps, idx, !isempty(comps)
end

# TODO: Move
import Pkg: Operations, Types, Apps
function complete_installed_apps(options, partial; hint)
manifest = try
Types.read_manifest(joinpath(Apps.app_env_folder(), "AppManifest.toml"))
catch err
err isa PkgError || rethrow()
return String[]
end
apps = String[]
for (uuid, entry) in manifest.deps
append!(apps, keys(entry.apps))
push!(apps, entry.name)
end
return unique!(apps)
end

########################
# COMPLETION INTERFACE #
########################
Expand Down
Loading