Skip to content

On .install, check a distro's /resources file paths are identical to those of the META6.json file's <resources> #576

Open
@tbrowder

Description

This should be a fundamental check due to the close ties between Raku distributions and their 'META6.json' file. Unless those two "resources" file path lists match, it is impossible to download a '/resources' directory's file payload without foreknowledge of those paths.

But, with a match, the distribution author can easily provide the means to do so.

Currently, and apparently, such is not done since I have never seen such an error using 'zef install . --debug' with known mismatches.

Context

Among other things, current Raku documentation does not clearly point out how critical that a "resources" match is to downloading '/resources' from an installed distribution.

Expected Behavior

In a distribution repository directory with no listed 'resources' under '/resources' or in the 'META6.json file, no change to current bevavior is needed.

But for any other case, report any mismatch:

zef test . --debug
WARNING: /resources file paths do not match those of META6.json
   /resources has files:
      ...file path list...
   META6.json.resources:
      ...file path list...

The "WARNING" should also appear without the '--debug' option.

Upon 'zef install Some::Module', throw an error and describe the mismatch. Also add a message that the user should file an issue with that distribution's author.

Actual Behavior:

No warning is given, even with the '--debug' option to 'zef'.

Steps to Reproduce

# Clone my module 'Foo::Bar' into the local directory.
# That module has intentionally mismatched "resources" file paths.
$ git clone https://github.com/tbrowder/Foo-Bar
$ zef test . --debug
===> Testing: Foo::Bar:ver<0.0.1>:auth<zef:tbrowder>
[Foo::Bar] Testing with plugin: Zef::Service::TAP
[Foo::Bar] 1..1
[Foo::Bar] ok 1 - Module Foo::Bar used okay
[Foo::Bar] t/0-load.rakutest .. ok
[Foo::Bar] All tests successful.
[Foo::Bar] Files=1, Tests=1,  0 wallclock secs
[Foo::Bar] Result: PASS
===> Testing [OK] for Foo::Bar:ver<0.0.1>:auth<zef:tbrowder>

Your Environment

  • raku -v
Welcome to Rakudo™ v2024.09.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2024.09.
  • zef list --installed
zef:ver<0.22.1>:auth<github:ugexe>:api<0>
[and MANY others]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions