clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
521 stars 29 forks source link

RFE: native vagrant packaging ['patch' included] #876

Open AntonioMeireles opened 5 years ago

AntonioMeireles commented 5 years ago

attached is a patch that attempts to get properly packaged vagrant, the Clear way, so that it can later be shipped as a pundle, in Clear Linux...

for-review.txt

offlineDepBuilder.sh is an helper script that builds offline the needed artifacts [already referenced in the Makefile] so that autospec / mock works ...

offlineDepBuilder.sh.txt

All the best,

António

bryteise commented 5 years ago

I will take a look at this once I finish some other autospec work. Thanks so much for this work by the way. I know we are not super excited for offline dependency building (and we are doing work in the java ecosystem to get that out of the distro) but until our ruby ecosystem gets more robust this type of work is needed.

AntonioMeireles commented 5 years ago

@bryteise

thanks again for your patience!

btw when time comes the set bellow will be needed in the pundle definition so that plugin installing works out of the box (the set covers the critical ones we care - vagrant-libvirt and my very own vagrant-guests-clearlinux)

c-basic
ruby-basic
go-basic
devpkg-libvirt
devpkg-libxml2
devpkg-libgpg-error
devpkg-libgcrypt
libarchive

Finally, i've also managed to package natively terraform and packer already - but one thing a time :-)

bryteise commented 5 years ago

First thing I see is that it is installing things into /opt which we can't do I can look to see how to move that over into /usr but if you know off the top of your head it would save me some time.

AntonioMeireles commented 5 years ago

that /opt/vagrant/.. is hardcoded upstream... and i didn't want to mess with it ... if it is a blocker_ i'll look at patching it (after i find out how/what :-) ) and will report back !

bryteise commented 5 years ago

It is a blocker for us unfortunately. We don't ship anything packaged outside of /usr (and no /usr/local) as part of our stateless policy. We don't want to conflict with files the user might have installed in /opt for instance in this case. Sorry this turned into more work X(. I can try and take a look this afternoon assuming I get autospec and go to get along better this morning =).

AntonioMeireles commented 5 years ago

ok, patch bellow should do it ... places embedded stuff under %{_datadir}/vagrant and at (a very quick) sight still works :-)

for-review.txt

All the best!

bryteise commented 5 years ago

Oh that was quick, nice work! This looks good to me. Unfortunately I'm noting that the license calls out there is extensions that are licensed non-open source. May need to dig at this a bit more.

bryteise commented 5 years ago

Poke for @ahkok.

bryteise commented 5 years ago

@AntonioMeireles Okay so it looks like it is the legacy.tar.gz installer archive that has the offending license. I don't see it in the https://github.com/hashicorp/vagrant-installers repo though so I'm not sure if we could use a different version to avoid this issue.

AntonioMeireles commented 5 years ago

humm... how are are you scanning for LICENSES ? i'm not seeing that legacy.tar.gz anywhere here 😲 (may be looking in wrong places ...)

bryteise commented 5 years ago

In the offlineDepBuilder.sh export VAGRANT_INSTALLERS_TARBALL=https://codeload.github.com/hashicorp/vagrant-installers/legacy.tar.gz/${VAGRANT_INSTALLERS_COMMIT}

AntonioMeireles commented 5 years ago

In the offlineDepBuilder.sh export VAGRANT_INSTALLERS_TARBALL=https://codeload.github.com/hashicorp/vagrant-installers/legacy.tar.gz/${VAGRANT_INSTALLERS_COMMIT}

Oh, that's just a checkout of https://github.com/hashicorp/vagrant-installers tip commit (i locked it to assure absolute reproducibility) and actually LICENSE is there ... (they just call it (!) LICENSE.md) and is MIT.

Hope this helps!

bryteise commented 5 years ago

Yea they oddly ship https://github.com/hashicorp/vagrant-installers/blob/master/package/support/darwin/license.html (and a windows version) license files and I don't see any content that would obviously fall under it. Will look into it more but I agree the main project has an MIT license.

AntonioMeireles commented 5 years ago

ok, the updated offlineDepBuilder.sh bellow should do the trick ...

offlineDepBuilder.sh.txt

basically the folders with dubious licensing (which we don't need in any fashion anyway) are excluded from the assembled tarball so that the (S)RPMs only contain stuff with no licensing gray areas.

All the best,

António