Skip to contentSkip to conversation

package/dotnet-sdk: new package

PATCH In review Raul Hidalgo Caballero 2 participants 3 messages Jan 13, 2021 – Jan 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/dotnet-sdk: new package

---
 DEVELOPERS                                    |  5 ++++
 package/Config.in.host                        |  1 +
 package/dotnet-sdk/dotnet-sdk.hash            |  3 ++
 package/dotnet-sdk/dotnet-sdk.mk              | 20 +++++++++++++
 package/dotnet/Config.in.host                 | 15 ++++++++++
 .../testing/tests/package/test_dotnet_sdk.py  | 28 +++++++++++++++++++
 6 files changed, 72 insertions(+)
 create mode 100644 package/dotnet-sdk/dotnet-sdk.hash
 create mode 100644 package/dotnet-sdk/dotnet-sdk.mk
 create mode 100644 package/dotnet/Config.in.host
 create mode 100644 support/testing/tests/package/test_dotnet_sdk.py
DEVELOPERS +5 -0
index 05b509c9c4..ea85f7c9c3 100644
@@ -2206,6 +2206,11 @@ F:	package/python-botocore/
 F:	package/python-jmespath/
 F:	package/python-s3transfer/
 
+N:	Raul Hidalgo Caballero <[email protected]>
+F:	package/dotnet/
+F:	package/dotnet-sdk/
+F:	support/testing/tests/package/test_dotnet_sdk.py
+
 N:	Refik Tuzakli <[email protected]>
 F:	package/freescale-imx/
 F:	package/paho-mqtt-cpp/
package/Config.in.host +1 -0
index ba6a68c728..16f0e9f690 100644
@@ -16,6 +16,7 @@ menu "Host utilities"
 	source "package/dfu-util/Config.in.host"
 	source "package/dos2unix/Config.in.host"
 	source "package/dosfstools/Config.in.host"
+	source "package/dotnet/Config.in.host"
 	source "package/doxygen/Config.in.host"
 	source "package/dtc/Config.in.host"
 	source "package/e2fsprogs/Config.in.host"
package/dotnet-sdk/dotnet-sdk.hash new file +3 -0
new file mode 100644
index 0000000000..a3016b2e49
@@ -0,0 +1,3 @@
+sha256  cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310  LICENSE.txt
+sha256  01564961f8ca9744d0ecc5d3e72d7c1659df95898f3a077fd9140fd4023f3579  ThirdPartyNotices.txt
+sha256  23df1eca7eb1302dfb10f4edce7edf7150e57698576f61b2dcb777c833cbd80c  dotnet-sdk-5.0.101-linux-x64.tar.gz
package/dotnet-sdk/dotnet-sdk.mk new file +20 -0
new file mode 100644
index 0000000000..133b39b3f5
@@ -0,0 +1,20 @@
+################################################################################
+#
+# dotnet-sdk
+#
+################################################################################
+
+HOST_DOTNET_SDK_VERSION = 5.0.101
+HOST_DOTNET_SDK_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/$(HOST_DOTNET_SDK_VERSION)
+HOST_DOTNET_SDK_SOURCE = dotnet-sdk-$(HOST_DOTNET_SDK_VERSION)-$(call qstrip,$(BR2_PACKAGE_HOST_DOTNET_RID)).tar.gz
+HOST_DOTNET_SDK_LICENSE = MIT
+HOST_DOTNET_SDK_LICENSE_FILES = LICENSE.txt ThirdPartyNotices.txt
+
+define HOST_DOTNET_SDK_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/usr/share/dotnet/
+	cp -dpfr $(@D)/* $(HOST_DIR)/usr/share/dotnet/
+	mkdir -p $(HOST_DIR)/usr/bin/
+	ln -s ../share/dotnet/dotnet $(HOST_DIR)/usr/bin/dotnet
+endef
+
+$(eval $(host-generic-package))
package/dotnet/Config.in.host new file +15 -0
new file mode 100644
index 0000000000..90b477a6a1
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_DOTNET_ARCH_SUPPORTS
+	bool
+	default y if BR2_HOSTARCH = "x86_64"
+
+config BR2_PACKAGE_HOST_DOTNET_RID
+	string
+	default "linux-x64" if BR2_HOSTARCH = "x86_64"
+
+config BR2_PACKAGE_HOST_DOTNET_SDK
+	bool "host dotnet-sdk"
+	depends on BR2_PACKAGE_HOST_DOTNET_ARCH_SUPPORTS
+	help
+		Dotnet SDK
+
+		https://dotnet.microsoft.com/
support/testing/tests/package/test_dotnet_sdk.py new file +28 -0
new file mode 100644
index 0000000000..288e873597
@@ -0,0 +1,28 @@
+import os
+import tempfile
+import subprocess
+import shutil
+
+import infra.basetest
+
+
+class TestDotnetSdkBase(infra.basetest.BRTest):
+
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_CPIO=y
+        """
+
+class TestHostDotnetSdk(TestDotnetSdkBase):
+    config = TestDotnetSdkBase.config + \
+        """
+        BR2_PACKAGE_HOST_DOTNET_SDK=y
+        """
+
+    def test_run(self):
+        env = os.environ.copy()
+        hostdir = os.path.join(self.builddir, 'host')
+        dotnet = os.path.join(hostdir, 'usr', 'bin', 'dotnet')
+        cmd = [dotnet, '--version']
+        exit_code = subprocess.call(cmd, stdout=self.b.logfile, stderr=self.b.logfile, env=env)
+        self.assertEqual(exit_code, 0)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 package/dotnet-sdk: new package

---
 package/dotnet/Config.in.host                    | 4 ++--
 support/testing/tests/package/test_dotnet_sdk.py | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
package/dotnet/Config.in.host +2 -2
index 90b477a6a1..e46d9ed42c 100644
@@ -10,6 +10,6 @@ config BR2_PACKAGE_HOST_DOTNET_SDK
 	bool "host dotnet-sdk"
 	depends on BR2_PACKAGE_HOST_DOTNET_ARCH_SUPPORTS
 	help
-		Dotnet SDK
+	  Dotnet SDK - Core functionality needed to compile .NET projects
 
-		https://dotnet.microsoft.com/
+	  https://dotnet.microsoft.com/
support/testing/tests/package/test_dotnet_sdk.py +0 -1
index 288e873597..df5d7871b0 100644
@@ -20,7 +20,6 @@ class TestHostDotnetSdk(TestDotnetSdkBase):
         """
 
     def test_run(self):
-        env = os.environ.copy()
         hostdir = os.path.join(self.builddir, 'host')
         dotnet = os.path.join(hostdir, 'usr', 'bin', 'dotnet')
         cmd = [dotnet, '--version']
Signature · 1 line
2.25.1
#2 lore raw
In reply to Raul Hidalgo Caballero

Hello Raul,

Your SoB line is missing.

It was present on your v1:
http://lists.busybox.net/pipermail/buildroot/2021-January/300681.html

Le 13/01/2021 à 08:46, Raul Hidalgo Caballero a écrit :

Quoted 34 lines
---
 DEVELOPERS                                    |  5 ++++
 package/Config.in.host                        |  1 +
 package/dotnet-sdk/dotnet-sdk.hash            |  3 ++
 package/dotnet-sdk/dotnet-sdk.mk              | 20 +++++++++++++
 package/dotnet/Config.in.host                 | 15 ++++++++++
 .../testing/tests/package/test_dotnet_sdk.py  | 28 +++++++++++++++++++
 6 files changed, 72 insertions(+)
 create mode 100644 package/dotnet-sdk/dotnet-sdk.hash
 create mode 100644 package/dotnet-sdk/dotnet-sdk.mk
 create mode 100644 package/dotnet/Config.in.host
 create mode 100644 support/testing/tests/package/test_dotnet_sdk.py
DEVELOPERS +5 -0
index 05b509c9c4..ea85f7c9c3 100644
@@ -2206,6 +2206,11 @@ F:	package/python-botocore/
 F:	package/python-jmespath/
 F:	package/python-s3transfer/
 
+N:	Raul Hidalgo Caballero <[email protected]>
+F:	package/dotnet/
+F:	package/dotnet-sdk/
+F:	support/testing/tests/package/test_dotnet_sdk.py
+
 N:	Refik Tuzakli <[email protected]>
 F:	package/freescale-imx/
 F:	package/paho-mqtt-cpp/
package/Config.in.host +0 -0
index ba6a68c728..16f0e9f690 100644

package/Config.in.host menu "Host utilities" · line 19

Quoted 4 lines
package/Config.in.host +1 -0
@@ -16,6 +16,7 @@ menu "Host utilities"
 	source "package/dfu-util/Config.in.host"
 	source "package/dos2unix/Config.in.host"
 	source "package/dosfstools/Config.in.host"
+	source "package/dotnet/Config.in.host"

Must be "dotnet-sdk" here.

Quoted 25 lines
package/Config.in.host +0 -0
 	source "package/doxygen/Config.in.host"
 	source "package/dtc/Config.in.host"
 	source "package/e2fsprogs/Config.in.host"
package/dotnet-sdk/dotnet-sdk.hash new file +3 -0
new file mode 100644
index 0000000000..a3016b2e49
@@ -0,0 +1,3 @@
+sha256  cfc21f5e8bd655ae997eec916138b707b1d290b83272c02a95c9f821b8c87310  LICENSE.txt
+sha256  01564961f8ca9744d0ecc5d3e72d7c1659df95898f3a077fd9140fd4023f3579  ThirdPartyNotices.txt
+sha256  23df1eca7eb1302dfb10f4edce7edf7150e57698576f61b2dcb777c833cbd80c  dotnet-sdk-5.0.101-linux-x64.tar.gz
package/dotnet-sdk/dotnet-sdk.mk new file +7 -0
new file mode 100644
index 0000000000..133b39b3f5
@@ -0,0 +1,20 @@
+################################################################################
+#
+# dotnet-sdk
+#
+################################################################################
+
+HOST_DOTNET_SDK_VERSION = 5.0.101

package/dotnet-sdk/dotnet-sdk.mk line 17

Quoted 10 lines
package/dotnet-sdk/dotnet-sdk.mk new file +10 -0
+HOST_DOTNET_SDK_SITE = https://dotnetcli.azureedge.net/dotnet/Sdk/$(HOST_DOTNET_SDK_VERSION)
+HOST_DOTNET_SDK_SOURCE = dotnet-sdk-$(HOST_DOTNET_SDK_VERSION)-$(call qstrip,$(BR2_PACKAGE_HOST_DOTNET_RID)).tar.gz
+HOST_DOTNET_SDK_LICENSE = MIT
+HOST_DOTNET_SDK_LICENSE_FILES = LICENSE.txt ThirdPartyNotices.txt
+
+define HOST_DOTNET_SDK_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/usr/share/dotnet/
+	cp -dpfr $(@D)/* $(HOST_DIR)/usr/share/dotnet/
+	mkdir -p $(HOST_DIR)/usr/bin/
+	ln -s ../share/dotnet/dotnet $(HOST_DIR)/usr/bin/dotnet

The dotnet is a binary blob, there is no sources for it ?

Quoted 14 lines
package/dotnet-sdk/dotnet-sdk.mk new file +3 -0
+endef
+
+$(eval $(host-generic-package))
package/dotnet/Config.in.host new file +5 -0
new file mode 100644
index 0000000000..90b477a6a1
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_DOTNET_ARCH_SUPPORTS
+	bool
+	default y if BR2_HOSTARCH = "x86_64"
+
+config BR2_PACKAGE_HOST_DOTNET_RID

package/dotnet/Config.in.host line 15

Quoted 10 lines
package/dotnet/Config.in.host new file +10 -0
+	string
+	default "linux-x64" if BR2_HOSTARCH = "x86_64"
+
+config BR2_PACKAGE_HOST_DOTNET_SDK
+	bool "host dotnet-sdk"
+	depends on BR2_PACKAGE_HOST_DOTNET_ARCH_SUPPORTS
+	help
+		Dotnet SDK
+
+		https://dotnet.microsoft.com/

Indent the help text with on tab and two spaces.

You can check the coding style with ./utils/check-package script

Quoted 19 lines
support/testing/tests/package/test_dotnet_sdk.py new file +13 -0
new file mode 100644
index 0000000000..288e873597
@@ -0,0 +1,28 @@
+import os
+import tempfile
+import subprocess
+import shutil
+
+import infra.basetest
+
+
+class TestDotnetSdkBase(infra.basetest.BRTest):
+
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_CPIO=y

support/testing/tests/package/test_dotnet_sdk.py line 23

Quoted 10 lines
support/testing/tests/package/test_dotnet_sdk.py new file +10 -0
+        """
+
+class TestHostDotnetSdk(TestDotnetSdkBase):
+    config = TestDotnetSdkBase.config + \
+        """
+        BR2_PACKAGE_HOST_DOTNET_SDK=y
+        """
+
+    def test_run(self):
+        env = os.environ.copy()

You second patch remove this line [1].

Squash you two patch into one.

support/testing/tests/package/test_dotnet_sdk.py line 26

Quoted 3 lines
support/testing/tests/package/test_dotnet_sdk.py new file +3 -0
+        hostdir = os.path.join(self.builddir, 'host')
+        dotnet = os.path.join(hostdir, 'usr', 'bin', 'dotnet')
+        cmd = [dotnet, '--version']

Running "dotnet --version" on the host is really worth it ?

Have you made some progress on dotnet-runtime and dotnet-aspnet [2]

I have marked your patches as "Changes Requested".

[1]
http://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[2] http://lists.busybox.net/pipermail/buildroot/2021-January/603271.html

Best regards,
Romain

support/testing/tests/package/test_dotnet_sdk.py line 28

Quoted 3 lines
support/testing/tests/package/test_dotnet_sdk.py new file +2 -0
+        exit_code = subprocess.call(cmd, stdout=self.b.logfile, stderr=self.b.logfile, env=env)
+        self.assertEqual(exit_code, 0)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot