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

Cant generate a single universal build #238

Open
andirsun opened this issue Aug 9, 2023 · 3 comments
Open

Cant generate a single universal build #238

andirsun opened this issue Aug 9, 2023 · 3 comments

Comments

@andirsun
Copy link
Contributor

andirsun commented Aug 9, 2023

Describe the bug
A clear and concise description of what the bug is.
I am trying to generate a single universal build for my application, I can do it with electron builder configuration but since I am using the nx-electron plugin and maker.options.json for some reason two builds are generated:

  • mac-arm64
  • mac-universal
    I only need to generate universal architecture because for this reason the compilation process is taking almost double the time signing and notarizing both architectures.

This is my maker.options.json file

{
  "$schema": "../../../../../node_modules/nx-electron/src/validation/maker.schema.json",
  "asar": true,
  "generateUpdatesFilesForAllChannels": true,
  "appId": "com.webalys.streamline",
  "productName": "Streamline",
  "copyright": "Copyright © 2023 Webalys",
  "afterSign": "apps/streamline-desktop/src/utils/notarize.js",
  "artifactName": "${productName}.${ext}",
  "protocols": [
    {
      "name": "electron-deep-linking",
      "schemes": ["streamline"]
    }
  ],
  "mac": {
    "icon": "apps/streamline-desktop/src/assets/icons/icon.icns",
    "hardenedRuntime": true,
    "entitlements": "apps/streamline-desktop/src/utils/entitlements.mac.inherit.plist",
    "category": "public.app-category.utilities",
    "singleArchFiles": "*",
    "target": [
      {
        "target": "dmg",
        "arch": ["universal"]
      }
    ]
  },
  "dmg": {
    "backgroundColor": "#ffffff",
    "writeUpdateInfo": false,
    "window": {
      "width": 400,
      "height": 300
    },
    "contents": [
      {
        "x": 100,
        "y": 100
      },
      {
        "x": 300,
        "y": 100,
        "type": "link",
        "path": "/Applications"
      }
    ]
  },
  "publish": [
    {
      "provider": "github",
      "releaseType": "release"
    }
  ]
}

And this is the build process.

❯ npm run pack:desktop  

> streamline-mono@5.0.0 pack:desktop
> nx run streamline-desktop:make --publishPolicy=never


> nx run streamline-desktop:make --publishPolicy=never

*********************************************************
DO NOT FORGET TO REBUILD YOUR FRONTEND & BACKEND PROJECTS
FOR PRODUCTION BEFORE PACKAGING / MAKING YOUR ARTIFACT!
*********************************************************
  • electron-builder  version=23.6.0 os=23.0.0
  • writing effective config  file=dist/executables/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=@parcel/watcher@2.0.4 platform=darwin arch=arm64
  • packaging       platform=darwin arch=arm64 electron=25.2.0 appOutDir=dist/executables/mac-arm64
  • signing         file=dist/executables/mac-arm64/Streamline.app identityName=Developer ID Application: Webalys, LLC (U7XNJG59LL) identityHash=D67BA83C59353EA2BB7501103EB25119DCBDF921 provisioningProfile=none
⏭️ Skipping notarization: PRODUCTION enviroment is needed
  • building        target=macOS zip arch=arm64 file=dist/executables/Streamline.zip
  • building        target=DMG arch=arm64 file=dist/executables/Streamline.dmg
  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
  • rebuilding native dependencies  dependencies=@parcel/watcher@2.0.4 platform=darwin arch=x64
  • packaging       platform=darwin arch=x64 electron=25.2.0 appOutDir=dist/executables/mac-universal--x64
  • rebuilding native dependencies  dependencies=@parcel/watcher@2.0.4 platform=darwin arch=arm64
  • packaging       platform=darwin arch=arm64 electron=25.2.0 appOutDir=dist/executables/mac-universal--arm64
  • packaging       platform=darwin arch=universal electron=25.2.0 appOutDir=dist/executables/mac-universal
  • signing         file=dist/executables/mac-universal/Streamline.app identityName=Developer ID Application: Webalys, LLC (U7XNJG59LL) identityHash=D67BA83C59353EA2BB7501103EB25119DCBDF921 provisioningProfile=none
⏭️ Skipping notarization: PRODUCTION enviroment is needed
  • building        target=DMG arch=universal file=dist/executables/Streamline.dmg
  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
  • building block map  blockMapFile=dist/executables/Streamline.zip.blockmap

 ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Successfully ran target make for project streamline-desktop (7m)
 
         With additional flags:
           --publishPolicy=never
 

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I dont need to always generate arm64 builds

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Mac Os
  • Nx Electron Version [e.g. 8.0.0] ^15.0.0

Additional context
Add any other context about the problem here.

@andirsun andirsun changed the title Cant generate only a single universal build Cant generate a single universal build Oct 30, 2023
@ja-klaudiusz
Copy link

ja-klaudiusz commented Jan 4, 2024

Did you manage to figure out how to generate this build? I am trying to generate a .dmg file, but only a .app file is being generated.

maker.options.json:

 {
 "dmg": {
    "window": {
      "width": 660,
      "height": 400
    },
    "contents": [
      {
        "x": 110,
        "y": 150
      },
      {
        "x": 240,
        "y": 150,
        "type": "link",
        "path": "/Applications"
      }
    ]
  },
  "mac": {
    "category": "public.app-category.social-networking",
    "icon": "apps/desktop/src/app/options/resources/icon.icns",
    "target": ["zip", "dmg"],
    "minimumSystemVersion": "10.10",
    "hardenedRuntime": true,
    "entitlements": "apps/desktop/entitlements.plist",
    "entitlementsInherit": "apps/desktop/entitlementsInherit.plist"
  }
}

and my commands:

nx build desktop-client 
nx build desktop
nx run desktop:package

Desktop:

OS: Mac Os 14
Nx Electron Version ^17.0.1

@andirsun
Copy link
Contributor Author

andirsun commented Jan 5, 2024

@ja-klaudiusz Did you try using :make instead of package ?

@ja-klaudiusz
Copy link

@andirsun Yes, I tried. But either I didn't notice that it goes into /dist/executables or it wasn't working before the Xcode update... Anyway, after updating Xcode, make: actually works.

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