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

Working directory should be inherited from CLI #559

Closed
cdlm opened this issue May 11, 2022 · 4 comments · Fixed by #560 or #604
Closed

Working directory should be inherited from CLI #559

cdlm opened this issue May 11, 2022 · 4 comments · Fixed by #560 or #604
Labels
Bug cmd-line Command-line Launcher issue Enhancement

Comments

@cdlm
Copy link
Contributor

cdlm commented May 11, 2022

Context: launching an image via CLI, using the pharo-launcher image launch IMAGENAME command

What happens: the working directory is the image directory (FileSystem disk workingDirectory = FileLocator imageDirectory asFileReference is true).

This is a problem because the user context is lost.

What should happen: the working directory (value of $PWD in the shell that invokes the pharo-launcher wrapper script) should be inherited by the image.

@cdlm
Copy link
Contributor Author

cdlm commented May 12, 2022

See PhLLaunchImageProcessConfigurator >> visit:

visit
	process := PhLProcessWrapper new.
	process workingDirectory: self imageFile parent pathString.
	…

(a quick test after changing that seems to work, PR incoming)

cdlm added a commit to cdlm/pharo-launcher that referenced this issue May 12, 2022
With GUI, launch from image directory (rather than filesystem root).

Fixes pharo-project#559
@Bajger Bajger added the cmd-line Command-line Launcher issue label May 28, 2022
@Bajger Bajger linked a pull request Jun 5, 2022 that will close this issue
cdlm added a commit to cdlm/pharo-launcher that referenced this issue Jun 10, 2022
With GUI, launch from image directory (rather than filesystem root).

Fixes pharo-project#559
@Bajger
Copy link
Member

Bajger commented Apr 4, 2023

@cdlm Hi Damien! It's been a while since you did this change, but could you look at it? CI is failing after integration, see: https://ci.inria.fr/pharo-ci-jenkins2/job/PharoLauncher-Pipeline/job/feature%252Fcmd-line/18/console
I think this is because workingDirectory on image launch configuration returns nil. Probably existing images have already referring to launch config objects:

PhLImage>>defaultLaunchConfiguration
	^ launchConfigurations 
		detect: [ :each | each name = PhLLaunchConfiguration defaultName ]
		ifNone: [ PhLLaunchConfiguration defaultWithImage: self ]

probably existing image launch configuration instances need to be re-initialized with correct working directory. What do you think?

@Bajger
Copy link
Member

Bajger commented Apr 5, 2023

Waiting to CI to be up again. It should be fixed. by PR #604

@Bajger
Copy link
Member

Bajger commented Apr 17, 2023

Resolved by linked PRs.

@Bajger Bajger closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug cmd-line Command-line Launcher issue Enhancement
Projects
None yet
2 participants