-
Notifications
You must be signed in to change notification settings - Fork 41
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
Integrate aur-fetch and add diff support #37
Conversation
P.S jailbuild seems totally broken. Even before I touched anything, so no idea what to do about that. |
@Morganamilo in what way do you think jailbuild is broken? It certainly works for me. Maybe I got the documentation part wrong?
So you should use it like |
Ah, I assumed it downloaded the pkgbuild. |
Looking more at the MR, I think the caller (RUA) should be responsible for overall operation instead of callee library (
The current library aur-fetch is very opinionated on a lot of those questions... I'm not sure how convenient it would be to try split this logic into a library that would (potentially) be reused by other AUR clients. It would be very interesting for me, however, to try discuss the questions above, and then see what can we copy or reuse from current aur-fetch. My personal preferences:
|
By the way, a side note. Technically, the build process may create stuff like git hooks, which would in the prososed setup be executed by RUA unjailed. This is pretty insane though, not sure we should even try to protect against that. But if we copy the git thing to |
Where it downloads files to is totally configurable.
You can choose to store diffs or not store them. By raw files I assume you mean downloading tarballs? Downloading via git is faster in every way, so there's no advantage to it.
The current setup allows user's to edit pkgbuilds. If you just diffed HEAD with origin then you would lose local changes because origin does not have your changes. That's why it merges with upstream and gives you a diff of that. |
Ah indeed, since the library doesn't touch building part, it only has one directory to configure, and it is enough. I've misread that, sorry. I'll get back to other points a bit later as well. |
Any new opinions on this? |
@Morganamilo nothing new, but the old considerations still hold in my mind. E.g. I want building in ~/.cache but having cloned PKGBUILD repos in ~/.config, allow users to easily view full diffs without having go to git manually (upstream diff, diff old to local, diff new to local). Also, if git workflow would be required from user, check that the current branch has upstream merged in. |
If you'd like to make the changes, I'd be happy to merge of course. Otherwise I planned to make appropriate changes and then merge. |
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.
See PR discussion.
Is rua currently like this? I've not really payed attention. In fact if ruais currently like this then it's likely still like this and I just assumed otherwise.
Not sure what you mean here. The user does not have to use git manually. Sure git is called internally by rua, but that's just because these are git repos and git provides a very easy way to generate diffs. Also, aur-fetch does provide a diff_to_file function. Sue it still uses git to generate them, but you are then free to open the diffs in a file browser or whatever else.
What is old to local? Implemented here is local to upstream, which is the only thing I see that matters. |
It's not really. I'd just strongly like to see it this way before we have diff-ing and stuff. Because otherwise, people will start to rely on the diffs, and they will be broken if we change dir paths all of a sudden. Think of it as some kind of stabilization point.
I mean showing all kind of diffs, "old" means previously accepted. So:
|
In my model, local is the same as accepted. So it only really makes sense to diff against upstream. Does that sound reasonable to you? |
I guess we can start with only one kind of diff. But other types of diffs need to be implementable by design in future. Some other things that I remembered as well:
|
Plus reorder the directory structure Pkgbuilds are also initially cloned into .config, before being coppied to .cache for building Rename aur.tmp to clone seems as downloades are now cached Now instead of the cache layout being <cache>/<pkgname>/<subdir> it is now <cache>/<subdir>/<pkgname>.
Handled those issues as well as adding coloured diffs. Still confused over the other kinds of diffs. |
Sorry, had a trip to Dusseldorf and some other things, didn't have time to finish review yet. I'll try to do it in the following week. |
// I still want to return to this, just was somewhat busy with other things, unfortunately. |
Sorry for the very-very long review times. I've reviewed the code & tested it now. I tried to build a package now, but the current code just erases the local changes if I make any, not being persisted in I still don't think that abstraction of One other thing that makes sense I think is to try model the behavior without coding first, and once we inspect how it works and agree on something, transform it to code. Otherwise it's a bit sad to spend energy on something that can potentially be rewritten in the future anyway. Anyway, the remarks on the current code are above. |
OK, so I'm thinking of implementing this. The current idea is the following:
That's more or less it I guess. Everything should work this way right? Local changes and upstream preserved, git knowledge can be re-used for easier merges, you can see full history of your changes and upstream + see all kinds of diffs. You can wipe |
I decided to indeed make my attept at fixing it as well, since there are so many requirements and I'm not sure how they all feel on the other side. One other change that I want to make along the way is to fetch package information using |
I encountered one problem with the current plan: what to do with package installation for which latest changes were already reviewed and accepted? Still wipe |
* stop ever relying on current dir, current environment etc. This opens possibility for future concurrent workflow. * add logging * stop enforcing of target/ being the PKGDEST. Use more flexible by-file tar review. * resolve dependencies via RAUR library instead of relying on .SRCINFO-s * add a separate `shellcheck` command for RUA, with built-in handling of PKGBUILD variables * move all `include_bytes!` macros to one place fixes GH-1, fixes GH-41, replaces GH-37, supersedes GH-42.
Closing in favor of the new merge requests that bring in If something would be valuable to have as a library, and the functionality can be moved to a separate crate, it can be OK. On the other hand, there's not much to move, I only see this file as a good abstraction: https://github.com/vn971/rua/blob/21ca0de5c31280d664eacb6bec6512ebf8e6b26b/src/git_utils.rs |
I'm not sure if that would feel encouraging or not, but note that I did embrace a lot of the proposed concepts in the end. The directory layout is now "grouped" around the stage first (as in the first message in this PR). I ended up using Basically, I simplified git-related commands to only include Hope you understand why it was needed, and thanks for proposing those awesome ideas. |
It's been 2 years (wow) but there have been some changes:
This is no longer true. there are now 3 states This is nice because you can merge the changes, hand of the merged packagebuild to the user and if rua exists it's still not marked as seen. Also the grouping of packages in cache (which you mentioned rua does) allows for a unified cache and diffs. paru, pacaur, aurutils and maybe other's I've forgotten use AUR_DEST as an environment to control the aur cache. If you want to work on merging this again I'd be happy to work on it. If not, it would be nice for rua to implement AUR_SEEN and AURDEST. |
I'm not sure if rua does nuke the cache after building still though. There should be no need for it though as you can use BUILDIR and PKGDEST and such to control output. at a stretch you could copy the pkgbuild to a dir as they are tiny. |
Plus reorder the directory structure
Now instead of the cache layout being
<cache>/<pkgname>/<subdir>
it isnow
<cache>/<subdir>/<pkgname>
.E.g.