[1/2] Added i586/386 support for GO language required for node_exporter.

Message ID 20210506194616.2972714-2-holger.sunke@posteo.de
State New
Headers show
Series Added new Package node_exporter | expand

Commit Message

Holger Sunke May 6, 2021, 7:46 p.m. UTC
---
 lfs/Config | 4 ++++
 lfs/go     | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

Comments

Adolf Belka May 6, 2021, 8:26 p.m. UTC | #1
Hi Holger,

On 06/05/2021 21:46, Holger Sunke wrote:
> ---
>   lfs/Config | 4 ++++
>   lfs/go     | 6 +++---
>   2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/lfs/Config b/lfs/Config
> index eadbbc408..4d0f2f00b 100644
> --- a/lfs/Config
> +++ b/lfs/Config
> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
>   	GOARCH = arm64
>   endif
>   
> +ifeq "$(BUILD_ARCH)" "i586"
> +	GOARCH = 386
> +endif
> +

A question I would have here is if creating this package in i586 architecture makes sense when in 7 months the i586 version of IPFire will have reached End Of Life and will no longer be updated.

Regards,

Adolf

>   ###############################################################################
>   # Common Macro Definitions
>   ###############################################################################
> diff --git a/lfs/go b/lfs/go
> index 6ebb37080..97effcb84 100644
> --- a/lfs/go
> +++ b/lfs/go
> @@ -28,10 +28,9 @@ VER        = 1.15.4
>   
>   THISAPP    = go-$(VER)
>   DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
> -DL_FROM    = $(URL_IPFIRE)
> +DL_FROM    = https://golang.org/dl/
>   DIR_APP    = $(DIR_SRC)/go
>   TARGET     = $(DIR_INFO)/$(THISAPP)
> -SUP_ARCH   = x86_64
>   
>   ###############################################################################
>   # Top-level Rules
> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
>   
>   $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
>   
> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
>   
>   install : $(TARGET)
>
Michael Tremer May 7, 2021, 11:28 a.m. UTC | #2
Hello Holger,

Thanks for this patch, but I am afraid it doesn’t do exactly what you intend to do.

> On 6 May 2021, at 20:46, Holger Sunke <holger.sunke@posteo.de> wrote:
> 
> ---
> lfs/Config | 4 ++++
> lfs/go     | 6 +++---
> 2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/lfs/Config b/lfs/Config
> index eadbbc408..4d0f2f00b 100644
> --- a/lfs/Config
> +++ b/lfs/Config
> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
> 	GOARCH = arm64
> endif
> 
> +ifeq "$(BUILD_ARCH)" "i586"
> +	GOARCH = 386
> +endif

This is fine.

> +
> ###############################################################################
> # Common Macro Definitions
> ###############################################################################
> diff --git a/lfs/go b/lfs/go
> index 6ebb37080..97effcb84 100644
> --- a/lfs/go
> +++ b/lfs/go
> @@ -28,10 +28,9 @@ VER        = 1.15.4
> 
> THISAPP    = go-$(VER)
> DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
> -DL_FROM    = $(URL_IPFIRE)
> +DL_FROM    = https://golang.org/dl/
> DIR_APP    = $(DIR_SRC)/go
> TARGET     = $(DIR_INFO)/$(THISAPP)
> -SUP_ARCH   = x86_64

This however enables Go for all architectures including aarch64 and armv5tel which is not what you intend.

The correct solution would be to add i586 to the list of supported architectures.

However, I would object to only add Go for i586 because you personally use IPFire on this architecture (please not Adolf’s remarks on our schedule to discontinue i586). We only build Go for x86_64 because the only package that uses it is the Amazon SSM agent which is not relevant on any other architecture. node_exporter seems to be a package that could in theory run on any architecture and I feel that we should not discriminate by only building something for one architecture because we do not want to test it on any of the others.

-Michael

> 
> ###############################################################################
> # Top-level Rules
> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
> 
> $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
> 
> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
> 
> install : $(TARGET)
> 
> -- 
> 2.30.2
>
Holger Sunke May 7, 2021, 6:19 p.m. UTC | #3
Hello Michael,


