Skip to content

Commit

Permalink
Remove links-mysql database driver (#1178)
Browse files Browse the repository at this point in the history
Links currently has two database drivers for MySQL databases, provided by the packages links-mysql and links-mysql8. The former uses the opam package mysql, while the latter uses mysql8.

Unfortunately, the mysql opam package cannot be built on recent versions of Ubuntu anymore and has not been updated in a while. mysql8 is a fork of mysql that does work on more recent versions of Ubuntu, and supports MySQL version 8 (in addition to earlier versions).

Since mysql8 is backwards compatible with earlier versions of MySQL, its functionality subsumes that of mysql. However, since it's a fork of mysql we kept the links-mysql driver around in case the original mysql package gets updated eventually.

This PR is the result of giving up on this hope for the time being: It removes the links-mysql package and associated code within Links.

Since the CI is currently blocked by this, this PR also applies a temporary fix for #1179, by imposing a bound on the version of ppx_sexp_conv
  • Loading branch information
frank-emrich authored Jun 23, 2023
1 parent b04d184 commit 7eb0d58
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 439 deletions.
72 changes: 0 additions & 72 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,78 +274,6 @@ jobs:
LINKS_MYSQL8_PORT: ${{ job.services.mysql.ports[3306] }}
shell: bash

links-mysql_mysql57:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
ocaml-compiler:
- 4.14.1
- 5.0.0

runs-on: ${{ matrix.os }}

services:
mysql:
image: mysql:5.7
env:
MYSQL_USER: links
MYSQL_PASSWORD: links
MYSQL_ROOT_PASSWORD: links
MYSQL_DATABASE: links
MYSQL_ROOT_HOST: "%"
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install system dependencies
run: sudo apt-get install -y libev-dev
shell: bash

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- run: opam install -y conf-libev

- name: Install Links dependencies
run: >-
opam install
./links.opam
./links-mysql.opam
--deps-only
--ignore-constraints-on=links
- name: Build Links from source
run: |
eval $(opam env)
make all-ci
shell: bash

- name: Run MySQL5.7 database testsuite
run: |
eval $(opam env)
./run-database-tests tests/database -d mysql
./run-database-tests tests/relational-lenses -d mysql
env:
# TODO(dhil): I do not know how to index into the
# environments of either service. Until we figure out how to
# do it, we will just duplicate information here.
LINKS_MYSQL_HOST: 127.0.0.1
LINKS_MYSQL_USER: links
LINKS_MYSQL_PASSWORD: links
LINKS_MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
shell: bash

js-runtime-lint:
strategy:
Expand Down
6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Unreleased

List of changes since the latest release.

* The package `links-mysql`, based on the `mysql` opam package is no
longer supported. Instead, the package `links-mysql8`, based on the
`mysql8` package is provided, which also supports version of MySQL
prior to 8.

# 0.9.7

This release includes minor bug fixes, improvements, and a breaking
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ BUILD_DIR:=$(ROOT)/_build
BUILD=dune build
MAIN=links
SOURCES=$(MAIN)
DB_STABLE=links-postgresql,links-sqlite3,links-mysql
DB_EXPERIMENTAL=links-mysql8
DB_SOURCES=$(DB_STABLE),$(DB_EXPERIMENTAL)
DB_STABLE=links-postgresql,links-sqlite3,links-mysql8
DB_SOURCES=$(DB_STABLE)
# Note: this relies on lazy expansion of `SOURCES'.
COMMON_FLAGS=--only-packages $(SOURCES) --build-dir=$(BUILD_DIR)
DEV_FLAGS=$(COMMON_FLAGS) --profile=dev
Expand Down
12 changes: 0 additions & 12 deletions database/mysql-driver/dune

This file was deleted.

6 changes: 0 additions & 6 deletions database/mysql-driver/links_mysql_dependencies.json

This file was deleted.

Loading

0 comments on commit 7eb0d58

Please sign in to comment.