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

Deprecate asFileName and re-write system senders #16169

Open
wants to merge 9 commits into
base: Pharo12
Choose a base branch
from

Conversation

hernanmd
Copy link
Contributor

@hernanmd hernanmd commented Feb 14, 2024

As reported in #16123, this PR should be applied along with the PR in NewTools-Fuel. It is a small PR to clean dependencies which could bring problems when removing old FileList.

Note that FileList senders were not re-written as it is planned to be deprecated too.

Note that FileList senders were not re-written as it is planned to be deprecated too.
@guillep
Copy link
Member

guillep commented Feb 15, 2024

If you ask me (which you did not :P) I'd simply remove the calls to asFileName.
It's implementation is super weird: it (sometimes!) rewrites the paths! This could hide application bugs and make me developer think I'm opening a file here but actually opening a file there.

Also, for the file too long or invalid paths, we are already validating that (it's the OS when we open the file haha !)

My take

  • I'd not inline the implementation anywhere.
  • I'd just deprecate the method, not use it anymore, remove it next version
  • people should provide correct file paths, and we should provide nice errors to help them find bugs

Thoughts?

@hernanmd hernanmd added the Status: Need more work The issue is nearly ready. Waiting some last bits. label Feb 15, 2024
@hernanmd
Copy link
Contributor Author

Yes, this PR already moves the method to Deprecated12.

It seems this method comes from the ages of Squeak, I've found a single user (CodeExporter) and it lacks testing.
So next step I will add tests and then re-implement the method to see that without asFileName still is green.

src/CodeExport/CodeExporter.class.st Outdated Show resolved Hide resolved
@jecisc
Copy link
Member

jecisc commented Feb 19, 2024

Now the result is different:

FLFuelOutTests
 ✗ #testFuelOutWriteArrayFile (2ms)
TestFailure: Assertion failed
FLFuelOutTests(TestAsserter)>>assert:description:resumable:
FLFuelOutTests(TestAsserter)>>assert:description:
FLFuelOutTests(Object)>>assert:
FLFuelOutTests>>testFuelOutWriteArrayFile ...assert: fileName asFileReference exists
FLFuelOutTests(TestCase)>>performTest
 ✗ #testFuelOutWriteFileVersioned (6ms)
TestFailure: Assertion failed
FLFuelOutTests(TestAsserter)>>assert:description:resumable:
FLFuelOutTests(TestAsserter)>>assert:description:
FLFuelOutTests(Object)>>assert:
FLFuelOutTests>>testFuelOutWriteFileVersioned ...assert: fileName asFileReference exists
FLFuelOutTests(TestCase)>>performTest
 ✗ #testFuelOutWriteFile (1ms)
TestFailure: Assertion failed
FLFuelOutTests(TestAsserter)>>assert:description:resumable:
FLFuelOutTests(TestAsserter)>>assert:description:
FLFuelOutTests(Object)>>assert:
FLFuelOutTests>>testFuelOutWriteFile ...assert: fileName asFileReference exists
FLFuelOutTests(TestCase)>>performTest

@hernanmd
Copy link
Contributor Author

I saw now the failures seems not related (@jecisc can you confirm?)

osx-64 / Tests-osx-64 / testExternalIDEDependencies – MacOSX64.System.DependenciesTests.SystemDependenciesTest7s
unix-64 / Tests-unix-64 / testExternalIDEDependencies – Unix64.System.DependenciesTests.SystemDependenciesTest10s
osx-64 / Tests-osx-64 / testFlushOtherEndClosed – MacOSX64.Network.Tests.SocketStreamTest7s
unix-64 / Tests-unix-64 / testFlushLargeMessageOtherEndClosed – Unix64.Network.Tests.SocketStreamTest

@jecisc
Copy link
Member

jecisc commented Feb 22, 2024

Yes. But I've seen failures in the NewTools PR I think

@jecisc jecisc removed the Status: Need more work The issue is nearly ready. Waiting some last bits. label Feb 22, 2024
@Ducasse
Copy link
Member

Ducasse commented Mar 12, 2024

For P13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

4 participants