RPM tool on Windows builds for Windows #134

Open
opened 2026-01-29 16:30:20 +00:00 by claunia · 1 comment
Owner

Originally created by @adam-bentley on GitHub (May 14, 2023).

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.

Originally created by @adam-bentley on GitHub (May 14, 2023). 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.
Author
Owner

@atauenis commented on GitHub (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
@atauenis commented on GitHub (May 14, 2023): Correct cross-platform building requires a batch file, which will call build for every platform. Example: csproj: ```XML <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: ```BAT 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#134