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

Executors should only setup PATH again in activated state. #2711

Closed
wants to merge 1 commit into from

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Aug 17, 2023

TaskDX-2068 State tool "local" executors gobble up environment variables

The other environment variables have already been set.

The first attempt at fixing this assumed that PATH modifications by state shell were complete. However, they were not. Executors also modify PATH based on meta information, so that absolutely needs to be done every time an executor is run. Any other environment variables are already set properly, so they can be ignored.

The other environment variables have already been set.
@mitchell-as mitchell-as requested a review from daved August 17, 2023 21:07
@mitchell-as mitchell-as marked this pull request as ready for review August 17, 2023 21:07
@Naatan Naatan requested review from Naatan and removed request for daved August 18, 2023 17:06
Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

Not actually requesting changes. I think we should close this PR and revert the work done here so far, because as you can see from my other comment this still has significant issues. I think we need to take this back to the drawing board first as it feels like we're playing whack a mole without a strategy (that's not on you - that's just the reality of our initial plan falling apart).

Comment on lines 44 to +45
projectCacheDir := filepath.Join(storage.CachePath(), hash.ShortHash(projectDir))
if projectCacheDir == execDir {
transformEnv = false // runtime environment variables already set
if projectCacheDir == filepath.Dir(execDir) {
Copy link
Member

Choose a reason for hiding this comment

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

I realize this wasn't introduced in this PR, but it just occurred to me that this isn't going to work if someone checked out with a custom path.

Additionally, we can't assume the two sides of the path were constructed the same way. We get around this in other places with this function:

func PathsMatch(paths ...string) (bool, error) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants