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

ffsync: Update to syncstorage-rs #5942

Merged
merged 55 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
00a5b9d
Initial file reorganisation
mreid-tt Nov 26, 2023
cdbc21b
Include syncstorage-rs source
mreid-tt Nov 26, 2023
f016cfa
Migrate service scripts
mreid-tt Nov 27, 2023
4e5b5a6
Fix repo download path
mreid-tt Nov 27, 2023
8e9f713
Fix package name
mreid-tt Nov 27, 2023
16da8d9
Fix rust build args
mreid-tt Nov 27, 2023
4d86ff5
Amend rust build args
mreid-tt Nov 28, 2023
05adf10
Alternate fix for rust build args
mreid-tt Nov 28, 2023
167cafb
Initial fixes from review
mreid-tt Nov 28, 2023
988f41d
Split up wheels requirements
mreid-tt Nov 28, 2023
e639974
Fix wheels requirements
mreid-tt Nov 28, 2023
3175be5
Amend wheels requirements fix
mreid-tt Nov 28, 2023
0a6ff26
Framework: Add rust build args
mreid-tt Nov 29, 2023
1cd0026
Optimise python build
mreid-tt Nov 30, 2023
d092988
Testing build without rustc wheel directive
mreid-tt Nov 30, 2023
e8aab6b
Version bump and fixes for build
mreid-tt Nov 30, 2023
dbe9e55
Additional fixes for build
mreid-tt Nov 30, 2023
5ae59a9
Fixes for scripts and build
mreid-tt Dec 1, 2023
94bd900
Add password validation to wizards
mreid-tt Dec 1, 2023
18bf9f6
Testing build with self-contained dependencies
mreid-tt Dec 1, 2023
9d9b038
Update cross/syncstorage-rs/Makefile
hgy59 Dec 1, 2023
8f1e577
Remove duplicate ENV assignment
mreid-tt Dec 1, 2023
baecf94
Fix for mysqlclient dependencies
mreid-tt Dec 1, 2023
0926673
Amend fix for mysqlclient dependencies
mreid-tt Dec 1, 2023
dbe934c
add cross/diesel
hgy59 Dec 1, 2023
a4af41d
Minor fixes
mreid-tt Dec 1, 2023
318cdcb
cross/syncstorage-rs: fix build linker flags
hgy59 Dec 1, 2023
d318145
spk/ffsync: fix cross build of cryptography and library path
hgy59 Dec 1, 2023
4e8141c
ffsync: improve package installation
hgy59 Dec 1, 2023
640c611
Merge branch 'ffsync-update' of https://github.com/mreid-tt/spksrc in…
hgy59 Dec 1, 2023
027c038
service-setup: cleanup merge errors, provide tools and merge resources
hgy59 Dec 2, 2023
3915e90
Additional fixes
mreid-tt Dec 2, 2023
6dd3e83
Fix for build exclusions and uninstall
mreid-tt Dec 2, 2023
59a2238
Amendments to fixes
mreid-tt Dec 2, 2023
654e0b3
Amendments to fixes
mreid-tt Dec 2, 2023
81ec41c
Incorporating build suggestions
mreid-tt Dec 2, 2023
2aa2dd6
Testing build options
mreid-tt Dec 2, 2023
fc78bea
configure default mysql socket
hgy59 Dec 2, 2023
4445ad3
ffsync: use prebuilt python again and fix dependencies
hgy59 Dec 2, 2023
ebcf6de
fix host configuration
hgy59 Dec 2, 2023
a65b8b7
fix service-setup
hgy59 Dec 2, 2023
c9cef22
try to fix greenlet requirement
hgy59 Dec 2, 2023
65f37a5
fix mysql socket definition
hgy59 Dec 3, 2023
51f1647
fix secret generation for DSM 6
hgy59 Dec 3, 2023
aa24968
Fixes proposed after review
mreid-tt Dec 3, 2023
e4b972a
Final code cleanup
mreid-tt Dec 4, 2023
40f2b95
Amend code cleanup
mreid-tt Dec 4, 2023
0f59f43
Fix wizard grammar
mreid-tt Dec 4, 2023
f37ece2
Make clientUrl dynamic
mreid-tt Dec 4, 2023
0ac6601
Refine wizards
mreid-tt Dec 4, 2023
f6d87b2
Include USB export paths
mreid-tt Dec 4, 2023
f43d69c
Update package naming
mreid-tt Dec 6, 2023
108fa91
Escape parentheses in description
mreid-tt Dec 6, 2023
0c76c93
Remove quoting on description
mreid-tt Dec 6, 2023
17dffcd
Fix service setup formatting
mreid-tt Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions cross/diesel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PKG_NAME = diesel
PKG_VERS = 2.1.4
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/diesel-rs/diesel/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS += cross/mysql-connector-c

