all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Request: build package with source tarball
@ 2022-09-12  1:04 Ryan Prior
  2022-09-12  1:29 ` Olivier Dion via Development of GNU Guix and the GNU System distribution.
  2022-09-12  8:59 ` Maxime Devos
  0 siblings, 2 replies; 4+ messages in thread
From: Ryan Prior @ 2022-09-12  1:04 UTC (permalink / raw)
  To: Guix Devel

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

Hi there! Lately I've been testing distribution tarballs with a workflow like this:

- update some software in my source directory
- create a distribution tarball
- untar to a directory like /tmp/mypkg-src
- run: guix build --with-source=mypkg=/tmp/mypkg-src​

It would be nice to skip step 3 there and just run: guix build --with-source=mypkg.tar.gz​
Guix should then untar and use the result as the source directory for the build.

To soup the process up even further, allow --with-source​ to take a URL of a tarball, in which case Guix fetches and untars. Then I could write a trivial local microservice which produces distribution tarballs on demand, allowing me to skip both steps 2 and 3. That would be a sweet workflow.

Ryan

[-- Attachment #2: Type: text/html, Size: 1487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Request: build package with source tarball
  2022-09-12  1:04 Request: build package with source tarball Ryan Prior
@ 2022-09-12  1:29 ` Olivier Dion via Development of GNU Guix and the GNU System distribution.
  2022-09-12  1:35   ` Ryan Prior
  2022-09-12  8:59 ` Maxime Devos
  1 sibling, 1 reply; 4+ messages in thread
From: Olivier Dion via Development of GNU Guix and the GNU System distribution. @ 2022-09-12  1:29 UTC (permalink / raw)
  To: Ryan Prior, Guix Devel

On Mon, 12 Sep 2022, Ryan Prior <rprior@protonmail.com> wrote:
> Hi there! Lately I've been testing distribution tarballs with a workflow like this:
>
> - update some software in my source directory
> - create a distribution tarball
> - untar to a directory like /tmp/mypkg-src
> - run: guix build --with-source=mypkg=/tmp/mypkg-src​
>
> It would be nice to skip step 3 there and just run: guix build --with-source=mypkg.tar.gz​
> Guix should then untar and use the result as the source directory for
> the build.

It already can.

I use this in my Makefiles:
--8<---------------cut here---------------start------------->8---
libpatch.tar.gz:
	@git archive --format=tar.gz --prefix=libpatch/ \
	--output $@ HEAD

guix-build: libpatch.tar.gz
	@guix build --keep-failed --rounds=2 \
	--with-source=libpatch=$^ libpatch
--8<---------------cut here---------------end--------------->8---

-- 
Olivier Dion
oldiob.dev


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Request: build package with source tarball
  2022-09-12  1:29 ` Olivier Dion via Development of GNU Guix and the GNU System distribution.
@ 2022-09-12  1:35   ` Ryan Prior
  0 siblings, 0 replies; 4+ messages in thread
From: Ryan Prior @ 2022-09-12  1:35 UTC (permalink / raw)
  To: Olivier Dion; +Cc: Guix Devel

On Monday, September 12th, 2022 at 1:29 AM, Olivier Dion <olivier.dion@polymtl.ca> wrote:


> It already can.
> 
> I use this in my Makefiles: [snip]

That's a solid approach with your makefile! I tried it yesterday with just the tar.gz and it didn't seem to work, but probably I misspelled something and then gave up too early. Just tried again and it's working as expected.

Thank you!
Ryan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Request: build package with source tarball
  2022-09-12  1:04 Request: build package with source tarball Ryan Prior
  2022-09-12  1:29 ` Olivier Dion via Development of GNU Guix and the GNU System distribution.
@ 2022-09-12  8:59 ` Maxime Devos
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Devos @ 2022-09-12  8:59 UTC (permalink / raw)
  To: Ryan Prior, Guix Devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1335 bytes --]



On 12-09-2022 03:04, Ryan Prior wrote:
> Hi there! Lately I've been testing distribution tarballs with a workflow 
> like this:
> 
>  1. update some software in my source directory
>  2. create a distribution tarball
>  3. untar to a directory like /tmp/mypkg-src
>  4. run: |guix build --with-source=mypkg=/tmp/mypkg-src|​
> 
> 
> It would be nice to skip step 3 there and just run: |guix build 
> --with-source=mypkg.tar.gz|​
> Guix should then untar and use the result as the source directory for 
> the build.

I believe you can do that already -- "guix build" accepts not only 
directories, but also regular files.

For example, the following builds the 'hello' package, but with the 
source code of 'sed' instead of 'hello' (doesn't make much sense, but 
just an example):

$ guix build hello "--with-source=hello=$(guix build --source sed)"

(no need to unpack tarballs!)


> To soup the process up even further, allow |--with-source|​ to take a 
> URL of a tarball, in which case Guix fetches and untars.

That is already supported:

$ guix build hello "--with-source=hello=file://$(guix build --source sed)"
(succeeds)

$ guix build hello "--with-source=hello=http://localhost/hello.tar.gz"
(network errors, because I don't actually have a tarball there.)

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-12  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12  1:04 Request: build package with source tarball Ryan Prior
2022-09-12  1:29 ` Olivier Dion via Development of GNU Guix and the GNU System distribution.
2022-09-12  1:35   ` Ryan Prior
2022-09-12  8:59 ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.