Bundle support plist broken on Mojave

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Bundle support plist broken on Mojave

Jacob Carlborg
I have a bundle command implemented in Ruby that uses TextMate.detatch. The tm/detach.rb requires ui.rb which requires plist.bundle. Loading the plist bundle crashes with a segmentation fault. The issue occurs on Mojave but not on High Sierra. I’m using "/usr/bin/env ruby20” as the Ruby for running the command. The command is available here [1].


-- 
/Jacob Carlborg



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Allan Odgaard-4

On 14 Dec 2018, at 17:19, Jacob Carlborg wrote:

I have a bundle command implemented in Ruby that uses TextMate.detatch. The tm/detach.rb requires ui.rb which requires plist.bundle. Loading the plist bundle crashes with a segmentation fault. The issue occurs on Mojave but not on High Sierra. I’m using "/usr/bin/env ruby20” as the Ruby for running the command. The command is available here [1].

A lot of the ruby library code is only safe to use with ruby18, including the plist extension.



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Jacob Carlborg

On 14 Dec 2018, at 17:19, Jacob Carlborg wrote:

I have a bundle command implemented in Ruby that uses TextMate.detatch. The tm/detach.rb requires ui.rb which requires plist.bundle. Loading the plist bundle crashes with a segmentation fault. The issue occurs on Mojave but not on High Sierra. I’m using "/usr/bin/env ruby20” as the Ruby for running the command. The command is available here [1].

A lot of the ruby library code is only safe to use with ruby18, including the plist extension.


I don’t have any interest in using the plist extension in this command. But it’s indirectly included in other parts of the support code. Is there any plans on updating the the bundle support code for Ruby 2.x?

-- 
/Jacob Carlborg



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Allan Odgaard-4

On 15 Dec 2018, at 2:34, Jacob Carlborg wrote:

I don’t have any interest in using the plist extension in this command. But it’s indirectly included in other parts of the support code. Is there any plans on updating the the bundle support code for Ruby 2.x?

The problem is that many bundle commands need ruby 1.8, so the bundle support code needs to remain compatible with 1.8 as well.

This is support code has been written by a dozen different people over several years, I have no plans of rewriting it all to be compatible with both ruby 1.8 and 2.x, which in itself is not a fun excercise, not even sure we can make the plist extension compatible with both versions of ruby without switching to a version written entirely in ruby.

My advice: If you want to use ruby 2.x for your custom commands, don’t use the support code.

In retrospect we probably shouldn’t have made a “shared support” directory, at least not without much much stricter discipline, as now we have a ton of legacy stuff that is pretty difficult to get rid of, because we have no idea about which third party bundles rely on it.



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Jacob Carlborg

On 15 Dec 2018, at 09:13, Allan Odgaard <[hidden email]> wrote:

The problem is that many bundle commands need ruby 1.8, so the bundle support code needs to remain compatible with 1.8 as well.

This is support code has been written by a dozen different people over several years, I have no plans of rewriting it all to be compatible with both ruby 1.8 and 2.x, which in itself is not a fun excercise, not even sure we can make the plist extension compatible with both versions of ruby without switching to a version written entirely in ruby.

Understandable. I’ve been wanting to completely re-implement the support code with support for 2.0 now for a while. But I’ve never prioritized it.

My advice: If you want to use ruby 2.x for your custom commands, don’t use the support code.

Yeah, in fact, most of my commands are written in Ruby 2.0 but one of them is using Ruby 1.8 to be able to use the completion window.

In this case I see now that TextMate.detach is simple enough to copy to the bundle and remove the dependency on TextMate::UI.

In retrospect we probably shouldn’t have made a “shared support” directory, at least not without much much stricter discipline, as now we have a ton of legacy stuff that is pretty difficult to get rid of, because we have no idea about which third party bundles rely on it.

The support code, at least the Ruby code, could be implemented as a separate gem. Then it could be versioned like any other gem. I have a bundle [1] where the whole Support directory is organized as a Ruby gem. It uses Bundler and several gems as dependencies. The gems are bundled directly in the Support directory and included in the Git repository. This works out quite nicely.


-- 
/Jacob Carlborg



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

phuibonhoa
Does Mojave still have Ruby 1.8 available?  I have bundle files referencing /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby but that directory does not exist.  I'm not sure how to proceed, since this does break some functionality.  

