[PATCH] gnu: Add terraform.

  • Open
  • quality assurance status badge
Details
4 participants
  • EuAndreh
  • Sarah Morgensen
  • Christopher Baines
  • Marius Bakke
Owner
unassigned
Submitted by
EuAndreh
Severity
normal
Merged with
E
E
EuAndreh wrote on 18 Nov 2020 14:31
(address . guix-patches@gnu.org)(name . EuAndreh)(address . eu@euandre.org)
20201118133110.2380-1-eu@euandre.org
* gnu/packages/terraform.scm (terraform): New variable.
---
gnu/packages/terraform.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/terraform.scm b/gnu/packages/terraform.scm
index b9313bbd4a..233859629c 100644
--- a/gnu/packages/terraform.scm
+++ b/gnu/packages/terraform.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2020 EuAndreh <eu@euandre.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -47,3 +48,27 @@ the inputs and outputs for modules of the Terraform infrastructure management
tool. These can be shown, or written to a file in JSON or Markdown formats.")
(home-page "https://github.com/segmentio/terraform-docs")
(license license:expat)))
+
+(define-public terraform
+ (package
+ (name "terraform")
+ (version "0.13.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/hashicorp/terraform")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "0q8x6fhhkh4spddbqsxbsc2fp0r5p5010awgkb628s9vz111ws3r"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/hashicorp/terraform"))
+ (synopsis "Tool for building, changing, and versioning infrastructure")
+ (description
+ "Terraform enables you to safely and predictably create, change, and
+improve infrastructure. It is an open source tool that codifies APIs into
+declarative configuration files that can be shared amongst team members,
+treated as code, edited, reviewed, and versioned.")
+ (home-page "https://www.terraform.io/")
+ (license license:mpl2.0)))
--
2.29.2
C
C
Christopher Baines wrote on 20 Nov 2020 10:21
(name . EuAndreh)(address . eu@euandre.org)(address . 44721@debbugs.gnu.org)
874klkl6xd.fsf@cbaines.net
EuAndreh via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (46 lines)
> * gnu/packages/terraform.scm (terraform): New variable.
> ---
> gnu/packages/terraform.scm | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/gnu/packages/terraform.scm b/gnu/packages/terraform.scm
> index b9313bbd4a..233859629c 100644
> --- a/gnu/packages/terraform.scm
> +++ b/gnu/packages/terraform.scm
> @@ -1,6 +1,7 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
> ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2020 EuAndreh <eu@euandre.org>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -47,3 +48,27 @@ the inputs and outputs for modules of the Terraform infrastructure management
> tool. These can be shown, or written to a file in JSON or Markdown formats.")
> (home-page "https://github.com/segmentio/terraform-docs")
> (license license:expat)))
> +
> +(define-public terraform
> + (package
> + (name "terraform")
> + (version "0.13.5")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/hashicorp/terraform")
> + (commit (string-append "v" version))))
> + (sha256
> + (base32
> + "0q8x6fhhkh4spddbqsxbsc2fp0r5p5010awgkb628s9vz111ws3r"))))
> + (build-system go-build-system)
> + (arguments
> + '(#:import-path "github.com/hashicorp/terraform"))
> + (synopsis "Tool for building, changing, and versioning infrastructure")
> + (description
> + "Terraform enables you to safely and predictably create, change, and
> +improve infrastructure. It is an open source tool that codifies APIs into
> +declarative configuration files that can be shared amongst team members,
> +treated as code, edited, reviewed, and versioned.")
> + (home-page "https://www.terraform.io/")
> + (license license:mpl2.0)))

Hi,

Thanks for the patch. I've also written a package definition like this,
which works, but isn't yet suitable for inclusion in Guix, because it
misrepresents the dependencies/inputs.

Terraform has a number of dependencies, but this package does
not. Properly packaging it for Guix will require packaging those
dependencies, then making a package definition which actually uses those
dependencies.

I'm hopeful that the recent progress with importers for Go packages will
help with this, but I haven't checked myself, maybe you can take a look?

