pharo icon indicating copy to clipboard operation
pharo copied to clipboard

[Iceberg] Always "CannotDeleteFileException" when trying to remove a repository and these files

Open labordep opened this issue 1 year ago • 6 comments

image

My use-case in the video below: I load a repository using a script, and finally I want to remove it.

  1. Load a repository using a playground, for example:
Metacello new
	repository: 'github://juliendelplanque/SQLite3/src';
	baseline: 'SQLite3';
	load
  1. (optionnal) Unload each packages to remove the code
  2. Remove the repository from Iceberg, I want to remove file from the disk, and Error! image

This problem keeps happening every time I try to delete files from the repository.

Video with the example: https://github.com/pharo-project/pharo/assets/49183340/c458b549-e41b-4089-aa43-e7e933304637

My config:

  • Pharo-11.0.0+build.721
  • VM 10.0.9
  • Windows 11 Pro 64bits

labordep avatar Jan 20 '24 11:01 labordep

I do not think that this is related to iceberg but file or FileReference. Did you succeed to delete the file when you use File deleteFile:? What are the file attributes? Because we cannot debug it since for example on my machine this is always working.

Ducasse avatar Jan 20 '24 12:01 Ducasse

You are likely correct because when attempting to delete various items, such as images or repositories, on Windows, we encounter this error. This is probably attributed to the file management approach used for Windows. I am surprised that no one has raised this issue yet. We have been dealing with it for years, but I would really like to help fixing that because it's really cumbersome.

labordep avatar Jan 20 '24 13:01 labordep

I'm testing that:

File deleteFile: 'C:\Users\labor\Documents\Pharo\images\SQLite3\pharo-local\iceberg\pharo-rdbms\Pharo-SQLite3\src\SQLite3-Core'

And I have the exception :)

image

labordep avatar Jan 20 '24 13:01 labordep

But it is probably normal to have this error at this point, maybe Iceberg place locks on files during Pharo execution ? I don't know.

labordep avatar Jan 20 '24 13:01 labordep

I do it often and I do not get the problems so there is something more. May be the libgit it doing something special.

Ducasse avatar Jan 20 '24 19:01 Ducasse

We should try on windows.

Ducasse avatar Jan 20 '24 19:01 Ducasse