# powerpc archs (except qoriq) are not supported
UNSUPPORTED_ARCHS += $(OLD_PPC_ARCHS)

HOMEPAGE = https://diesel.rs/
COMMENT = A safe, extensible ORM and Query Builder for Rust.
LICENSE = MIT

# build the cli tool for mysql
RUST_SRC_DIR = $(WORK_DIR)/$(PKG_DIR)/diesel_cli
CARGO_BUILD_ARGS += --no-default-features
CARGO_BUILD_ARGS += --features=mysql

# we support MariaDB 10 only
# we must define the mysql db socket, since the rust binaries (mysqlclient-sys)
# do not read settings from bin/mysql_conf
export "MYSQL_DB_SOCKET=/run/mysqld/mysqld10.sock"

# mysqlclient-sys: to find libmysqlclient
ENV += MYSQLCLIENT_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib
# to find dependencies of libmysqlclient (libz)
ENV += RUSTFLAGS="-Clink-arg=-Wl,--rpath,$(INSTALL_PREFIX)/lib -Clink-arg=-Wl,--rpath-link,$(STAGING_INSTALL_PREFIX)/lib"

include ../../mk/spksrc.cross-rust.mk
1 change: 1 addition & 0 deletions cross/diesel/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/diesel
3 changes: 3 additions & 0 deletions cross/diesel/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
diesel-2.1.4.tar.gz SHA1 ea4fd4a77bcd90038a04bcfefcee7448b63e5b03
diesel-2.1.4.tar.gz SHA256 5aac923078a5b431902d75cfca36f2990b3f11dbb2bbbc44f4538305af939657
diesel-2.1.4.tar.gz MD5 d570cfe9013331fad318a94a6a389b8d
13 changes: 13 additions & 0 deletions cross/mysql-connector-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ include ../../mk/spksrc.cross-cmake.mk
# give access to comp_err binary on host
ENV += PATH=$(WORK_DIR)/../../../native/libmysqlclient/work-native/install/usr/local/bin/:$(CMAKE_PATH):$$PATH

# custom mysql socket addr (default is /tmp/mysql.sock)
# on DSM 7 (only MariaDB 10 available)
# /run/mysqld/mysqld10.sock (links to /run/mysqld/mysqld.sock)
# /run/mysqld/mysqld.sock
# on DSM 6 with mariadb 5 and 10
# /run/mysqld/mysqld.sock (MariaDB 5)
# /run/mysqld/mysqld10.sock (MariaDB 10)
ifeq ($(MYSQL_DB_SOCKET),)
# default mysql socket for DSM
MYSQL_DB_SOCKET = /run/mysqld/mysqld.sock
endif
CMAKE_ARGS += -DMYSQL_UNIX_ADDR=$(MYSQL_DB_SOCKET)

# Mandatory for build
CMAKE_ARGS += -DHAVE_LLVM_LIBCPP_EXITCODE=1
CMAKE_ARGS += -DHAVE_CXX_FLOATING_POINT_OPTIMIZATION_PROBLEMS_EXITCODE=1
Expand Down
68 changes: 68 additions & 0 deletions cross/syncstorage-rs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
PKG_NAME = syncstorage-rs
PKG_VERS = 0.14.3
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/mozilla-services/$(PKG_NAME)/archive/${PKG_VERS}
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

# only required for build in cross/syncstorage-rs folder (not when using prebuilt spk/python311)
#BUILD_DEPENDS = cross/python311
# for openssl-sys
DEPENDS = cross/openssl3
# for mysqlclient-sys
DEPENDS += cross/mysql-connector-c

# OLD_PPC_ARCHS are not supported for Rust builds
# Rust has support for qoriq, but the "ring" dependency has issue(s) with big-endian targets
# see: https://github.com/briansmith/ring/issues/1555 (and referenced issues)
# There is an update in https://github.com/briansmith/ring/pull/1677 for (64-bit) PPC
# this might fix ring for 32-bit PPC (qoriq) too.
# An update of ring (>= 0.17.0) is required, syncstorage-rs 0.14.3 has locked ring to 0.16.20.
#
# powerpc archs are not supported
UNSUPPORTED_ARCHS += $(PPC_ARCHS)

HOMEPAGE = https://github.com/mozilla-services/syncstorage-rs/
COMMENT = Mozilla Sync Storage built with Rust.
LICENSE = MPL 2.0

# arguments to install the main server program
RUST_SRC_DIR = $(WORK_DIR)/$(PKG_DIR)/syncserver
CARGO_BUILD_ARGS += --no-default-features
CARGO_BUILD_ARGS += --features=syncstorage-db/mysql
CARGO_BUILD_ARGS += --locked

