-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
rebase of #56 (implement clone/free) onto #81 (graph refactor) #83
Conversation
4d9af18
to
5aaf9cf
Compare
Update: fixed the parsing of Pkg2 REQUIRE files. |
3054a2a
to
66e7d52
Compare
Thank you for doing this, @carlobaldassi! |
I was feeling guilty for the amount of disruptiveness of my PRs :) The Travis job fails with |
Unfortunately, I'm not sure what's up with CI on this and @KristofferC is on vacation, so 🤷♂️ |
When I made this PR, SHA was not needed for Pkg3 itself, only for the bin stuff. This PR changes the .travis.yml script to only use Pkg3. We thus never do Pkg.clone and thus not download SHA. |
fb5142a
to
24ac830
Compare
Ok the issue with Travis testing is fixed now. It's rather crude, but then again this won't be a problem once Pkg3 is moved to stdlib I guess. |
24ac830
to
6d80313
Compare
22d0077
to
776439b
Compare
6d80313
to
ee2bd89
Compare
This is now on top of master, i.e. on top of all the graph refactoring stuff. |
ee2bd89
to
1f0f0ae
Compare
Lovely, thanks a lot! |
FYI I made a rebase of this at I found a problem where the tokenizer can't understand git urls like |
Using this, this seems neat. I'll note a couple things that would help me to use Pkg3 at work (eventually - doesn't have to be this PR):
|
For now, you need to surround the url with quotes.
Definitely, but in order to make this PR right now (and to test with existing package) it needed to handle REQUIRE files.
It can, I didn't know this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relatively minor comments, but overall this looks great. Sorry this took me so long to get around to reviewing.
@@ -12,7 +12,7 @@ const colors = Dict( | |||
'↑' => :light_yellow, | |||
'~' => :light_yellow, | |||
'↓' => :light_magenta, | |||
'?' => :red, | |||
'?' => :white, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some reason for this that made red look weird but I don't remember. Will change it back.
src/Operations.jl
Outdated
@@ -256,7 +303,7 @@ function version_data(env::EnvCache, pkgs::Vector{PackageSpec}) | |||
end | |||
end | |||
end | |||
@assert haskey(hashes, uuid) | |||
# @assert haskey(hashes, uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this no longer a valid assertion? If not we should remove this comment. If it's still valid, it should be uncommented.
src/Operations.jl
Outdated
@@ -351,7 +398,7 @@ function install( | |||
return version_path, true | |||
end | |||
|
|||
function update_manifest(env::EnvCache, uuid::UUID, name::String, hash::SHA1, version::VersionNumber) | |||
function update_manifest(env::EnvCache, uuid::UUID, name::String, hash::Union{Void, SHA1}, version::VersionNumber, path::AbstractString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense for the signature here to be Union{String, SHA1}
and call it hash_or_path
? Or is the deal here that path
is always supplied but hash
may not be? It seems like the code is using an empty path
value to indicate lack of a path
value but the either or pattern might be cleaner.
push!(pkgs, PackageSpec(r.package)) | ||
end | ||
# TODO: Get rid of this one? | ||
registry_resolve!(env, pkgs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we determine if this should or shouldn't be gotten rid if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is using REQUIRE files that do not have UUIDs so the only way to get the UUIDS is to go to the registry. When we are not using REQUIRE files the UUIDs can just be read from the Manifest file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be harmless – if all the packages are already resolved, it won't hit the registry at all.
src/REPLMode.jl
Outdated
function do_clone!(env::EnvCache, tokens::Vector{Tuple{Symbol,Vararg{Any}}}) | ||
isempty(tokens) && cmderror("`clone` take an url to a package to clone") | ||
local url | ||
basepath = get(ENV, "JULIA_DEV_PATH", default_dev_path()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So even though this is a "path" to a place, we use _PATH
and _PATH
as a suffix in LOAD_PATH
and DEPOT_PATH
to indicate a list of places to look for things, whereas this is a single location to put things, which seems more like Sys.BINDIR
or JULIA_PKGDIR
so I think this environment variable should be called JULIA_DEVDIR
or JULIA_DEV_DIR
. I favor the former since we're going to have a bunch of variables with names like SRCDIR
and LIBDIR
so using the name DEVDIR
seems more consistent.
It's not yet implemented, but since a version is just a tree and a tree doesn't need to appear at the root of a repository, it could with the right tooling work. Since we don't really have any dev tooling for tagging Pkg3 packages yet, it doesn't support this but it also doesn't not support this – if you arranged for a Pkg3 version entry to map to a subtree in the repo, it would just work. Of course that subtree should look like a normal package, but that's certainly doable. |
Exactly. AFAICT, if I make my own head-written registry, I can have my own monorepo for all of my company's private packages - that is implemented. (After reading some blogposts on Google's monorepo, it seems rather appealing, but in any case it would be good to put some related libraries and/or tools/apps/projects into one repository). I would be extremely happy if any new tooling regarding creating and editing registries, package templates, and developing packages could respect this possibility - since adding this later might be difficult after architectural decisions are made and lead to avoidable refactoring. Regarding the functionality in this PR, I guess packages in development mode need a local git repository (cloned in this case) and a subdirectory of the repository, which can then be mapped to-and-from a tree hash? |
My thinking is that if a MetaProject.toml file exists we look in that for where the actual projects are and dev tools all respect that. |
OK, cool, so this isn't recorded in the registry at all... actually that's quite nice and lets developers move stuff around inside the repository quite easily. |
1f0f0ae
to
d8c97b7
Compare
src/Operations.jl
Outdated
!isfile(reqfile) && continue | ||
for r in filter!(r->r isa Pkg2.Reqs.Requirement, Pkg2.Reqs.read(reqfile)) | ||
# @assert length(r.versions.intervals) == 1 | ||
pkg_name, version = r.package, r.versions.intervals[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had fixed this (and the following lines) in bcdfe81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, must have messed up in rebasing :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be preferable to apply the fixes to c728e4b, where the rebase went wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, I'll try...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully good now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Needs to bring back pieces of Pkg2 to parse old-style REQUIRE files
Work-around for bootstrapping problem in trying to use Pkg3 to clone itself
9583edb
to
c80ef4d
Compare
Needs to bring back pieces of Pkg2 to parse old-style REQUIRE files
Work-around for bootstrapping problem in trying to use Pkg3 to clone itself
c80ef4d
to
cd4e43d
Compare
Everything here should now be with similar functionality in master |
As per the title, this rebases #56 on top of #81, cc @KristofferC, @StefanKarpinski.
I had to change a few things, and this allowed me to catch a few issues on the graph refactoring that I fixed. It seems to work now, or at least tests pass.
One annoying thing is that I had to bring back some pieces of Pkg2 from
bin/
intosrc/
, to allow for the parsing ofREQUIRE
files. I suppose that it's going to be needed as long as we support Pkg2-style dependency specifications(that part of the code needs to be fixed BTW).