On Sat, Dec 15, 2018 at 12:29 AM Jacob Carlborg <[hidden email]> wrote:
On 15 Dec 2018, at 09:13, Allan Odgaard <[hidden email]> wrote:

The problem is that many bundle commands need ruby 1.8, so the bundle support code needs to remain compatible with 1.8 as well.

This is support code has been written by a dozen different people over several years, I have no plans of rewriting it all to be compatible with both ruby 1.8 and 2.x, which in itself is not a fun excercise, not even sure we can make the plist extension compatible with both versions of ruby without switching to a version written entirely in ruby.

Understandable. I’ve been wanting to completely re-implement the support code with support for 2.0 now for a while. But I’ve never prioritized it.

My advice: If you want to use ruby 2.x for your custom commands, don’t use the support code.

Yeah, in fact, most of my commands are written in Ruby 2.0 but one of them is using Ruby 1.8 to be able to use the completion window.

In this case I see now that TextMate.detach is simple enough to copy to the bundle and remove the dependency on TextMate::UI.

In retrospect we probably shouldn’t have made a “shared support” directory, at least not without much much stricter discipline, as now we have a ton of legacy stuff that is pretty difficult to get rid of, because we have no idea about which third party bundles rely on it.

The support code, at least the Ruby code, could be implemented as a separate gem. Then it could be versioned like any other gem. I have a bundle [1] where the whole Support directory is organized as a Ruby gem. It uses Bundler and several gems as dependencies. The gems are bundled directly in the Support directory and included in the Git repository. This works out quite nicely.


-- 
/Jacob Carlborg


_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Jacob Carlborg

On 31 Jan 2019, at 05:54, Philippe Huibonhoa <[hidden email]> wrote:

Does Mojave still have Ruby 1.8 available?  I have bundle files referencing /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby but that directory does not exist.  I'm not sure how to proceed, since this does break some functionality.  

Use the following shebang line: "#!/usr/bin/env ruby18”. TextMate will automatically download Ruby 1.8 if it’s not available.

--
/Jacob Carlborg



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Marc Wilson
From where?  Just curious.

--
Marc Wilson


On Thu, Jan 31, 2019, at 7:25 AM, Jacob Carlborg wrote:

On 31 Jan 2019, at 05:54, Philippe Huibonhoa <[hidden email]> wrote:

Does Mojave still have Ruby 1.8 available?  I have bundle files referencing /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby but that directory does not exist.  I'm not sure how to proceed, since this does break some functionality.  

Use the following shebang line: "#!/usr/bin/env ruby18”. TextMate will automatically download Ruby 1.8 if it’s not available.

--
/Jacob Carlborg


_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Jacob Carlborg

On 1 Feb 2019, at 17:01, Marc Wilson <[hidden email]> wrote:

From where?  Just curious.

I don’t know. You would have to look at the source code or wait for a reply from Allan.

-- 
/Jacob Carlborg



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

phuibonhoa
In reply to this post by Jacob Carlborg
Thank you for that tip Jacob, lifesaver!

On Thu, Jan 31, 2019 at 7:24 AM Jacob Carlborg <[hidden email]> wrote:

On 31 Jan 2019, at 05:54, Philippe Huibonhoa <[hidden email]> wrote:

Does Mojave still have Ruby 1.8 available?  I have bundle files referencing /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby but that directory does not exist.  I'm not sure how to proceed, since this does break some functionality.  

Use the following shebang line: "#!/usr/bin/env ruby18”. TextMate will automatically download Ruby 1.8 if it’s not available.

--
/Jacob Carlborg


_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Bundle support plist broken on Mojave

Allan Odgaard-4
In reply to this post by Marc Wilson

On 1 Feb 2019, at 17:01, Marc Wilson wrote:

On 31 Jan 2019, at 05:54, Philippe Huibonhoa <[hidden email]> wrote:
Does Mojave still have Ruby 1.8 available? I have bundle files referencing /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby but that directory does not exist. I'm not sure how to proceed, since this does break some functionality.

Use the following shebang line: "#!/usr/bin/env ruby18”. TextMate will automatically download Ruby 1.8 if it’s not available.

From where? Just curious.

It is downloaded from our server, I think Michael just packaged the ruby 1.8 version from homebrew, but not sure.



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate