supercollider / sc3-plugins

Community plugins for SuperCollider
https://supercollider.github.io/sc3-plugins/
GNU General Public License v2.0
458 stars 122 forks source link

GHA: remove ._ files from macOS zip #379

Closed metayan closed 2 months ago

metayan commented 3 months ago

To get rid of these errors when starting scsynth:

*** ERROR: dlopen '[...]/Extensions/sc3-plugins/SC3plugins/AYUGens/._AY_UGen.scx' err 'dlopen([...]/Extensions/sc3-plugins/SC3plugins/AYUGens/._AY_UGen.scx, 2): no suitable image found. Did find: [...]/Extensions/sc3-plugins/SC3plugins/AYUGens/._AY_UGen.scx: file too short

capital-G commented 3 months ago

Thx for the PR. But isn't the existence of these files a hint to a faulty CMake file or why are they there in the first place?

metayan commented 3 months ago

I suspect the zip program that is used on the build machine. Maybe in combination with the filesystem. Wouldn't suspect cmake.

I haven't been able to replicate the generation of the '._' files on a real macOS Catalina. It seems that either the zip used here is different or the filesystem behaves differently than on the system where the releases are built.

By the way, I tried to test the fix on GitHub by activating Actions, and everything got built except the macOS version, because the macOS runner refused to start.

dyfer commented 2 months ago

I tried downloading the 3.13.0 release zip, unpacked it in my Downloads folder and I don't see any hidden files:

% ls -al sc3-plugins/SC3plugins/AYUGens
total 624
drwxr-xr-x@  7 marcin  staff     224 Feb 24  2023 .
drwxr-xr-x@ 46 marcin  staff    1472 Feb 24  2023 ..
-rw-r--r--@  1 marcin  staff     484 Feb 24  2023 AY.sc
-rw-r--r--@  1 marcin  staff     343 Feb 24  2023 AYUGens.html
-rwxr-xr-x@  1 marcin  staff  152064 Feb 24  2023 AY_UGen.scx
-rwxr-xr-x@  1 marcin  staff  152096 Feb 24  2023 AY_UGen_supernova.scx
drwxr-xr-x@  3 marcin  staff      96 Feb 24  2023 HelpSource

I.e. I don't see the issue that you're reporting.

Also, IF the issue indeed happens, a better solution would be to not include hidden files in the zip in the first place, instead of removing them afterwards.

BTW we probably need to update the macOS runner in GHA since macos-11 image has been removed and that's why macOS jobs don't run anymore.

metayan commented 2 months ago

I tried downloading the 3.13.0 release zip, unpacked it in my Downloads folder and I don't see any hidden files

unzip -l sc3-plugins-3.13.0-macOS.zip
Archive:  sc3-plugins-3.13.0-macOS.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-24-2023 17:27   sc3-plugins/
      780  02-24-2023 12:33   sc3-plugins/README.txt
      212  02-24-2023 12:33   sc3-plugins/._README.txt
        0  02-24-2023 17:40   sc3-plugins/SC3plugins/
        0  02-24-2023 17:40   sc3-plugins/SC3plugins/AYUGens/
      343  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/AYUGens.html
      212  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/._AYUGens.html
        0  02-24-2023 12:45   sc3-plugins/SC3plugins/AYUGens/HelpSource/
        0  02-24-2023 12:45   sc3-plugins/SC3plugins/AYUGens/HelpSource/Classes/
     6905  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/HelpSource/Classes/AY.schelp
      212  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/HelpSource/Classes/._AY.schelp
      212  02-24-2023 12:45   sc3-plugins/SC3plugins/AYUGens/HelpSource/._Classes
      212  02-24-2023 12:45   sc3-plugins/SC3plugins/AYUGens/._HelpSource
      484  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/AY.sc
      212  02-24-2023 12:32   sc3-plugins/SC3plugins/AYUGens/._AY.sc
   152064  02-24-2023 17:40   sc3-plugins/SC3plugins/AYUGens/AY_UGen.scx
      212  02-24-2023 17:40   sc3-plugins/SC3plugins/AYUGens/._AY_UGen.scx
   152096  02-24-2023 17:40   sc3-plugins/SC3plugins/AYUGens/AY_UGen_supernova.scx
      212  02-24-2023 17:40   sc3-plugins/SC3plugins/AYUGens/._AY_UGen_supernova.scx
      212  02-24-2023 17:40   sc3-plugins/SC3plugins/._AYUGens
[...]

After unpacking using

unzip sc3-plugins-3.13.0-macOS.zip
ls -Al sc3-plugins/SC3plugins/AYUGens
total 576
-rwxrwxrwx 1 yan staff    212 Feb 24  2023 ._AY.sc
-rwxrwxrwx 1 yan staff    212 Feb 24  2023 ._AYUGens.html
-rwxrwxrwx 1 yan staff    212 Feb 24  2023 ._AY_UGen.scx
-rwxrwxrwx 1 yan staff    212 Feb 24  2023 ._AY_UGen_supernova.scx
-rwxrwxrwx 1 yan staff    212 Feb 24  2023 ._HelpSource
-rwxrwxrwx 1 yan staff    484 Feb 24  2023 AY.sc
-rwxrwxrwx 1 yan staff    343 Feb 24  2023 AYUGens.html
-rwxrwxrwx 1 yan staff 152064 Feb 24  2023 AY_UGen.scx
-rwxrwxrwx 1 yan staff 152096 Feb 24  2023 AY_UGen_supernova.scx
drwxrwxrwx 1 yan staff  32768 Aug 17 01:21 HelpSource

It seems that the ._* files are created by macOS on a non-macOS filesystem to store some Apple-specific attributes. I'm guessing that the releases are built on a non-macOS filesystem.

Anyway, trying to exclude the ._* files with zip -r pack.zip sc3-plugins -x ._\* should work, but doesn't.

tar jcvf pack.tar.bz2 --exclude ._\* sc3-plugins correctly excludes the ._* files, so switching to tar for the macOS version is a solution, and since macOS is sort of UNIXy, it's quite appropriate. ;)

metayan commented 2 months ago

Tip:

If unpacking using unzip, running

dot_clean sc3-plugins

afterwards cleans out the ._* files.

metayan commented 2 months ago

Newer macOS runner doesn't include the ._* files - as demonstrated in #380. Closing.

dyfer commented 2 months ago

Thanks for the update. FWIW on my system when testing the 3.13 release zip, when I unzip the file by double clicking it in Finder, the dot files are not included in the resulting folder. When I unpack it using the unzip command, then indeed I can see the dot files.