Skip to content

[Bug] webi doesn't resolve 'x64' output the right way in test runs. #1044

@detox-24

Description

@detox-24

Issue

I can't seem to generate working installers due to test.js failing to detect the architecture of host machine correctly.

What I ran?

~$ node _webi/test.js  [any_package_directory]/

What Failed?

{ errors: [], os: 'linux', vendor: 'unknown', libc: 'gnu' }
dbg: Get Project Installer Type for 'lazygit':
[INFO] getLatestBuilds: lazygit
dbg: proj { type: 'valid', detail: true }
tmplParams {
  pkg: 'lazygit',
  tag: '',
  os: 'linux',
  arch: undefined,
  ......
}

Everytime, it fails to identify architecture and returns 'undefined'.

Troubleshooting

~$ node -e "console.log(require('os').arch())"

~$ x64

I looked up on the parsing flow of os.arch() output in test.js and found it being parsed on host-targets.js inside the _webi/build-classifiers.

And it missed parsing x64 into x86_64, let me add the exact snippet,

// arch
  AMD64: { arch: 'x86_64' },
  amd64: { arch: 'x86_64' },
  x86_64: { arch: 'x86_64' },

Adding x64: {arch: 'x86_64'} solved the issue, and all the installers I tested after that were fetching the right releases.

I think this should be a PR, because this is a missed scenario. #1002 is most likely caused by this scenario.

I ran into this issue earlier, while working on #1036, and wrote a simple workaround, tagging 'amd64' explicitly if os.arch() returned 'x64'.

But this is a more sanitized, more proper approach.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions