Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on WSL #18

Closed
peterlobster opened this issue Jun 6, 2021 · 7 comments
Closed

Not working on WSL #18

peterlobster opened this issue Jun 6, 2021 · 7 comments

Comments

@peterlobster
Copy link

peterlobster commented Jun 6, 2021

This plugin isn't working with my instance of Debian (which is really Pengwin, which is Debian, plus a few extra WSL things) on WSL.

What's going on is that I can't really install anything cause $ asdf list all flutter isn't producing any output. Originally, jq was having a permission error because wasn't it allowed to execute (although it's set to here), but I fixed that with chmod 755 ..., but I still get no output from $ asdf list all flutter.

Also, when I try $ asdf install flutter latest, I get back flutter is already installed. When I run $ asdf latest flutter, I get nothing back.

$ uname -m
x86_64
$ uname -s
Linux
@peterlobster
Copy link
Author

peterlobster commented Jun 7, 2021

So the problem is jq...

$ ~/.asdf/plugins/flutter/bin/jq
Segmentation fault

I noticed that in asdf-flutter/bin/jq-downloader, it pulls from https://github.com/stedolan/jq/releases/, which looks like hasn't been issued a new release in some time (despite a lot of new work that has already been committed). I also noticed that it was possible the segmentation fault error appeared to related to gcc 6, so I thought maybe I just need to get a fresh copy of jq.

So what I did to fix this is I installed jq via Linuxbrew (Homebrew has a reputation for staying fairly current), and then I changed this line in asdf-flutter/bin/list-all (and likewise, I changed the same line in asdf-flutter/bin/install) to jq="$(brew --prefix jq)/jq. Now, everything appears functional.

Now, this is not a very good long-term or elegant solution, as this fix really only works if you install jq with brew; but perhaps, it could be changed so that adsf-flutter trys to detect if you have jq pre-installed, before falling back on the old releases?

@oae
Copy link
Collaborator

oae commented Jun 7, 2021

Thank you for the feedback. I will look into this and try to find a solution.

@peterlobster
Copy link
Author

peterlobster commented Jun 7, 2021

@oae Couldn't we wrap the installer script in something like this?

if local_jq="$(type -p "$jq")" || [[ -x $local_jq ]]; then
  echo "jq is already installed"
else
  # Install jq
fi

Still doesn't really address the old releases on GitHub though. Maybe we should build our own jq package to ensure compatibility? That's the only real solution I can think of...unless we can source a more recent version of jq. I think brew compiles their packages and keeps them on Bintray, or at least they used to. I think they've been moving them to GitHub or at least, away from Bintray, I think.

@oae
Copy link
Collaborator

oae commented Jun 7, 2021

It seems like the scope of the new version for jq is too big. They are discussing it in jqlang/jq#2305. Building it from the source would add many dependencies to the plugin. Also, I checked the homebrew formula. It seems like only the mac version has the binary.

I could switch to fx. But I need to check its functionality before the switch.

@peterlobster
Copy link
Author

@oae Oh, I didn't see that. I do know brew has a bottle though for x86_64_linux though. However, I still don't like the idea of being dependant on a 3rd-party package manager.

I think finding a better alternative of jq sounds appealing. Hopefully fx works out.

@peterlobster
Copy link
Author

peterlobster commented Jun 11, 2021

@oae Just a realization I had, asdf can only really be installed via Homebrew and git on Linux, so I guess installing jq via brew isn't the worst idea...especially if you already installed asdf via brew. 😁 #JustSaying

@oae oae closed this as completed in 5ee540c Jun 22, 2021
@oae
Copy link
Collaborator

oae commented Jun 22, 2021

@oae Couldn't we wrap the installer script in something like this?

if local_jq="$(type -p "$jq")" || [[ -x $local_jq ]]; then
  echo "jq is already installed"
else
  # Install jq
fi

Still doesn't really address the old releases on GitHub though. Maybe we should build our own jq package to ensure compatibility? That's the only real solution I can think of...unless we can source a more recent version of jq. I think brew compiles their packages and keeps them on Bintray, or at least they used to. I think they've been moving them to GitHub or at least, away from Bintray, I think.

I implemented as you said instead of using fx. It will now use system jq if exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants