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

Generate etc/profile/init.sh early #800

Closed
wants to merge 1 commit into from

Conversation

TimoWilken
Copy link
Contributor

This should help with debugging failed builds.

There is a change in behaviour, though: if we're unpacking a tarball, this means the init.sh from the tarball is used, not the newly-generated one. However, they should be the same.

Also, revamp and simplify the code that generates init.sh. Just use a single cat<<\EOF and generate init.sh's code directly from Python, instead of generating shell code that generates init.sh.

Also, make init.sh slightly more robust by quoting a few more things where applicable.

This should help with debugging failed builds.

There is a change in behaviour, though: if we're unpacking a tarball, this
means the init.sh from the tarball is used, not the newly-generated one.
However, they should be the same.

Also, revamp and simplify the code that generates init.sh. Just use a single
cat<<\EOF and generate init.sh's code directly from Python, instead of
generating shell code that generates init.sh.

Also, make init.sh slightly more robust by quoting a few more things where
applicable.
@TimoWilken TimoWilken requested a review from ktf October 5, 2023 16:15
# Set up variables pointing to this package.
%(package_vars)s
# Environment variables set by this alidist recipe.
%(environment)s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might actually be the reason why we did not do this before. Environment variables created by a package should be effective only after the build. Does that change the behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't -- this block is inside the heredoc, so it only creates init.sh. It doesn't source it. Further up, only %(source_dependencies)s is executed.

The problem is that the order used to be "unpack tarball" -> "overwrite init.sh" (so the newly-generated init.sh wins); this changes it to "create init.sh" -> "unpack tarball, including init.sh, over the top" (i.e. tarball wins). But as I say in the comment, the files ought to be the same anyway I think...

@ktf
Copy link
Member

ktf commented Oct 6, 2023

Can we have the revamp and the moving in two separate PRs? Way too many changes.

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

Successfully merging this pull request may close these issues.

2 participants