Skip to content

synocli-file: update rmlint to support reflink#5462

Merged
hgy59 merged 7 commits intoSynoCommunity:masterfrom
hgy59:update_rmlint
Oct 30, 2022
Merged

synocli-file: update rmlint to support reflink#5462
hgy59 merged 7 commits intoSynoCommunity:masterfrom
hgy59:update_rmlint

Conversation

@hgy59
Copy link
Copy Markdown
Contributor

@hgy59 hgy59 commented Oct 22, 2022

Description

Fixes #5459

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Package update

@hgy59
Copy link
Copy Markdown
Contributor Author

hgy59 commented Oct 22, 2022

currently build of synocli-file fails due to #5463

@t-rutter
Copy link
Copy Markdown

t-rutter commented Oct 26, 2022

Hi @hgy59
I've tested building from your branch hgy59:update_rmlint and manually applied patch for #5463 by @th0ma7 .

The build completes and packages the .spk , when I test on my DS-1821 . rmlint --version shows the new version 2.10.1 .
But when trying to use the handlers 'clone' or 'relink' I'm still getting

WARNING: reflink will not be emitted: please compile with blkid and gio-unix-2.0.

@hgy59
Copy link
Copy Markdown
Contributor Author

hgy59 commented Oct 27, 2022

WARNING: reflink will not be emitted: please compile with blkid and gio-unix-2.0.

can you please check whether compiled with: contains +mounts ?
The warning is only displayed when one of the options HAVE_BLKID and HAVE_GIO_UNIX is missing, and mounts is only active when both are definded.

rmlint --version
version 2.10.1 compiled: Oct 21 2022 at [16:12:32] "Ludicrous Lemur" (rev 79c294ee)
compiled with: +mounts -nonstripped +fiemap +sha512 +bigfiles +intl -replay +xattr +btrfs-support

rmlint was written by Christopher <sahib> Pahl and Daniel <SeeSpotRun> Thomas.
The code at https://github.com/sahib/rmlint is licensed under the terms of the GPLv3.

    } features[] = {{.name = "mounts",         .enabled = HAVE_BLKID & HAVE_GIO_UNIX},
                    {.name = "nonstripped",    .enabled = HAVE_LIBELF},
                    {.name = "fiemap",         .enabled = HAVE_FIEMAP},
                    {.name = "sha512",         .enabled = HAVE_SHA512},
                    {.name = "bigfiles",       .enabled = HAVE_BIGFILES},
                    {.name = "intl",           .enabled = HAVE_LIBINTL},
                    {.name = "replay",         .enabled = HAVE_JSON_GLIB},
                    {.name = "xattr",          .enabled = HAVE_XATTR},
                    {.name = "btrfs-support",  .enabled = HAVE_BTRFS_H},
                    {.name = NULL,             .enabled = 0}};
    /* clang-format on */

So now only the replay feature is disabled, as we build without glib-json.

BTW: to build a package for rmlint only, you can build it in spksrc/diyspk/rmlint (diyspk = do it yourself spk). That is much faster and does not need the rust patch

@t-rutter
Copy link
Copy Markdown

t-rutter commented Oct 27, 2022

Thanks @hgy59
I built diyspk/rmlint as suggested instead of the full spk/synocli-file .
And rmlint -c sh:handler:clone and handler:reflink are now working 🥳

Hopefully your PR can be included into the next release of synocli-file

Also I made a patch for rmlint/lib/format/sh.c.in as upstream the original code actually has the checks for reflink warning commented out and so always prints the warning when the clone or reflink handler is used, Please feel free to use

--- lib/formats/sh.c.in.orig    2020-06-13 19:12:45.000000000 +0930
+++ lib/formats/sh.c.in 2022-10-27 22:22:57.623108880 +1030
@@ -218,9 +218,9 @@
 };
 
 static void rm_sh_warn_if_reflink_not_compiled_in(void) {
-#if !HAVE_BLKID || !HAVE_GIO_UNIX
+  if(!HAVE_BLKID || !HAVE_GIO_UNIX) {
     g_printerr("\n%sWARNING:%s reflink will not be emitted: please compile with blkid and gio-unix-2.0.\n", YELLOW, RESET);
-#endif
+  }
 }
 
 static void rm_sh_parse_handlers(RmFmtHandlerShScript *self, const char *handler_cfg) {

@hgy59
Copy link
Copy Markdown
Contributor Author

hgy59 commented Oct 27, 2022

@t-rutter reading your patch i doubt that there is an error in the source code.
Please regard that #if !HAVE_BLKID || !HAVE_GIO_UNIX it not commented out, but #if and #endif are a c preprocessing directives.
The WARNING output is removed at compile time if the condition evaluates to 0.

hgy59 added 4 commits October 28, 2022 22:24
- update cross/file to match the version of the build environment
- Update bat to v0.22.1
- Update fdupes to v2.2.1
- Update fzf to v.0.34.0
- Update jdupes to v1.21.0
- Update tree to v2.0.4
@hgy59
Copy link
Copy Markdown
Contributor Author

hgy59 commented Oct 29, 2022

I built diyspk/rmlint as suggested instead of the full spk/synocli-file .
And rmlint -c sh:handler:clone and handler:reflink are now working

@t-rutter
Just found that in the context of synocli-file package, libblkid is missing.
This is caused by two packages compiling util-linux from source (cross/libuuid and cross/libblkid). After util-linux is compiled for libuuid the second build (for libblkid) is ignored, as the build folder is the same.
I am working on it...

@hgy59 hgy59 merged commit 5726baa into SynoCommunity:master Oct 30, 2022
@hgy59 hgy59 deleted the update_rmlint branch October 30, 2022 08:48
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Oct 30, 2022
AlexPresso pushed a commit to AlexPresso/spksrc that referenced this pull request Jan 30, 2025
* update rmlint to support reflink
* libelf: fix 64-bit support for cross compile
* synocli-file: update file (follow up to SynoCommunity#5441)
- update cross/file to match the version of the build environment
* update several tools:
- Update bat to v0.22.1
- Update fdupes to v2.2.1
- Update fzf to v.0.34.0
- Update jdupes to v1.21.0
- Update tree to v2.0.4
* use dedicated extract folder to compile util-linux for libblkid
* final fix for rmlint to support reflink in synocli-file packages
* rmlint: add json-glib to support to read json caches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/published Published and activated (may take up to 48h until visible in DSM package manager)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

synocli-file: rmlint is not complied with blkid , no reflink support

2 participants