CARTAvis / carta-backend

Source code repository for the backend component of CARTA, a new visualization tool designed for the ALMA, the VLA and the SKA pathfinders.
https://cartavis.github.io/
GNU General Public License v3.0
22 stars 11 forks source link

CLI arg splitting regression between v4.0.0 and v4.1.0 on macOS #1363

Open d3v-null opened 6 months ago

d3v-null commented 6 months ago

Describe the bug

I prefer to use Carta in Chrome, which is not my default browser, so I normally launch carta like this --browser='open -a Google\ Chrome'

This previously worked fine in version 4.0.0 (which I installed through homebrew), but something has changed in 4.1.0, so I get this error now.

> carta --browser='open -a Google\ Chrome'
CARTA will use the default ephemerides and geodetic data.
[2024-03-15 13:37:43.028] [critical] Option ‘a’ does not exist

It seems like the -a in the browser command is being interpreted as a command line argument for Carta.

It doesn't like this either

carta --browser='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
The application /Applications/Google http://localhost:3002/?token=9CE04BBD-F58E-45F9-9288-306B7F8ADDD1 cannot be opened for an unexpected reason, error=Error Domain=NSCocoaErrorDomain Code=260 "The file “?token=9CE04BBD-F58E-45F9-9288-306B7F8ADDD1” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Applications/Google%20http://localhost:3002/%3Ftoken=9CE04BBD-F58E-45F9-9288-306B7F8ADDD1, NSFilePath=/Applications/Google http://localhost:3002/?token=9CE04BBD-F58E-45F9-9288-306B7F8ADDD1, NSUnderlyingError=0x600002800450 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
[2024-03-15 06:17:20.831Z] [CARTA] [warning] WebBrowser: Failed to open the browser automatically.

To Reproduce on macOS sierra, carta v4.1.0

carta --browser='open -a "Google Chrome"'

Expected behavior Should open Carta in Chrome like it did on v4.0.0

Platform info (please complete the following information):

Additional context Maybe the meaning of the --browser argument has changed, but if whatever is wrapping carta is not splitting shell arguments correctly, that's probably indicative of a more serious issue.

Thanks!

kswang1029 commented 6 months ago

What happened if you just do carta without the browser flag?

d3v-null commented 6 months ago

it opens the carta url in my default browser (firefox)

some more info on what gets installed by brew:

/opt/homebrew/bin/carta looks like this:

#!/bin/bash
/opt/homebrew/Caskroom/CARTA.app/Contents/Resources/app/carta-backend/bin/carta.sh "$@"

/opt/homebrew/Caskroom/CARTA.app/Contents/Resources/app/carta-backend/bin/carta.sh

#!/bin/bash

dirname=`dirname $0`

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )/../etc"

export CASAPATH="../../../../$DIR linux"

$dirname/casa_data_autoupdate

$dirname/carta_backend $@ --frontend_folder=$dirname/../../
d3v-null commented 6 months ago

I might just add that this may be more of an issue with https://github.com/CARTAvis/homebrew-tap/ rather than carta-backend, since the packaging has changed recently, and I don't get the warning on 4.1.0 on linux.

carta --browser 'curl -a'

should I move this issue over to that repo instead?