Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix install.environment not expanding some vars #1055

Merged
merged 1 commit into from
Jun 22, 2024
Merged

Conversation

jrray
Copy link
Collaborator

@jrray jrray commented Jun 20, 2024

The environment variables being fed into the substitution engine did not include the build environment variables, such as
$SPK_PKG_VERSION_MAJOR. Users expect to be able to use these vars when generating activation scripts.

Add some tests to verify expected substitution behavior.

get_package_build_env refactored into a trait Package method since now this needs to be called from code that lives in the schema crate.

@jrray jrray added bug Something isn't working SPI AOI Area of interest for SPI labels Jun 20, 2024
@jrray jrray self-assigned this Jun 20, 2024
@jrray jrray force-pushed the inst-env-var-expansion branch from c68b32e to b199b75 Compare June 20, 2024 07:31
Comment on lines +646 to +647
let mut build_env_vars = build_env.env_vars();
build_env_vars.extend(build.get_build_env());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is it odd that build_env.env_vars() doesn't already include the vars returned by get_build_env()?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the naming/wording makes this look more confusing than it is, but logically it doesn't actually seem that bad that we are combining the env vars for the resolved environment with those from the package spec.

@jrray jrray force-pushed the inst-env-var-expansion branch from b199b75 to 2334dfb Compare June 20, 2024 07:42
@jrray jrray requested a review from rydrman June 20, 2024 07:56
Comment on lines +646 to +647
let mut build_env_vars = build_env.env_vars();
build_env_vars.extend(build.get_build_env());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the naming/wording makes this look more confusing than it is, but logically it doesn't actually seem that bad that we are combining the env vars for the resolved environment with those from the package spec.

The environment variables being fed into the substitution engine did not
include the build environment variables, such as
`$SPK_PKG_VERSION_MAJOR`. Users expect to be able to use these vars when
generating activation scripts.

Add some tests to verify expected substitution behavior.

`get_package_build_env` refactored into a `trait Package` method since
now this needs to be called from code that lives in the schema crate.

Signed-off-by: J Robert Ray <jrray@jrray.org>
@jrray jrray force-pushed the inst-env-var-expansion branch from 2334dfb to 97e2ba5 Compare June 22, 2024 05:06
@jrray jrray merged commit 4303f55 into main Jun 22, 2024
7 checks passed
@jrray jrray deleted the inst-env-var-expansion branch June 22, 2024 05:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working SPI AOI Area of interest for SPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants