usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.29k stars 1.25k forks source link

RPM build failed #1368

Open halshar opened 10 months ago

halshar commented 10 months ago

Greetings,

Followed the below instructions by user manoj to build the rpm package

git clone https://github.com/usebruno/bruno.git
cd bruno
npm install
npm run build:electron:rpm
cd packages/bruno-electron/out
dnf install bruno_0.24.0_x86_64_linux.rpm

Originally posted by @manojbaishya in https://github.com/usebruno/bruno/issues/541#issuecomment-1762750241

but the build is failing with following errors


❯ npm run build:electron:rpm

> build:electron:rpm
> ./scripts/build-electron.sh rpm

cp: cannot stat 'packages/bruno-app/out/*': No such file or directory
sed: can't read packages/bruno-electron/web/**.html: No such file or directory
Building rpm distribution

> bruno@v1.6.1 dist:rpm
> electron-builder --linux rpm --config electron-builder-config.js

  • electron-builder  version=23.0.2 os=6.6.9-200.fc39.x86_64
  • loaded configuration  file=/home/samshal/projects/github/javascript/bruno/packages/bruno-electron/electron-builder-config.js
  • writing effective config  file=out/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=21.1.1 appOutDir=out/linux-unpacked
  • building        target=rpm arch=x64 file=out/bruno_1.6.1_x86_64_linux.rpm
  ⨯ to build rpm, executable rpmbuild is required, please install: sudo apt-get install rpm
  ⨯ /home/samshal/projects/github/javascript/bruno/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: /home/samshal/projects/github/javascript/bruno/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/samshal/projects/github/javascript/bruno/node_modules/builder-util/src/util.ts:250:14)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! Lifecycle script `dist:rpm` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: bruno@v1.6.1
npm ERR!   at location: /home/samshal/projects/github/javascript/bruno/packages/bruno-electron

from the script scripts/build-electron.sh lines 12-16 are failing as the directories packages/bruno-app/out/ and packages/bruno-electron/web are not present

# Copy build
cp -r packages/bruno-app/out/* packages/bruno-electron/web

# Change paths in next
sed -i'' -e 's@/_next/@_next/@g' packages/bruno-electron/web/**.html

# Errors
cp: cannot stat 'packages/bruno-app/out/*': No such file or directory
sed: can't read packages/bruno-electron/web/**.html: No such file or directory

the same error occurs while building for latest commit as well as source code for v1.6.1

Am I missing some intermediate build steps where the files inside packages/bruno-app/out/ will be created?

helloanoop commented 10 months ago

@halshar

While we await the fix for the rpm build, just letting you know that we recently released support for installing Bruno via flatpak #623

halshar commented 10 months ago

Thank you, I was not aware of the flatpak support; I had assumed that only snaps support was available.

Will this issue be closed, or will it be used to update progress on the RPM build and eventually be closed once the issue is fixed?

helloanoop commented 10 months ago

Lets keep this open until we have rpm builds available.

brunohpaiva commented 9 months ago

Right now the build system is a bit confusing, I got the same error some time ago.

To build the RPM package first you need to build the NextJS app in packages/bruno-app, you can use the build:web NPM script in the root package.json for that.

I usually use this shell script:

git clone https://github.com/usebruno/bruno.git usebruno-monorepo
cd usebruno-monorepo

# checkouts the latest stable version (at the time of writing).
# you can skip this following command to build directly from the `main` branch
git checkout v1.7.0

# ensure you are using the required Node version defined in the `.nvmrc` file
# at the time of writing it is Node v18.13.0
node --version

# installs dependencies from the lockfile, you can use `npm install` too
npm ci

# these three following commands are documented in the `contributing.md` file
npm run build:graphql-docs
npm run build:bruno-query
npm run build:bruno-common

# builds the NextJS app
# the ENV environment variable:
# prod - telemetry enabled, redux debug middleware disabled
# dev  - telemetry disabled, redux debug middleware enabled
ENV=prod npm run build:web

# builds the RPM package
npm run build:electron:rpm

# installs the RPM package, you may need to use `sudo` here
dnf install packages/bruno-electron/out/*.rpm
guzman109 commented 5 months ago

unfortunately its not working