Thanks,

Chris

(there's also some Terraform related discussion here
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl+3iq5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcT6hAAnu/6yBWTLTaHFSKP92gqYX+JTKQDGl+1
TUOUUmFxlpWWgCkTMiv6Ix1ZuVQrEmyOAagN/5YJ5/FuNU5VBI59pKUCmtNiTOKy
/lF7WVqXzO6UgWm/wou6yNVxPzVMSATKMjlf4JlCbII2qZcNRb1RYvDbQTwwUZFy
N2U6icernfQt4Vl+rizx/sjuObtSNzpM6xkSYaSDVn0uQrsF8MipWqPPNi+SX+1a
4Sff3fDppfTw4IwZoG8xqb5s6g8hg0nC9hjGY4DEshTyKArQIR8lk+Aq+kXx5MAv
hEZfPG1iqWBb3HTqaOYSIpPNrYSRMg4OYZV3Eauj/5Udexpma0xuBGqmJDvMCloi
VAlMXe+3ROiFi2RXPxrc2BcrvAwQBWpHMu8hoJlKIIHhDxoisZBoiPyeOOFwFp+S
kalhQt77//zbkgX96rZSuEcpO7EtQQBYFM0TeEzjYYhPO8b1X3DtiRGHGjvojT8y
CY6d5u3LxE/qf+jgqUBH4lsndS4ZJOWhSppNLWzI0Kx6TAvXAduCL4Gw17B93okI
dN5oWuH66VuItWpno+btjNOMwB2hU/LMSv7Ax7w2HENMNUqZ61ft4swIUR9byKRa
B1JyA1ZtLLh7Idw7XKXMlNU6i7TlxfxGZ/jEDFi80v+CzKBJJHUFwieUmiOHKpBd
hjdwtLhTFJI=
=CeZt
-----END PGP SIGNATURE-----

E
E
EuAndreh wrote on 22 Nov 2020 23:11
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44721@debbugs.gnu.org)
87tuthjb42.fsf@euandre.org
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (11 lines)
> Hi,
>
> Thanks for the patch. I've also written a package definition like this,
> which works, but isn't yet suitable for inclusion in Guix, because it
> misrepresents the dependencies/inputs.
>
> Terraform has a number of dependencies, but this package does
> not. Properly packaging it for Guix will require packaging those
> dependencies, then making a package definition which actually uses those
> dependencies.

Hi there. Thanks for the explanation.

I didn't inspect the dependencies of Terraform itself. I just tried
using the "go-build-system" and tested the resulting binary.

I'll check the linked discussions to better understand and further
investigate.
E
E
EuAndreh wrote on 23 Nov 2020 01:37
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44721@debbugs.gnu.org)
87r1okkivs.fsf@euandre.org
EuAndreh <eu@euandre.org> writes:

Toggle quote (5 lines)
> Hi there. Thanks for the explanation.
>
> I didn't inspect the dependencies of Terraform itself. I just tried
> using the "go-build-system" and tested the resulting binary.

Interestingly, the package compiled successfully and the final binary
was generated. I didn't test any functionality, though.

I wonder if the compilation should have failed, instead. I'll try the
package again and see if it is actually working.

I looked into the issue you pointed, and my package definition was
smaller and simpler, indeed. But those didn't seem to produce a binary
at the end. I wonder if mine worked because I used a newer version.
E
E
EuAndreh wrote on 23 Nov 2020 13:03
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44721@debbugs.gnu.org)
87o8jojn52.fsf@euandre.org
Now I get it: the Terraform repo used to vendor all of its dependencies,
and has just stopped doing it recently [0].

But the release tarball still contains all of the vendored dependencies.
I'm still not sure if that is deliberate, or just left over from the
previous model of vendoring everything from the source code repository
itself.

I'll check if the vendoring on the release tarball is deliberate now,
and start packaging the dependencies as Christopher sugested.

E
E
EuAndreh wrote on 23 Nov 2020 13:12
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44721@debbugs.gnu.org)
87lfesjmq5.fsf@euandre.org
EuAndreh <eu@euandre.org> writes:

Toggle quote (13 lines)
> Now I get it: the Terraform repo used to vendor all of its dependencies,
> and has just stopped doing it recently [0].
>
> But the release tarball still contains all of the vendored dependencies.
> I'm still not sure if that is deliberate, or just left over from the
> previous model of vendoring everything from the source code repository
> itself.
>
> I'll check if the vendoring on the release tarball is deliberate now,
> and start packaging the dependencies as Christopher sugested.
>
> [0]: https://github.com/hashicorp/terraform/pull/26358

The commit [0] that removed the vendoring was done in September 24th,
and the release of v0.13.5 [1] was done in October 21st.

However the release of v0.13.5 was a backport, and didn't include the
commit that removed the vendoring. Only v0.14.0-rc1 (the current latest
release) onwards that has removed the vendoring.

So the "go-build-system" just worked because all of the dependencies
were already there. Switching to v0.14.0-rc1 should probably break the
build, and require the dependencies to be packaged individually.

E
E
EuAndreh wrote on 24 Nov 2020 18:33
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44721@debbugs.gnu.org)
87lfeqd5ht.fsf@euandre.org
Toggle quote (3 lines)
> Switching to v0.14.0-rc1 should probably break the
> build, and require the dependencies to be packaged individually.

It does break, I'll start doing it.

It would probably be better to work on a golang importer, and I'm more
inclined to do that to package Terraform instead of packaging every
dependency manually.

This will take a bit more work than I initially planned for, but I'm
still up for it.
M
M
Marius Bakke wrote on 25 Nov 2020 23:49
(address . 44721@debbugs.gnu.org)
87pn41oxwa.fsf@gnu.org
EuAndreh via Guix-patches via <guix-patches@gnu.org> skriver:

Toggle quote (12 lines)
>> Switching to v0.14.0-rc1 should probably break the
>> build, and require the dependencies to be packaged individually.
>
> It does break, I'll start doing it.
>
> It would probably be better to work on a golang importer, and I'm more
> inclined to do that to package Terraform instead of packaging every
> dependency manually.
>
> This will take a bit more work than I initially planned for, but I'm
> still up for it.

There is a Go importer on the patch tracker:


Two even, if you follow the URLs!

It should make things a little easier. :-)
-----BEGIN PGP SIGNATURE-----

iQFDBAEBCgAtFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl++32UPHG1hcml1c0Bn
bnUub3JnAAoJEKKgbfKjOlT6SacH/04JJGO0blORAWtUcaXmr8gSsPMVOcSW/YRy
Ggi2CP9D7YYouicfW2fRAnMWnP8HW/ShghKMpfNijyuApVtzmzHq9SdrJNTZeTH1
jhAGR2akVUcI9L7TwvMg3hxboSEa4DA+l7O58Joo/Z/GsNU9CGu/Qsqf0cEhvuZS
i0JeaNeWOvpDq/OISK16ijEbnkCnkdEYPNyVqjOQqZSogYdsBFBNM1W3brqzTD+I
IOgtHjKwqFv2q+iAUwcU7Lb00WPcrpqX3bbODLdA2T/x67hRWw5mxdBZAqILb3t0
lk4XH1LPdX4A1oDsp9TL20apMOobeMtpRBuJ8hJsWF3jGFxqU4s=
=GhPv
-----END PGP SIGNATURE-----

E
E
EuAndreh wrote on 26 Nov 2020 00:34
(address . 44721@debbugs.gnu.org)
87d001nh7w.fsf@euandre.org
Marius Bakke <marius@gnu.org> writes:

Toggle quote (2 lines)
> It should make things a little easier. :-)

Hmm, that is great! Thanks for the reference!

It certainly makes things a little easier.
S
S
Sarah Morgensen wrote on 13 Sep 2021 03:18
control message for bug #30806
(address . control@debbugs.gnu.org)
E1mPac2-0003HB-B8@debbugs.gnu.org
merge 30806 44721
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 44721@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44721
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch