webi-installers icon indicating copy to clipboard operation
webi-installers copied to clipboard

[Installer] Add fish for Linux

Open NightMachinery opened this issue 2 years ago • 10 comments

NightMachinery avatar May 17 '23 19:05 NightMachinery

Unfortunately, fish has decided to not support the Webi use case for Windows or Linux: https://github.com/fish-shell/fish-shell/issues/7190

Same as #603, I'd love to have it, but someone would have to do the legwork to convince the authors to publish official builds that Just Work™, or to run a builds repo with bins for Windows and Linux.

Closing for now.

coolaj86 avatar Jun 01 '23 06:06 coolaj86

@coolaj86 What's wrong with their Appimage approach in https://github.com/fish-shell/fish-shell/issues/6475 ? Would it have sandboxing issues or sth?

NightMachinery avatar Jun 02 '23 05:06 NightMachinery

@NightMachinery I'm not sure how well the AppImage approach would or wouldn't work, but they never took it. The release never became available.

If they did make it available I'd investigate using it.

coolaj86 avatar Jun 06 '23 17:06 coolaj86

Heyo! https://github.com/fish-shell/fish-shell/releases/tag/4.0.0

We are so back!

coolaj86 avatar Mar 05 '25 23:03 coolaj86

Hello! I'd love to work on this as my first contribution. Your inputs would be valuable!

detox-24 avatar Mar 06 '25 15:03 detox-24

Hello @detox-24, I imagine that fish v4 will follow the standard formula as per https://github.com/webinstall/webi-installers/issues/661.

Most of the installers are very similar, but some have some special cases. Watch that video, download the new fish v4 files, and see what kind of package they most resemble. #412 shows examples that can be used.

Hit me up if you have any questions.

coolaj86 avatar Mar 06 '25 21:03 coolaj86

Greetings again @coolaj86 ! The fish release packages doesn't explicitly mention 'linux' in their filenames and thus, osMap in normalize.js fails to identify the correct package. I figured I could tinker the normalize.js to identify os through file extensions (tar.xz in this case) after it fails to identify explicit os names.

Is it advisable? Does it pose threat to other packages?

(Package names of fish for your ref: fish-static-aarch64-4.0.0.tar.xz fish-static-amd64-4.0.0.tar.xz )

detox-24 avatar Mar 08 '25 05:03 detox-24

No, take a look at other releases.js files.

That's where to manually tag the os and such.

I'm not at my computer right now otherwise I'd link to a specific one with similar changes.

If you grep -r '= "windows"' ./*/releases.js I'm sure some will pop up.

coolaj86 avatar Mar 08 '25 05:03 coolaj86

Ah! Okay then, I'll look up at other files. And no, that grep didn't return any files.

Good day!

detox-24 avatar Mar 08 '25 05:03 detox-24

Hello, @coolaj86 ! I mapped the os like you said in releases .js and it looks something like this:

Releases.latest = async function () {
  let all = await github(null, owner, repo);
	all.releases = all.releases.map((rel) => {
		if(rel.name.includes('fish-static')) {
			rel.os = 'linux';
			if(/aarch64/.test(rel.name)){
				rel.arch = 'arm64';
			}
			else if(/amd64/.test(rel.name)) {
				rel.arch = 'x86_64';
			}
		}
		else if(rel.name.endsWith('.pkg') || rel.name.endsWith('app.zip')) {
			rel.os = 'macos';
		}
		else if(rel.name.endsWith('tar.xz')){
			rel.os = 'linux';
		}
		return rel;
	});
  return all;
};

But now the issue is with libc, any insights?

PACKAGE FORMAT CHANGE for 'fish':
fish: target detected wrong libc for {NAME},static,linux,x86_64: none != @'gnu'
{
  name: 'fish-static-linux-x86_64.tar.xz',
  version: '4.0b1',
  lts: false,
  channel: 'beta',
  date: '2024-12-17',
  os: 'linux',
  arch: '',
  ext: '',
  download: 'https://github.com/fish-shell/fish-shell/releases/download/4.0b1/fish-static-linux-x86_64.tar.xz',
  libc: 'gnu'
}

Found release matching current os, arch, and tag:
{
  triplets: [ 'x86_64-apple-darwin-none' ],
  oses: [ 'darwin' ],
  arches: [ 'x86_64' ],
  libcs: [ 'none' ],
  formats: [ '.app.zip', '.pkg' ],
  latest: '4.0.1',
  stable: '4.0.1',
  name: 'doesntexist.ext',
  version: '0.0.0',
  lts: '-',
  channel: 'error',
  date: '1970-01-01',
  os: 'linux',
  arch: 'x86_64',
  libc: 'gnu',
  ext: 'err',
  download: 'https://example.com/doesntexist.ext',
  comment: "No matches found. Could be bad or missing version info,Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&libc={musl|gnu|msvc|libc|static}&limit=10'"
}

detox-24 avatar Mar 16 '25 16:03 detox-24