Am 07.05.21 um 13:28 schrieb Michael Tremer:
> Hello Holger,
> 
> Thanks for this patch, but I am afraid it doesn’t do exactly what you intend to do.
> 
>> On 6 May 2021, at 20:46, Holger Sunke <holger.sunke@posteo.de> wrote:
>>
>> ---
>> lfs/Config | 4 ++++
>> lfs/go     | 6 +++---
>> 2 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/lfs/Config b/lfs/Config
>> index eadbbc408..4d0f2f00b 100644
>> --- a/lfs/Config
>> +++ b/lfs/Config
>> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
>> 	GOARCH = arm64
>> endif
>>
>> +ifeq "$(BUILD_ARCH)" "i586"
>> +	GOARCH = 386
>> +endif
> 
> This is fine.
> 
>> +
>> ###############################################################################
>> # Common Macro Definitions
>> ###############################################################################
>> diff --git a/lfs/go b/lfs/go
>> index 6ebb37080..97effcb84 100644
>> --- a/lfs/go
>> +++ b/lfs/go
>> @@ -28,10 +28,9 @@ VER        = 1.15.4
>>
>> THISAPP    = go-$(VER)
>> DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
>> -DL_FROM    = $(URL_IPFIRE)
>> +DL_FROM    = https://golang.org/dl/
>> DIR_APP    = $(DIR_SRC)/go
>> TARGET     = $(DIR_INFO)/$(THISAPP)
>> -SUP_ARCH   = x86_64
> 
> This however enables Go for all architectures including aarch64 and armv5tel which is not what you intend.
> 
> The correct solution would be to add i586 to the list of supported architectures.
> 
> However, I would object to only add Go for i586 because you personally use IPFire on this architecture (please not Adolf’s remarks on our schedule to discontinue i586). We only build Go for x86_64 because the only package that uses it is the Amazon SSM agent which is not relevant on any other architecture. node_exporter seems to be a package that could in theory run on any architecture and I feel that we should not discriminate by only building something for one architecture because we do not want to test it on any of the others.

Not sure if I get you right, but finally I think I should change the 
Config to make "go" compile for _all_ architectures supported by ipfire 
as node_exporter depends on it.

Kind regards

Holger

> 
> -Michael
> 
>>
>> ###############################################################################
>> # Top-level Rules
>> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
>>
>> $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
>>
>> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
>>
>> install : $(TARGET)
>>
>> -- 
>> 2.30.2
>>
>
Michael Tremer May 11, 2021, 9:53 a.m. UTC | #4
Hello,

> On 7 May 2021, at 19:19, Holger Sunke <holger.sunke@posteo.de> wrote:
> 
> Hello Michael,
> 
> 
> Am 07.05.21 um 13:28 schrieb Michael Tremer:
>> Hello Holger,
>> Thanks for this patch, but I am afraid it doesn’t do exactly what you intend to do.
>>> On 6 May 2021, at 20:46, Holger Sunke <holger.sunke@posteo.de> wrote:
>>> 
>>> ---
>>> lfs/Config | 4 ++++
>>> lfs/go     | 6 +++---
>>> 2 files changed, 7 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/lfs/Config b/lfs/Config
>>> index eadbbc408..4d0f2f00b 100644
>>> --- a/lfs/Config
>>> +++ b/lfs/Config
>>> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
>>> 	GOARCH = arm64
>>> endif
>>> 
>>> +ifeq "$(BUILD_ARCH)" "i586"
>>> +	GOARCH = 386
>>> +endif
>> This is fine.
>>> +
>>> ###############################################################################
>>> # Common Macro Definitions
>>> ###############################################################################
>>> diff --git a/lfs/go b/lfs/go
>>> index 6ebb37080..97effcb84 100644
>>> --- a/lfs/go
>>> +++ b/lfs/go
>>> @@ -28,10 +28,9 @@ VER        = 1.15.4
>>> 
>>> THISAPP    = go-$(VER)
>>> DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
>>> -DL_FROM    = $(URL_IPFIRE)
>>> +DL_FROM    = https://golang.org/dl/
>>> DIR_APP    = $(DIR_SRC)/go
>>> TARGET     = $(DIR_INFO)/$(THISAPP)
>>> -SUP_ARCH   = x86_64
>> This however enables Go for all architectures including aarch64 and armv5tel which is not what you intend.
>> The correct solution would be to add i586 to the list of supported architectures.
>> However, I would object to only add Go for i586 because you personally use IPFire on this architecture (please not Adolf’s remarks on our schedule to discontinue i586). We only build Go for x86_64 because the only package that uses it is the Amazon SSM agent which is not relevant on any other architecture. node_exporter seems to be a package that could in theory run on any architecture and I feel that we should not discriminate by only building something for one architecture because we do not want to test it on any of the others.
> 
> Not sure if I get you right, but finally I think I should change the Config to make "go" compile for _all_ architectures supported by ipfire as node_exporter depends on it.

Yes, that is correct. We aim to treat all architectures the same. Sometimes that isn’t possible, but that isn’t the case here.

Best,
-Michael

> 
> Kind regards
> 
> Holger
> 
>> -Michael
>>> 
>>> ###############################################################################
>>> # Top-level Rules
>>> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
>>> 
>>> $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
>>> 
>>> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
>>> 
>>> install : $(TARGET)
>>> 
>>> -- 
>>> 2.30.2
Holger Sunke May 21, 2021, 8:56 a.m. UTC | #5
Hello Michael,


Am 11.05.21 um 11:53 schrieb Michael Tremer:
> Hello,
> 
>> On 7 May 2021, at 19:19, Holger Sunke <holger.sunke@posteo.de> wrote:
>>
>> Hello Michael,
>>
>>
>> Am 07.05.21 um 13:28 schrieb Michael Tremer:
>>> Hello Holger,
>>> Thanks for this patch, but I am afraid it doesn’t do exactly what you intend to do.
>>>> On 6 May 2021, at 20:46, Holger Sunke <holger.sunke@posteo.de> wrote:
>>>>
>>>> ---
>>>> lfs/Config | 4 ++++
>>>> lfs/go     | 6 +++---
>>>> 2 files changed, 7 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/lfs/Config b/lfs/Config
>>>> index eadbbc408..4d0f2f00b 100644
>>>> --- a/lfs/Config
>>>> +++ b/lfs/Config
>>>> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
>>>> 	GOARCH = arm64
>>>> endif
>>>>
>>>> +ifeq "$(BUILD_ARCH)" "i586"
>>>> +	GOARCH = 386
>>>> +endif
>>> This is fine.
>>>> +
>>>> ###############################################################################
>>>> # Common Macro Definitions
>>>> ###############################################################################
>>>> diff --git a/lfs/go b/lfs/go
>>>> index 6ebb37080..97effcb84 100644
>>>> --- a/lfs/go
>>>> +++ b/lfs/go
>>>> @@ -28,10 +28,9 @@ VER        = 1.15.4
>>>>
>>>> THISAPP    = go-$(VER)
>>>> DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
>>>> -DL_FROM    = $(URL_IPFIRE)
>>>> +DL_FROM    = https://golang.org/dl/
>>>> DIR_APP    = $(DIR_SRC)/go
>>>> TARGET     = $(DIR_INFO)/$(THISAPP)
>>>> -SUP_ARCH   = x86_64
>>> This however enables Go for all architectures including aarch64 and armv5tel which is not what you intend.
>>> The correct solution would be to add i586 to the list of supported architectures.
>>> However, I would object to only add Go for i586 because you personally use IPFire on this architecture (please not Adolf’s remarks on our schedule to discontinue i586). We only build Go for x86_64 because the only package that uses it is the Amazon SSM agent which is not relevant on any other architecture. node_exporter seems to be a package that could in theory run on any architecture and I feel that we should not discriminate by only building something for one architecture because we do not want to test it on any of the others.
>>
>> Not sure if I get you right, but finally I think I should change the Config to make "go" compile for _all_ architectures supported by ipfire as node_exporter depends on it.
> 
> Yes, that is correct. We aim to treat all architectures the same. Sometimes that isn’t possible, but that isn’t the case here.
> 
> Best,
> -Michael
> 

Dou you have a list of all architectures supported by IPFire beyond 
i586(legacy), aarch64(=arm64?), x86_64 and arm?

Kind regards

Holger
>>
>>> -Michael
>>>>
>>>> ###############################################################################
>>>> # Top-level Rules
>>>> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
>>>>
>>>> $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
>>>>
>>>> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>>> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>>> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
>>>>
>>>> install : $(TARGET)
>>>>
>>>> -- 
>>>> 2.30.2
>
Michael Tremer May 21, 2021, 8:59 a.m. UTC | #6
Hello Holger,

