Skip to content

Commit

Permalink
Do not try to guess image pharo version. Too unreliable.
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Jan 9, 2024
1 parent 770d6dc commit 9aa544b
Show file tree
Hide file tree
Showing 30 changed files with 123 additions and 716 deletions.
4 changes: 1 addition & 3 deletions src/PharoLauncher-Core/PhLImage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,10 @@ PhLImage >> launchWithConfiguration: aPhLLaunchConfiguration [
^ self ].
architectureWarningEnabled := true.
continue := true.
[ [ | processWrapper|
[ | processWrapper|
processWrapper := (aPhLLaunchConfiguration launchProcess) runUnwatch.
self doNotRunInitializationScript. "Just run, image already initialized"
^ processWrapper ]
on: PhLImageVersionDeterminationError
do: [ :error | error uiAlert ] ]
on: PhLArchitectureMismatchWarning
do: [ :warning |
architectureWarningEnabled ifTrue: [
Expand Down
37 changes: 0 additions & 37 deletions src/PharoLauncher-Core/PhLImageVersionDeterminationError.class.st

This file was deleted.

22 changes: 22 additions & 0 deletions src/PharoLauncher-Core/PhLImageVersionFileNotFound.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"
Error thrown when Pharo Launcher did not succeed to determine the Pharo version of the image to launch.
Probably, the run command failed.
I hold the command run to determoine the version so that it can be reused for debugging purposes.
"
Class {
#name : #PhLImageVersionFileNotFound,
#superclass : #PhLError,
#category : #'PharoLauncher-Core-Download'
}

{ #category : #accessing }
PhLImageVersionFileNotFound >> longDescription [
^ PhLImage versionFileName ,
' file was not found for your image, and probably your VMs are not up to date.
Please, contact us at http://pharo.org/community'
]

{ #category : #accessing }
PhLImageVersionFileNotFound >> name [
^ 'Image version file ', PhLImage versionFileName , ' not found!'
]
7 changes: 4 additions & 3 deletions src/PharoLauncher-Core/PhLLaunchConfiguration.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ PhLLaunchConfiguration >> commandString [

{ #category : #querying }
PhLLaunchConfiguration >> defaultVm [
self image ensurePharoVersion.
self image pharoVersion.
^ self image vmManager virtualMachine
]

Expand Down Expand Up @@ -128,7 +128,8 @@ PhLLaunchConfiguration >> initializeWithImage: anImage [
image := anImage.
name := 'new configuration...'.
usePharoSettings := true.
imageArguments := anImage defaultArguments
imageArguments := anImage defaultArguments.
image ensurePharoVersion
]

{ #category : #testing }
Expand Down Expand Up @@ -168,7 +169,7 @@ PhLLaunchConfiguration >> printOn: aStream [
{ #category : #configuring }
PhLLaunchConfiguration >> useSettings: aBoolean [
"Cannot skip Pharo settings before Pharo 3.0"
self image ensurePharoVersion asInteger < 30 ifTrue: [ ^ self ].
self image pharoVersion asInteger < 30 ifTrue: [ ^ self ].

usePharoSettings := aBoolean.
]
Expand Down
3 changes: 1 addition & 2 deletions src/PharoLauncher-Core/PhLLaunchImageCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ PhLLaunchImageCommand >> launchConfigurationOfImage: aPhLImage [
PhLLaunchImageCommand >> launchImage: aPhLImage [
| process launchConfig |

[
launchConfig := self launchConfigurationOfImage: aPhLImage.
[ launchConfig := self launchConfigurationOfImage: aPhLImage.
launchConfig useSettings: useSettings.
process := aPhLImage launchWithConfiguration: launchConfig ]
on: PhLError
Expand Down
27 changes: 0 additions & 27 deletions src/PharoLauncher-Core/PhLPrivateVirtualMachine.class.st

This file was deleted.

28 changes: 0 additions & 28 deletions src/PharoLauncher-Core/PhLToggleVmPrivateVmCommand.class.st

This file was deleted.

20 changes: 8 additions & 12 deletions src/PharoLauncher-Core/PhLVirtualMachine.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,14 @@ Class {

{ #category : #'instance creation' }
PhLVirtualMachine class >> directory: aFileReference [
^ self
directory: aFileReference
private: false
]

{ #category : #'instance creation' }
PhLVirtualMachine class >> directory: aFileReference private: isPrivateVm [
| targetClass |
targetClass := self allSubclasses detect: [ :cls | cls isSubclassForDirectory: aFileReference private: isPrivateVm ] ifNone: [ self ].
^ targetClass new
initializeOn: aFileReference;
yourself
targetClass := self allSubclasses
detect: [ :cls | cls isSubclassForDirectory: aFileReference ]
ifNone: [ self ].
^ targetClass new
initializeOn: aFileReference;
yourself
]

{ #category : #accessing }
Expand Down Expand Up @@ -80,9 +76,9 @@ PhLVirtualMachine class >> id: aString [
]

{ #category : #testing }
PhLVirtualMachine class >> isSubclassForDirectory: aFileReference private: isPrivateVm [
PhLVirtualMachine class >> isSubclassForDirectory: aFileReference [

^ isPrivateVm not and: [ aFileReference basename beginsWith: self versionPrefix ]
^ aFileReference basename beginsWith: self versionPrefix
]

{ #category : #accessing }
Expand Down
Loading

0 comments on commit 9aa544b

Please sign in to comment.