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

%?RESOURCES execute bit lost on installation #2571

Open
taboege opened this issue Dec 27, 2018 · 0 comments
Open

%?RESOURCES execute bit lost on installation #2571

taboege opened this issue Dec 27, 2018 · 0 comments

Comments

@taboege
Copy link
Contributor

taboege commented Dec 27, 2018

Execute permissions of resources files in a module are lost when installed.

Context

I package SAT solvers as %?RESOURCES with my modules. They are executables built with Build.pm which my modules exist to provide an interface to.

The Problem

I use for instance Proc::Async.new: :w, %?RESOURCES<minisat>, |@args to invoke the minisat solver. The module builds and tests fine but does not work anymore once installed:

$ perl6 t/01-samples.t 
1..2
    1..72
An operation first awaited:
  in method solve at /home/tab/src/perl6/rakudo/install/share/perl6/site/sources/0C6C12ACC2FF2F74FEEE89C23438C489D9C6B45F (SAT) line 22
  in sub sat-ok at /home/tab/src/perl6/rakudo/install/share/perl6/site/sources/429246F12FAEA55B204C2F99094A7AB4E03AF6DB (Test::SAT) line 32
  in block  at t/01-samples.t line 18
  in sub subtest at /home/tab/src/perl6/rakudo/install/share/perl6/sources/2D4A7CA10695CD2B374573413D261A660E282E2A (Test) line 415
  in sub subtest at /home/tab/src/perl6/rakudo/install/share/perl6/sources/2D4A7CA10695CD2B374573413D261A660E282E2A (Test) line 405
  in block <unit> at t/01-samples.t line 13

Died with the exception:
    Tried to get the result of a broken Promise
      in block  at /home/tab/src/perl6/rakudo/install/share/perl6/site/sources/02823F56C44CDD021467DA2B1C3B5196EF4628DB (SAT::Solver::MiniSAT) line 56

    Original exception:
        permission denied
          in block  at /home/tab/src/perl6/rakudo/install/share/perl6/site/sources/02823F56C44CDD021467DA2B1C3B5196EF4628DB (SAT::Solver::MiniSAT) line 56

    # Looks like you planned 72 tests, but ran 0

The permission denied error boils down to missing execute permissions on the installed minisat program.

Workaround

I currently set the owner's execute bit when the module is loaded:

BEGIN sink with %?RESOURCES<minisat>.IO { .chmod: 0o100 +| .mode };

History

I issued this as ugexe/zef#280 where ugexe suggested that my workaround is a bad idea and

As for rakudo, it seems like distribution META6.json would have to be able to contain file meta data ( because it cannot be assumed a Distribution IO is backed by a filesystem at all ), and that CompUnit::Repository::Installation ( CURI ) would have to be able to understand and act upon it in ( in a cross-platform manner no less ).

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

No branches or pull requests

1 participant