> On 21 May 2021, at 09:56, Holger Sunke <holger.sunke@posteo.de> wrote:
> 
> Hello Michael,
> 
> 
> Am 11.05.21 um 11:53 schrieb Michael Tremer:
>> Hello,
>>> On 7 May 2021, at 19:19, Holger Sunke <holger.sunke@posteo.de> wrote:
>>> 
>>> Hello Michael,
>>> 
>>> 
>>> Am 07.05.21 um 13:28 schrieb Michael Tremer:
>>>> Hello Holger,
>>>> Thanks for this patch, but I am afraid it doesn’t do exactly what you intend to do.
>>>>> On 6 May 2021, at 20:46, Holger Sunke <holger.sunke@posteo.de> wrote:
>>>>> 
>>>>> ---
>>>>> lfs/Config | 4 ++++
>>>>> lfs/go     | 6 +++---
>>>>> 2 files changed, 7 insertions(+), 3 deletions(-)
>>>>> 
>>>>> diff --git a/lfs/Config b/lfs/Config
>>>>> index eadbbc408..4d0f2f00b 100644
>>>>> --- a/lfs/Config
>>>>> +++ b/lfs/Config
>>>>> @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64"
>>>>> 	GOARCH = arm64
>>>>> endif
>>>>> 
>>>>> +ifeq "$(BUILD_ARCH)" "i586"
>>>>> +	GOARCH = 386
>>>>> +endif
>>>> This is fine.
>>>>> +
>>>>> ###############################################################################
>>>>> # Common Macro Definitions
>>>>> ###############################################################################
>>>>> diff --git a/lfs/go b/lfs/go
>>>>> index 6ebb37080..97effcb84 100644
>>>>> --- a/lfs/go
>>>>> +++ b/lfs/go
>>>>> @@ -28,10 +28,9 @@ VER        = 1.15.4
>>>>> 
>>>>> THISAPP    = go-$(VER)
>>>>> DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
>>>>> -DL_FROM    = $(URL_IPFIRE)
>>>>> +DL_FROM    = https://golang.org/dl/
>>>>> DIR_APP    = $(DIR_SRC)/go
>>>>> TARGET     = $(DIR_INFO)/$(THISAPP)
>>>>> -SUP_ARCH   = x86_64
>>>> This however enables Go for all architectures including aarch64 and armv5tel which is not what you intend.
>>>> The correct solution would be to add i586 to the list of supported architectures.
>>>> However, I would object to only add Go for i586 because you personally use IPFire on this architecture (please not Adolf’s remarks on our schedule to discontinue i586). We only build Go for x86_64 because the only package that uses it is the Amazon SSM agent which is not relevant on any other architecture. node_exporter seems to be a package that could in theory run on any architecture and I feel that we should not discriminate by only building something for one architecture because we do not want to test it on any of the others.
>>> 
>>> Not sure if I get you right, but finally I think I should change the Config to make "go" compile for _all_ architectures supported by ipfire as node_exporter depends on it.
>> Yes, that is correct. We aim to treat all architectures the same. Sometimes that isn’t possible, but that isn’t the case here.
>> Best,
>> -Michael
> 
> Dou you have a list of all architectures supported by IPFire beyond i586(legacy), aarch64(=arm64?), x86_64 and arm?

We currently support these architectures:

* x86_64 which is our primary architecture with by far the most users on it

* aarch64

* i586 which is currently deprecated and will be dropped soon (https://blog.ipfire.org/post/new-year-more-bits)

* armv5tel - this might be tricky because we do not have any floating-point support. However, the kernel requires that which means that you will at least need an armv6l processor in order to run on this. Depending on what Go provides upstream, armv6l might be fine.

Best,
-Michael

> 
> Kind regards
> 
> Holger
>>> 
>>>> -Michael
>>>>> 
>>>>> ###############################################################################
>>>>> # Top-level Rules
>>>>> @@ -41,7 +40,8 @@ objects = $(DL_FILE)
>>>>> 
>>>>> $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
>>>>> 
>>>>> -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>>>> +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
>>>>> +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
>>>>> 
>>>>> install : $(TARGET)
>>>>> 
>>>>> -- 
>>>>> 2.30.2

Patch

diff --git a/lfs/Config b/lfs/Config
index eadbbc408..4d0f2f00b 100644
--- a/lfs/Config
+++ b/lfs/Config
@@ -138,6 +138,10 @@  ifeq "$(BUILD_ARCH)" "aarch64"
 	GOARCH = arm64
 endif
 
+ifeq "$(BUILD_ARCH)" "i586"
+	GOARCH = 386
+endif
+
 ###############################################################################
 # Common Macro Definitions
 ###############################################################################
diff --git a/lfs/go b/lfs/go
index 6ebb37080..97effcb84 100644
--- a/lfs/go
+++ b/lfs/go
@@ -28,10 +28,9 @@  VER        = 1.15.4
 
 THISAPP    = go-$(VER)
 DL_FILE    = go$(VER).$(GOOS)-$(GOARCH).tar.gz
-DL_FROM    = $(URL_IPFIRE)
+DL_FROM    = https://golang.org/dl/
 DIR_APP    = $(DIR_SRC)/go
 TARGET     = $(DIR_INFO)/$(THISAPP)
-SUP_ARCH   = x86_64
 
 ###############################################################################
 # Top-level Rules
@@ -41,7 +40,8 @@  objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
+go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d
+go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c
 
 install : $(TARGET)