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

Use date and time as Stdio windows file name distinguisher #13299

Conversation

jecisc
Copy link
Member

@jecisc jecisc commented Apr 5, 2023

Stdio on windows will sometimes create a new file and since we can have multiple ones, we were generating a random number in the file name. Since the is the only dependency to Random-Core and that I would like to extract it from the KernelGroup of the bootstrap, I propose to use a timestamp instead.

I also added a test to be sure the dependency does not get added again. One last change is the update of the manually resolved dependencies of Files package

Stdio on windows will sometimes create a new file and since we can have multiple ones, we were generating a random number in the file name.
Since the is the only dependency to Random-Core and that I would like to extract it from the KernelGroup of the bootstrap, I propose to use a timestamp instead.

I also added a test to be sure the dependency does not get added again.
One last change is the update of the manually resolved dependencies of Files package

| dependencies |
dependencies := self externalDependendiesOf: #( 'Files' ).
self deny: (dependencies includes: 'Random-Core')
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels weird. If you care about random things not being pulled. Why not just list the dependencies you want instead of blacklisting some that you do not want?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is something that I would like to do later but it requires to check the current dependencies of Files and think about which ones make sense or not and for now I just wanted to focus the extraction of Random-Core from the bootstrap core

Copy link
Member Author

Choose a reason for hiding this comment

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

Some things seems simple, but then I end up spending hours in simple things and not finishing my original fix x_x

@Ducasse
Copy link
Member

Ducasse commented Apr 6, 2023

cyril can we use the nextFileNamed utils in filereference? Because like that it numbers the file automatically

@jecisc
Copy link
Member Author

jecisc commented Apr 6, 2023

I am not sure we have a file reference of the previous stdio here so I went with the time stamp.

But I don’t think it will cause too much trouble to the user because this is a hack anyway happening only on Windows when PharoConsole.exe is not used. And people will even be able to find easily the most recent one since it uses a file compatible timestamps

@jecisc jecisc closed this Apr 6, 2023
@jecisc jecisc reopened this Apr 6, 2023
@MarcusDenker MarcusDenker merged commit ef1c951 into pharo-project:Pharo12 Apr 11, 2023
@jecisc jecisc deleted the cut-dependency-of-Files-over-Random-Core branch April 13, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants