oshazard / apacman

ArchLinux User Repository (AUR) helper and pacman wrapper
https://aur.archlinux.org/packages/apacman/
GNU General Public License v3.0
70 stars 11 forks source link

build but not install #5

Closed suedi closed 9 years ago

suedi commented 9 years ago

is there a way to build and package a AUR package + dependencies but not install it with apacman?

I had an uggly hack in packer but thought maybe you had done something similar?

oshazard commented 9 years ago
  1. As long as you don't use --noconfirm it won't install successfully built AUR packages without your permission.
  2. If you add --purgebuild (similar to makepkg --rmdeps) it will remove build deps that it installed.
  3. I added --skiptest (similar to makepkg --nocheck) to skip installing checkdeps array packages.
  4. If you want it to not install "run time" deps, I could add passthrough for makepkg --nodeps but I don't think that differentiates between makedeps and regular deps. So I'd have to add something similar to --skiptest to just avoid those packages (though it would break a good portion of packages - things that need something for build AND runtime)
    • If you still have the hack, share it.
    • I'm unsure what your use case is - you should be more specific in what you are trying to accomplish and which packages are involved.
    • If you simply want to remove unneeded packages, it's quite simple to remove orphans as deps are installed with --asdeps.
suedi commented 9 years ago

use case:

  1. Arch derivative with aufs (union filesystem )
  2. I want to build aur packages but not install it. The same for runtime deps if possible get rid of buildtime deps This is the step I would like apacman for
  3. take aur packages and runtime-deps and put them in a squash file
  4. overlay this squashfile

here's the hack check added flag --buildonly. if flag set it uninstalls the newly made packages

https://www.dropbox.com/s/yeka8tvcqcr6itr/packer?dl=1

Maybe this is not interesting for whole community if so maybe I could fork

oshazard commented 9 years ago
  1. I'm actually planning to work on something very similar but using OverlayFS (it's in kernel 3.18+)
  2. to 4. I assume you don't want to install them on your base/dev install because you want to distribute these as a "bundle" for Live systems.

Since I was planning to do this anyway, I'll go ahead and add this to apacman. My bundling solution will be separate, so you're free to use your own (though I'd be willing to collab)

oshazard commented 9 years ago

Here is what I have so far, should still be buggy, but give it a try: apacman 1.3beta

suedi commented 9 years ago

will try soon

I have not checked code of apacman allthough I'm familiar with packers code.

Did you do a lot of work on errorhandling? I did some really dirty stuff for rolling back a --nobuild that resulted in error that is uninstalls deps if error occurred and finishing packer with errorcode

I'm willing to cooperate, I have a solution already for bundling in alphaos that I am willing to share with you. If you like you can use it as base or just checkout how it's done there.

https://www.dropbox.com/s/pcim5vxdhnd4mb9/2222222makesb.sb?dl=1

it's a squash archive so "unsquashfs" it

This one has the altered packer with rollback on error. I copy pasted it in on serveral places, should of course be done via a function

I have written a part of the code, it's gpl3

if you like also check out the OS https://alphaos.tuxfamily.org/

Yeah I saw about overlayfs but it can only do upper and lower, right. It will be useful but I need the full aufs

suedi commented 9 years ago

Is there any other way to communicate or do you think this is a good forum for devel. duscussion? I am not used to git-development

symlinked apacman to packer and ran makesb

when su -c aurbuild fail strange things seems to happen (the failure is on my system ) dunnow why cmake and git gets marked for removal, it doesn't happen anyway

also apacman gives status 0 even though a fatal error occurred

EDIT When I did fix the su error the build went OK but this time cmake and git was actually uninstalled, they were installed to begin with

        also when trying to install viber

deps downloaded: cdparanoia-10.2-5 gst-plugins-base-1.4.3-1 libvisual-0.4.0-5 libxkbcommon-x11-0.4.3-1 qt5-base-5.3.2-2 qt5-declarative-5.3.2-2 qt5-location-5.3.2-2 qt5-script-5.3.2-2 qt5-sensors-5.3.2-2 qt5-webkit-5.3.2-2 qt5-xmlpatterns-5.3.2-2 qtchooser-41-1 xcb-util-image-0.4.0-1 xcb-util-keysyms-0.4.0-1 xcb-util-wm-0.4.1-1 qt5-quick1-5.3.2-2 qt5-svg-5.3.2-2 qt5-websockets-5.3.2-2

deps removed: Packages (3): qt5-quick1-5.3.2-2 qt5-svg-5.3.2-2 qt5-websockets-5.3.2-2

------8<----------------------------------------------------------------------------------------- makesb sysdig ==> Cleaning packages cache ==> Downloading sysdig packer

Aur Targets (1): sysdig Pacman Targets (1): dkms

Proceed with building? [Y/n] resolving dependencies... looking for inter-conflicts...

Packages (1): dkms-2.2.0.3-15

Total Download Size: 0.05 MiB Total Installed Size: 0.15 MiB

:: Proceed with installation? [Y/n] :: Retrieving packages ... dkms-2.2.0.3-15-any 48.2 KiB 742K/s 00:00 [###############] 100% ... su: failed to execute /bin/bash: Permission denied The build failed. checking dependencies...

Packages (3): cmake-3.0.2-1 dkms-2.2.0.3-15 git-2.1.2-1

Total Removed Size: 46.79 MiB

:: Do you want to remove these packages? Y/n removing dkms [###############] 100% (2/3) removing git [###############] 100% (3/3) removing cmake [###############] 100% ==> Packages to bundle /var/cache/pacman/pkg/dkms-2.2.0.3-15-any.pkg.tar.xz ==> Checked Exit value: 0 ==> Packages moved to /tmp/modules/sysdig ==> Running script arch2sb sysdig ==> Extracting -> dkms-2.2.0.3-15-any.pkg.tar.xz

==> Creating bundle sysdig.sb Parallel mksquashfs: Using 4 processors

----------------------------------------------------------------------------------------->8------------------------------

oshazard commented 9 years ago

No, this isn't a good place for discussion. Send me an e-mail @gmail.com

The su issue is likely because the user does not exist. If you install from AUR, the .install script should create the user for you. It's an unfortunately necessary and ugly hack. Otherwise perhaps it didn't have permission for the build directory? Unclear regarding that.

Yes, the exit code should be 1 in case of an error, although IMO your script should be using some other form of verification. If a package fails to build, it will skip it and attempt to build the rest of the targets, I'll add in an error message and return a failure exit code if that's the case.

Removing packages in place prior to install is a logic flaw, the result of code reuse, I'll fix that -- that is my bad. There are a few other bugs I came across in my testing that need to be resolved for the next release.

Also please use code markup in the future.

I haven't had time to look over your build scripts and distro, later this week.

oshazard commented 9 years ago

@suedi Some notable changes in v1.3:

suedi commented 9 years ago

Hey,

Testing it thoroughly now, Found nothing to fault.

Works great with my packaging solution also

Will defilnetly go in next release of alphaos

Thanks for your hard work

What is the roadmap for apacman, Anymore features you are planning?

what is apacman-deps?

best regards

scooby

On Tue, Feb 10, 2015 at 9:45 AM, OS Hazard notifications@github.com wrote:

Closed #5 https://github.com/oshazard/apacman/issues/5.

— Reply to this email directly or view it on GitHub https://github.com/oshazard/apacman/issues/5#event-233049576.

oshazard commented 9 years ago

As far as planned features, I've had requests for the following:

I don't really have a timeline though and I have another FOSS project that needs my attention.