# we support MariaDB 10 only
# we must define the mysql db socket, since the rust binaries (mysqlclient-sys)
# do not read settings from bin/mysql_conf
export MYSQL_DB_SOCKET=/run/mysqld/mysqld10.sock

# To find libpython in prebuilt or local built python
ifneq ($(PYTHON_STAGING_PREFIX),)
# use prebuilt python
ENV += PYO3_CROSS_LIB_DIR=$(PYTHON_STAGING_PREFIX)/lib/
ENV += PYO3_CROSS_INCLUDE_DIR=$(PYTHON_STAGING_PREFIX)/include/
else
# use local python (together with "BUILD_DEPENDS = cross/python311" above)
ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/
ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/
endif

# mysqlclient-sys: to find libmysqlclient
ENV += MYSQLCLIENT_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib
# to find dependencies of libmysqlclient (libz)
ENV += RUSTFLAGS="-Clink-arg=-Wl,--rpath,$(INSTALL_PREFIX)/lib -Clink-arg=-Wl,--rpath-link,$(STAGING_INSTALL_PREFIX)/lib"

POST_INSTALL_TARGET = syncstorage-rs_post_install

include ../../mk/spksrc.cross-rust.mk

.PHONY: syncstorage-rs_post_install
syncstorage-rs_post_install:
@$(MSG) Install Tools
@install -m 755 -d $(STAGING_INSTALL_PREFIX)/tools
@tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/tools . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/tools
@$(MSG) Install DB Migration scripts
@install -m 755 -d $(STAGING_INSTALL_PREFIX)/syncstorage-mysql/migrations -d $(STAGING_INSTALL_PREFIX)/tokenserver-db/migrations
@tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/syncstorage-mysql/migrations . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/syncstorage-mysql/migrations
@tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/tokenserver-db/migrations . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/tokenserver-db/migrations
4 changes: 4 additions & 0 deletions cross/syncstorage-rs/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin:bin/syncserver
rsc:tools/
rsc:syncstorage-mysql/
rsc:tokenserver-db/
3 changes: 3 additions & 0 deletions cross/syncstorage-rs/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
syncstorage-rs-0.14.3.tar.gz SHA1 0982c8f6d471d277b94596ecca6d8966e26826f4
syncstorage-rs-0.14.3.tar.gz SHA256 7ece5b08b2160b04ff01fa1fa61069973a63ec2f6aa34ae53fc29c9252539d96
syncstorage-rs-0.14.3.tar.gz MD5 8b96d242d3e194b50c4f2ffa18b8979f
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# pyo3 0.14.2 (as locked in Cargo.lock) does not support Python 3.10 and 3.11
# error: the configured Python interpreter version (3.1) is lower than PyO3's minimum supported version (3.6)
#
# This patch updates to pyo3 0.17.*
# At time of writing pyo3 0.17.3 is used
#
--- tokenserver-auth/Cargo.toml.orig 2023-11-30 02:34:56.000000000 +0000
+++ tokenserver-auth/Cargo.toml 2023-11-30 18:24:35.953670206 +0000
@@ -14,7 +14,7 @@

async-trait = "0.1.40"
dyn-clone = "1.0.4"
-pyo3 = { version = "0.14", features = ["auto-initialize"] }
+pyo3 = { version = "0.17", features = ["auto-initialize"] }
reqwest = { version = "0.10.10", features = ["json", "rustls-tls"] }
syncserver-common = { path = "../syncserver-common" }
tokenserver-common = { path = "../tokenserver-common" }
5 changes: 5 additions & 0 deletions mk/spksrc.cross-rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ endif
CARGO_INSTALL_ARGS += --path $(RUST_SRC_DIR)
CARGO_INSTALL_ARGS += --root $(STAGING_INSTALL_PREFIX)

# Append additional install options if present
ifneq ($(strip $(CARGO_BUILD_ARGS)),)
CARGO_INSTALL_ARGS += $(CARGO_BUILD_ARGS)
endif

# Default build with rust and install with cargo
rust_install_target:
@echo " ==> Cargo install rust package $(PKG_NAME) ($(shell rustc --version); $(RUST_TOOLCHAIN))"
Expand Down
8 changes: 0 additions & 8 deletions spk/ffsync/BROKEN

This file was deleted.

79 changes: 50 additions & 29 deletions spk/ffsync/Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,68 @@
SPK_NAME = ffsync
SPK_VERS = 1.5.2
SPK_REV = 3
SPK_VERS = 0.14.3
SPK_REV = 1
SPK_ICON = src/ffsync.png
BETA = 1

