From 05404397b79b46e121f62eaaea11d416e48cf616 Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 15:57:02 +0100 Subject: [PATCH 1/7] fix(startup): prevent Linux crash by making EditMenu macOS-only EditMenu is a macOS-only feature that enables standard shortcuts (Cmd+C, Cmd+V, Cmd+Z). Appending it on Linux causes the app to crash. Added platform check to conditionally append EditMenu only on darwin, as recommended in the Wails documentation. See: https://wails.io/docs/reference/menus/ --- app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index 660cf39..50c5e35 100644 --- a/app.go +++ b/app.go @@ -120,8 +120,6 @@ func (a *App) initializeMenu() { globalShortcuts := groupedShortcuts[entities.GroupGlobal] viewShortcuts := groupedShortcuts[entities.GroupView] - AppMenu.Append(menu.EditMenu()) - // Add custom global shortcuts to File menu FileMenu := AppMenu.AddSubmenu("File") for _, shortcut := range globalShortcuts { @@ -168,6 +166,10 @@ func (a *App) initializeMenu() { runtime.EventsEmit(a.ctx, string(entities.ActionShowKeyboardShortcutsModal)) }) + if env := runtime.Environment(a.ctx); env.Platform == "darwin" { + AppMenu.Append(menu.EditMenu()) + } + runtime.MenuSetApplicationMenu(a.ctx, AppMenu) } From cb3c8f8a6cfbf5b4d5577dc099aa00d3d41ab0bb Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 16:02:32 +0100 Subject: [PATCH 2/7] feat: add build_webkit41 Makefile target Added build_webkit41 target to Makefile for Ubuntu 24.04+ and Debian 13+ support, which require the -tags webkit2_41 flag due to webkit2gtk-4.1. See: https://wails.io/docs/gettingstarted/building --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index cbab48f..57f0f7f 100644 --- a/Makefile +++ b/Makefile @@ -72,3 +72,7 @@ build_macos: clean cp_assets ## Build the application image for macOS @echo "Building application image for macOS..." @wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=$(VERSION)" -platform darwin/universal -o "$(APP_NAME)" @echo "Build completed. Result: $(APP_BUNDLE)" + +build_webkit41: clean cp_assets ## Build the application image for Ubuntu 24.04+/Debian 13+ (webkit 4.1) + @echo "Building application image with webkit2_41 tags..." + @wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=$(VERSION)" -tags webkit2_41 From 69d6343e190c288104fa745bb060608c4e921fc1 Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 16:23:54 +0100 Subject: [PATCH 3/7] fix(makefile): allow numeric characters in Makefile help target regex --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 57f0f7f..7fca5c7 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ export GOTOOLCHAIN=go1.23.0 .DEFAULT_GOAL := help help: ## Show available commands - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) clean: ## Clean all build data @echo "Removing build data..." From c95b0c29a9d5659f7dbe52cc3b03333fb0fc747a Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 16:26:07 +0100 Subject: [PATCH 4/7] feat(ci): add Linux matrix builds for webkit 4.0 and 4.1 support --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7010cd..056d352 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -185,8 +185,21 @@ jobs: dist/*.zip build_linux: - name: Build for Linux - runs-on: ubuntu-22.04 + name: Build for Linux (${{ matrix.variant }}) + runs-on: ${{ matrix.runs_on }} + strategy: + matrix: + include: + - variant: webkit40 + runs_on: ubuntu-22.04 + build_target: build + output_suffix: linux-amd64 + webkit_package: libwebkit2gtk-4.0-dev + - variant: webkit41 + runs_on: ubuntu-24.04 + build_target: build_webkit41 + output_suffix: linux-amd64-webkit41 + webkit_package: libwebkit2gtk-4.1-dev steps: - name: Checkout @@ -215,7 +228,7 @@ jobs: # Install Linux Wails deps - name: Install Linux Wails deps - run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu + run: sudo apt-get update && sudo apt-get install libgtk-3-0 ${{ matrix.webkit_package }} gcc-aarch64-linux-gnu shell: bash # Build @@ -226,25 +239,25 @@ jobs: - name: Build App run: | - make cp_assets - wails build -ldflags "-X github.com/scanoss/scanoss.cc/backend/entities.AppVersion=${{ env.APP_VERSION }}" --platform linux/amd64 -o "${{ env.ARTIFACT_NAME_PREFIX }}-linux" + make ${{ matrix.build_target }} + mv build/bin/${{ env.ARTIFACT_NAME_PREFIX }} build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }} shell: bash - name: Make binary executable - run: chmod +x "./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-linux" + run: chmod +x "./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}" shell: bash - name: Create ZIP file run: | cd ./build/bin - zip -r "${{ env.ARTIFACT_NAME_PREFIX }}-linux.zip" "${{ env.ARTIFACT_NAME_PREFIX }}-linux" + zip -r "${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}.zip" "${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}" shell: bash - name: Upload build assets uses: actions/upload-artifact@v4 with: - name: artifact_l - path: ./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-linux.zip + name: artifact_l_${{ matrix.variant }} + path: ./build/bin/${{ env.ARTIFACT_NAME_PREFIX }}-${{ matrix.output_suffix }}.zip build_w: name: Build for Windows @@ -358,10 +371,15 @@ jobs: with: name: artifact_m - - name: Download artifact L + - name: Download artifact L (webkit 4.0) + uses: actions/download-artifact@v4 + with: + name: artifact_l_webkit40 + + - name: Download artifact L (webkit 4.1) uses: actions/download-artifact@v4 with: - name: artifact_l + name: artifact_l_webkit41 - name: Generate SHA256 Checksums run: | From 64963cea5ba0da82750c8924a2bc781feae9d047 Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 16:36:12 +0100 Subject: [PATCH 5/7] chore(docs): update README and INSTALLATION for webkit 4.0/4.1 support --- INSTALLATION.md | 41 +++++++++++++++++++++++++-------- README.md | 61 ++++++++++++++++++++++++++++++++++--------------- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 0312462..2732e81 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -217,22 +217,41 @@ The script automatically: ### Manual Installation -#### All Distributions +#### Choosing the Right Binary + +SCANOSS Code Compare provides two Linux binaries to support different WebKit versions: + +- **Ubuntu 24.04+ / Debian 13+**: Download `scanoss-cc-linux-amd64-webkit41.zip` +- **All other systems**: Download `scanoss-cc-linux-amd64.zip` + +#### Installation Steps + +1. Download the appropriate binary for your system from [releases](https://github.com/scanoss/scanoss.cc/releases) -1. Download `scanoss-cc-linux.zip` from [releases](https://github.com/scanoss/scanoss.cc/releases) 2. Extract and install: +**For Ubuntu 22.04 and older / Debian 12 and older:** +```bash +unzip scanoss-cc-linux-amd64.zip +sudo mv scanoss-cc-linux-amd64 /usr/local/bin/scanoss-cc +``` + +**For Ubuntu 24.04+ / Debian 13+:** ```bash -unzip scanoss-cc-linux.zip -chmod +x scanoss-cc-linux -sudo mv scanoss-cc-linux /usr/local/bin/scanoss-cc +unzip scanoss-cc-linux-amd64-webkit41.zip +sudo mv scanoss-cc-linux-amd64-webkit41 /usr/local/bin/scanoss-cc ``` 3. Install dependencies based on your distribution: -**Debian/Ubuntu:** +**Debian/Ubuntu (22.04 and older):** ```bash -sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37 +sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0 +``` + +**Debian/Ubuntu (24.04+ / Debian 13+):** +```bash +sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0 ``` **Fedora/RHEL:** @@ -422,11 +441,15 @@ $env:Path -split ';' | Select-String SCANOSS **Issue:** Missing GTK/WebKit dependencies -**Solution:** Install required libraries: +**Solution:** Install required libraries based on your OS version: + ```bash -# Debian/Ubuntu +# Ubuntu 22.04 and older / Debian 12 and older sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37 +# Ubuntu 24.04+ / Debian 13+ +sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0 + # Fedora sudo dnf install gtk3 webkit2gtk4.0 diff --git a/README.md b/README.md index 421cec8..c78f4c6 100644 --- a/README.md +++ b/README.md @@ -79,12 +79,19 @@ See [INSTALLATION.md](INSTALLATION.md) for PATH setup and installation to Progra
Linux -1. Download `scanoss-cc-linux.zip` from the [releases page](https://github.com/scanoss/scanoss.cc/releases) -2. Extract and run: +Choose the appropriate binary for your system from the [releases page](https://github.com/scanoss/scanoss.cc/releases): +- **Ubuntu 22.04 and older / Debian 12 and older**: [scanoss-cc-linux-amd64.zip](https://github.com/scanoss/scanoss.cc/releases/latest/download/scanoss-cc-linux-amd64.zip) +- **Ubuntu 24.04+ / Debian 13+**: [scanoss-cc-linux-amd64-webkit41.zip](https://github.com/scanoss/scanoss.cc/releases/latest/download/scanoss-cc-linux-amd64-webkit41.zip) + +Extract and run: ```bash -unzip scanoss-cc-linux.zip -chmod +x scanoss-cc-linux -sudo mv scanoss-cc-linux /usr/local/bin/scanoss-cc +# For Ubuntu 22.04 and older +unzip scanoss-cc-linux-amd64.zip +sudo mv scanoss-cc-linux-amd64 /usr/local/bin/scanoss-cc + +# For Ubuntu 24.04+ (webkit 4.1) +unzip scanoss-cc-linux-amd64-webkit41.zip +sudo mv scanoss-cc-linux-amd64-webkit41 /usr/local/bin/scanoss-cc ``` See [INSTALLATION.md](INSTALLATION.md) for detailed instructions. @@ -143,6 +150,32 @@ scanoss-cc scan . --key $SCANOSS_API_KEY --apiurl $SCANOSS_API_URL --debug ## Development +### Dependencies + +Before setting up the development environment, ensure you have the following dependencies installed: + +**Prerequisites:** +- Go 1.23+ +- Node.js and npm + +**System Dependencies (Debian/Ubuntu):** + +For Ubuntu 22.04 and older: +```bash +sudo apt-get update +sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.0-dev +``` + +For Ubuntu 24.04+ / Debian 13+: +```bash +sudo apt-get update +sudo apt-get install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev +``` + +**Install Wails CLI:** +```bash +go install github.com/wailsapp/wails/v2/cmd/wails@latest +``` ### Setting Up the Development Environment 1. Clone the repository: @@ -182,22 +215,12 @@ wails dev -appargs "--input " make build ``` -### Known Issues - -#### Ubuntu 24.04 WebKit Issue +### Building for Different Linux Versions -Ubuntu 24.04 includes webkit 4.1 while Wails expects webkit 4.0. To resolve: +SCANOSS Code Compare provides two Linux build variants to support different WebKit versions: -For production: -```bash -sudo ln -sf /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37 && -sudo ln -sf /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so.0 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so.18 -``` - -For development: -```bash -wails dev -tags webkit2_41 -``` +- Use `make build` for Ubuntu 22.04 and older (WebKit 4.0) +- Use `make build_webkit41` for Ubuntu 24.04+/Debian 13+ (WebKit 4.1) ## Contributing From e28280498c5415ace1ac96bdd42a99911f38aedc Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 16:59:26 +0100 Subject: [PATCH 6/7] chore(changelog): update for v0.9.3 release with new features and fixes --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd6f71..4836785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.3] 2025-11-05 +### Added +- Add `build_webkit41` Makefile target for Ubuntu 24.04+ and Debian 13+ support +- Add Linux matrix builds for webkit 4.0 and 4.1 support in CI + +### Fixed +- Fix Linux startup crash by making EditMenu macOS-only + +### Changed +- Update README and INSTALLATION documentation for webkit 4.0/4.1 support + ## [0.9.2] 2025-11-04 ### Added - Add uninstall instructions to `INSTALLATION.md` @@ -175,3 +186,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [0.9.0]: https://github.com/scanoss/scanoss.cc/compare/v0.8.1...v0.9.0 [0.9.1]: https://github.com/scanoss/scanoss.cc/compare/v0.9.0...v0.9.1 [0.9.2]: https://github.com/scanoss/scanoss.cc/compare/v0.9.1...v0.9.2 +[0.9.3]: https://github.com/scanoss/scanoss.cc/compare/v0.9.2...v0.9.3 From 4b75e97ff08f6976f1604530fa959564b6670332 Mon Sep 17 00:00:00 2001 From: Agustin Isasmendi Date: Wed, 5 Nov 2025 17:15:56 +0100 Subject: [PATCH 7/7] chore(docs): correct webkit package version in INSTALLATION.md for Debian/Ubuntu 22.04 and older --- INSTALLATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 2732e81..6f2efb7 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -246,7 +246,7 @@ sudo mv scanoss-cc-linux-amd64-webkit41 /usr/local/bin/scanoss-cc **Debian/Ubuntu (22.04 and older):** ```bash -sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0 +sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37 ``` **Debian/Ubuntu (24.04+ / Debian 13+):**