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

Is it valid to use zef install --to=home for multiple rakudo installations? #5145

Open
melezhik opened this issue Dec 28, 2022 · 7 comments
Open

Comments

@melezhik
Copy link

Hi! I am note sure this is complete zef question, so writing here.

My scenario:

  1. install rakudo version X:
version=X
curl -sL https://rakudo.org/dl/rakudo/rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz \
-o rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz
tar -xzf rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz          
eval "$(rakudo-moar-$version-01-linux-x86_64-gcc/scripts/set-env.sh)"

and then install some M module for this rakudo using zef install -to=home:

zef install M --/test --to=home
zef test .

So we end up installing module M and it's dependencies to ~/.rakupath

  1. do the same for the same module M, but for rakudo version Y

So, this is how testing for multiple rakudo versions now works in SparrowCI, for example - https://ci.sparrowhub.io/report/2296

I've noticed that a module test time for the Rakudo that comes first (does not matter which version is used) is always SIGNIFICANTLY less then for the same tests carried out for the following Rakudo version. And I don't understand why it is.

So the question is it a valid approach. I heard that "if a Rakudo version is changed ones need to recompile all existing modules ... ( which does not happen as I only switch rakudo by using eval "$(rakudo-moar-$version-01-linux-x86_64-gcc/scripts/set-env.sh)") , or may be I just missing the point ...

Thanks

@melezhik melezhik changed the title is it safe to use zef install --to=home for multiple rakudo installations? Is it valid to use zef install --to=home for multiple rakudo installations? Dec 28, 2022
@melezhik
Copy link
Author

add @ugexe

@patrickbkr
Copy link
Contributor

IIUC the behavior you describe correctly then I think the following happens:

  • zef install M --to=home # This installs and precompiles the module M with the currently active Rakudo version.
  • run some tests
  • Switch the rakudo version
  • zef install M --to=home # This is basically a no-op as that module is already installed. Module installations are cross-usable with different rakudo installations.
  • run some tests # As the precomp files of module M don't fit to the compiler version they are precompiled again on the fly. That's why you observe higher running times.

What I'm unsure about: Do precomp files compiled with different Rakudo versions have the same hash and overwrite each other, or does the entire dependency chain factor into the hash which would mean that the precomp files are preserved and one could switch back and forth between versions without having to re-precompile every time?

@ugexe Do you approve of the above thesis?

@niner
Copy link
Collaborator

niner commented Dec 29, 2022 via email

@melezhik
Copy link
Author

melezhik commented Dec 29, 2022

So in other words the approach I use is correct and I don’t have to change anything here ?

@melezhik
Copy link
Author

melezhik commented Dec 30, 2022

run some tests # As the precomp files of module M don't fit to the compiler version they are precompiled again on the fly. That's why you observe higher running times.

does this happen during “zef test .” stage ? Can I invoke this precompilaton stage as a separate zef step, I want to measure pure tests time , that does not include precompilaton ….

@jonathanstowe
Copy link
Contributor

I want to measure pure tests time , that does not include precompilaton ….

I guess you could make a thing that reads the dependencies from the META6 and then "warms them up" by require for instance.

@patrickbkr
Copy link
Contributor

I think raku -c can be used to compile but don't run.

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

4 participants