BUILD_DEPENDS = cross/python2 cross/setuptools_py2 cross/pip_py2 cross/wheel
BUILD_DEPENDS += cross/gevent cross/greenlet cross/cffi
DEPENDS = cross/syncstorage-rs cross/diesel

DEPENDS = cross/busybox
WHEELS = src/requirements.txt
PYTHON_PACKAGE = python311
WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt

MAINTAINER = SynoCommunity
UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(PPC_ARCHS)

REQUIRED_MIN_DSM = 6.0
SPK_DEPENDS = MariaDB10:$(PYTHON_PACKAGE)

MAINTAINER = SynoCommunity
DESCRIPTION = Firefox Sync Server 1.5, used for Firefox 29 and later. You can use Firefox Sync Server to synchronize your bookmarks, passwords, settings, history, add-ons and tabs with Firefox on other computers. The service runs on port 8132.
DISPLAY_NAME = Firefox Sync Server 1.5
CHANGELOG = "1. Fix Python requirement<br>2. Fix startup issue when pidfile is not yet written"
CHANGELOG = "Inital Mozilla Sync Storage package."

HOMEPAGE = https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html
LICENSE = MPL 2.0

HOMEPAGE = https://docs.services.mozilla.com/howtos/run-sync-1.5.html
LICENSE = MPL/GPL/LGPL
HELPURL = https://github.com/SynoCommunity/spksrc/wiki/Firefox-Sync-Server-1.5
WIZARDS_DIR = src/wizard/

INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT = src/dsm-control.sh
FWPORTS = src/${SPK_NAME}.sc
CONF_DIR = src/conf/
STARTABLE = yes
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT = 8132
SERVICE_PORT_TITLE = $(DISPLAY_NAME)

INSTALL_DEP_SERVICES = mysql
START_DEP_SERVICES = mysql
# Admin link for in DSM UI
ADMIN_PORT = $(SERVICE_PORT)

INSTALL_PREFIX = /usr/local/$(SPK_NAME)
# [cryptography]
# Mandatory of using OPENSSL_*_DIR starting with version >= 40
# https://docs.rs/openssl/latest/openssl/#automatic
DEPENDS += cross/openssl3
ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/
ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/

# [mysqlclient]
ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)"
ENV += MYSQLCLIENT_LDFLAGS="$(LDFLAGS)"

POST_STRIP_TARGET = ffsync_extra_install

BUSYBOX_CONFIG = usermng
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"
include ../../mk/spksrc.python.mk

# [greenlet]
ifeq ($(call version_ge, $(TC_GCC), 4.9),1)
WHEELS += src/requirements-crossenv-greenlet-v2.txt
ifeq ($(call version_lt, $(TC_GCC), 5.0),1)
WHEELS_CPPFLAGS += [greenlet] -std=c++11 -fpermissive
endif
else
WHEELS += src/requirements-crossenv-greenlet-v1.txt
endif

include ../../mk/spksrc.spk.mk

.PHONY: ffsync_extra_install
ffsync_extra_install:
install -m 755 -d $(STAGING_DIR)/var
install -m 644 src/ffsync.ini $(STAGING_DIR)/var/
sed -i -e "s|https://github.com/mozilla-services/mozservices/archive/e00e1b68130423ad98d0f6185655bde650443da8.zip|mozsvc==0.8|g" \
-e "s|https://github.com/mozilla-services/tokenserver/archive/d7e513e8a4f5c588b70d685a8df1d2e508c341c0.zip|tokenserver==1.2.7|g" \
-e "s|https://github.com/mozilla-services/server-syncstorage/archive/1.5.5.zip|SyncStorage==1.5.5|g" \
-e "s|https://github.com/mozilla-services/syncserver/archive/1.5.2.tar.gz|syncserver==1.5.2|g" \
$(STAGING_DIR)/share/wheelhouse/requirements.txt
@$(MSG) Install config file
@install -m 755 -d $(STAGING_DIR)/var
@install -m 644 src/var/local.toml $(STAGING_DIR)/var/
@$(MSG) Patch binaries built with rust to find shared libraries
@patchelf --set-rpath /var/packages/$(SPK_NAME)/target/lib:/var/packages/$(PYTHON_PACKAGE)/target/lib $(STAGING_DIR)/bin/syncserver
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
@patchelf --set-rpath /var/packages/$(SPK_NAME)/target/lib $(STAGING_DIR)/bin/diesel
5 changes: 0 additions & 5 deletions spk/ffsync/src/conf/PKG_DEPS

This file was deleted.

31 changes: 0 additions & 31 deletions spk/ffsync/src/conf/privilege

This file was deleted.

Loading