Skip to content

Can I recompute fs.hash() when the file changes? #12876

Answered by eli-schwartz
detly asked this question in Q&A
Discussion options

You must be logged in to vote

I think I understand what the problem is: meson's variables are computed at setup/configuration time. At build time, the configuration variables do not get recomputed except when meson.build itself changes. The targets are what get rebuilt, and may trigger other targets to get rebuilt, but not the configuration that expresses these dependencies.

Yes.

However, even knowing that, I'm at a loss as to how to work around this. I don't think there's a way to "promote" a variable to a target or source, is there? Or to defer something like fs.hash() to build time? How should I approach this?

One approach would be to run the sha256sum tool in your custom_target command.

Another approach is to do

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@detly
Comment options

@eli-schwartz
Comment options

@detly
Comment options

@eli-schwartz
Comment options

@scivision
Comment options

Answer selected by detly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants