Problem with .rbz publishing: "The root directory must only contain one directory. Found 'XXX' and '/'"

Hi,

i want to publish my extension in the Extension Warehouse but can’t get it through the automatic Extension validation. I keep getting the following

RBZ Problem: The root directory must only contain one directory. Found "3dis_CityEditor" and "/".

The contents of my .rbz has the following structure:

[DIR]  3dis_CityEditor
   [DIR]  Attribute
   [DIR]  Dialog
   [DIR]  Edit
   [DIR]  Export
   [DIR]  Import
   [DIR]  Model
   [DIR]  Services
   [DIR]  Shared
   [DIR]  UI
   [DIR]  Validator
   [FILE] Loader.rbs
   [FILE] Preloader.rb
[FILE] 3dis_CityEditor.rbs

As far as i can tell this complies with the RBZ requirements.

I can’t for the life of me figure out what the problem is. Could this be some bug in the Warehouse’s Extension validation mechanism?

Regards
Ender

What are you using to create the zip archive with ?

If your using 7Zip, try these options (pay attention to the Compression and Encryption method choices.)

I already had a hunch that the archiver might create some bogus directory entries and therefore tried repackaging the .rbz with 7zip (ZIP archive type), WinRAR (ZIP archive type) and WinZIP on Windows as well as zip on Ubuntu. The result, unfortunately, is always the same.

I did not use the ZipCrypto option in 7zip but will give it a try now report back on the result.

Could be website error. Or just that their code expects something else.

Example. I have never seen an extension directory name that began with a numeric digit character.

Usually the first word of the extension name and folder is the author’s/company’s top level Ruby module name (which cannot begin with a digit character.) So you may be trying to do something that will upset the API’s SketchupExtension class.

Ok … ZipCrypto turned out to be the default. So no change after repackaging the .rbz again.

I tried it without scrambling the .rb files into .rbs files first though. Without the scrambling step the archive is accepted. Could it be that the top-level script file needs to be unscrambled? Do all script files need to be unscrambled?

There used to be issues when the the loader file that was eval’d by the extension’s load() method was scrambled. (The subsequent ruby files were evaluated within the wrong scope, instead of the top level scope TOPLEVEL_BINDING. So there was the need for an unscrambled “loader” file.) But it was supposed to have been fixed around SU2013 or so.

For newer versions that use Ruby 2.x or higher, all your scripts must be UTF-8 encoded (without Bit Order Mark,) … even those that are to be scrambled.

Secondly, be sure to use End of Lines that work for both platforms. I use UNIX type EOLs, but others also use WIndows type EOLs.

I thought there was still a need for the ‘Extension’ file to be a plain .rb
I can see no reason for it to be scrambled…
john

Ok … i got it sorted out: I skipped scrambling for the top-level script file and just scrambled all files from the extension directory on down. With this modification the extension archive is accepted. SketchUp itself, however, does also correctly load the extension even if the inital script is (although unnecessary) scrambled.

Thanks for the help!!

OK, just remember old versions may still have the scoping issue if your “preloader” file is scrambled. (If you only support Ruby 2.x, which is SketchUp 2014 or later, than this issue was fixed and you need not worry.)