Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM tool on Windows builds for Windows #237

Open
adam-bentley opened this issue May 14, 2023 · 1 comment
Open

RPM tool on Windows builds for Windows #237

adam-bentley opened this issue May 14, 2023 · 1 comment

Comments

@adam-bentley
Copy link

Hi,

I followed the steps in the README file for creating an RPM package on my Windows machine. By default when built on windows, the RPM tool builds the package for Windows, resulting in a .EXE file being produced. However, I need to build the package for Linux instead.

I have a console application written in dotnet that I want to package and distribute as an RPM package for Linux users. I installed the dotnet packaging application on my Windows machine and followed the steps in the README file, but I ended up with a package built for Windows, not Linux.

How can I change the default behavior of the RPM tool to build for Linux instead of Windows on my Windows machine?

Steps to Reproduce:

Create a console application in dotnet on a Windows machine.
Install the dotnet packaging application on the same Windows machine.
Follow the steps in the README file to create an RPM package using the dotnet packaging application.
Install the RPM package on a Linux machine.
Observe that the package is built for Windows, not Linux.
Expected behavior:
The RPM package should be built for Linux and should work when installed on a Linux machine.

Actual behavior:
The RPM package is built for Windows by default, resulting in a .EXE file being produced.

I tried setting the runtime identifier to linux-64, but it didn't work.

Environment:

Operating System: Windows
Console application created on: Windows machine
Additional Information:
I need to distribute my console application as an RPM package for Linux users, but the RPM tool on my Windows machine builds for Windows by default. I'm not sure how to change this behaviour and build the package for Linux instead. Any help would be appreciated.

@atauenis
Copy link

atauenis commented May 14, 2023

Correct cross-platform building requires a batch file, which will call build for every platform. Example:

csproj:

	<PropertyGroup>
		<Configurations>Debug;Release;ReleaseSC</Configurations>
		<RuntimeIdentifiers>win-x86;win-x64;win-arm;linux-x64;linux-arm;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
	</PropertyGroup>

Batch script:

dotnet restore
dotnet publish -c Release -r linux-x64
dotnet deb --no-restore -c Release -r linux-x64
dotnet rpm --no-restore -c Release -r linux-x64
dotnet publish -c ReleaseSC -r linux-arm
dotnet deb --no-restore -c ReleaseSC -r linux-arm
dotnet rpm --no-restore -c ReleaseSC -r linux-arm
dotnet publish -c ReleaseSC -r linux-arm64
dotnet deb --no-restore -c ReleaseSC -r linux-arm64
dotnet rpm --no-restore -c ReleaseSC -r linux-arm64
dotnet publish -c Release -r osx-x64
dotnet zip --no-restore -c Release -r osx-x64
dotnet publish -c Release -r osx-arm64
dotnet zip --no-restore -c Release -r osx-arm64
dotnet publish -c Release -r win-x86
dotnet zip --no-restore -c Release -r win-x86
dotnet zip --no-restore -c ReleaseSC -r win-x86
dotnet publish -c Release -r win-arm
dotnet zip --no-restore -c Release -r win-arm
dotnet publish -c Release -r win-x64
dotnet zip --no-restore -c Release -r win-x64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants