Skip to content

Conversation

@Herren
Copy link
Contributor

@Herren Herren commented May 29, 2024

As suggested by @jodavies during the currently ongoing FORM workshop, I added an option
to the tablebase open command, allowing to open tablebases in read-only mode.
This allows to load tablebases in shared environments where not all users of the tablebases
have write permissions. In case the addto command is called on a readonly tablebase file,
an error is thrown and FORM terminates.

The syntax is simply:
TableBase "tablename.tbl" open, readonly

Some documentation on this feature is also added to the relevant manual file.

@coveralls
Copy link

Coverage Status

coverage: 50.002% (+0.003%) from 49.999%
when pulling 7ed3e84 on Herren:tablebase_readonly
into 83e3d41 on vermaseren:master.

@jodavies jodavies marked this pull request as draft June 7, 2024 10:49
@jodavies jodavies added this to the v5 milestone Nov 6, 2024
@jodavies
Copy link
Collaborator

jodavies commented Nov 7, 2024

Currently, if you attempt to open a non-existing tablebase in readonly mode, there is no error and the file is created. I think this case should print an error and terminate FORM.

@Herren
Copy link
Contributor Author

Herren commented Nov 22, 2024

Please have a look at the change. It should work now.

@jodavies
Copy link
Collaborator

Thanks, this works. Could you finally add test cases in check/features.frm for the failure modes, trying to add to an opened readonly table, and trying to open a non-existing table in readonly mode?

You can run multiple form scripts in a single test case like this: jodavies@9a5e42d

@Herren Herren force-pushed the tablebase_readonly branch from 8860dda to 9f04338 Compare February 25, 2025 13:48
@Herren
Copy link
Contributor Author

Herren commented Feb 25, 2025

I attempted to add two tests, but I think I don't entirely understand how the test framework works....

@Herren Herren force-pushed the tablebase_readonly branch from 9f04338 to 096beb9 Compare February 25, 2025 14:22
@Herren Herren marked this pull request as ready for review February 25, 2025 14:22
@jodavies
Copy link
Collaborator

On my system, the parform valgrind error is also an error in form, but not so on the runner?

Anyway, in GetDbase in minos.c I think you can just Terminate(-1); after your error message.

@Herren Herren force-pushed the tablebase_readonly branch from 096beb9 to 4f624b6 Compare February 25, 2025 16:36
@Herren
Copy link
Contributor Author

Herren commented Feb 25, 2025

Done.

@Herren Herren force-pushed the tablebase_readonly branch from 4f624b6 to d1b1f31 Compare February 25, 2025 16:59
@coveralls
Copy link

coveralls commented Feb 26, 2025

Coverage Status

coverage: 48.661% (+0.7%) from 47.92%
when pulling 79e2b15 on Herren:tablebase_readonly
into f2df9bf on vermaseren:master.

@jodavies
Copy link
Collaborator

Ah, it seems #573 has broken the 32bit tests.

@tueda
Copy link
Collaborator

tueda commented Feb 27, 2025

On the master branch, even in 32-bit containers, FORM_IGNORE_DEPRECATION is set and CI runs fine.

Maybe rebasing will fix the CI failures?

@Herren Herren force-pushed the tablebase_readonly branch from d1b1f31 to a38d8dd Compare March 3, 2025 09:39
@jodavies
Copy link
Collaborator

jodavies commented Mar 7, 2025

I think this looks good now. Any further comments, @tueda ?

@Herren Herren force-pushed the tablebase_readonly branch from a38d8dd to 79e2b15 Compare May 27, 2025 12:09
@jodavies jodavies merged commit acf1989 into form-dev:master May 27, 2025
58 checks passed
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

Successfully merging this pull request may close these issues.

4 participants