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

Support for FreeBSD #5491

Open
michal-stachura opened this issue Apr 25, 2024 · 6 comments
Open

Support for FreeBSD #5491

michal-stachura opened this issue Apr 25, 2024 · 6 comments

Comments

@michal-stachura
Copy link

Rollup Version

latest

Operating System (or Browser)

FreeBSD

Node Version (if applicable)

18

Link To Reproduction

https://github.com/michal-stachura/free-bsd

Expected Behaviour

Install dependencies corectly and run Nuxt3 project on FreeBSD

Actual Behaviour

Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.

The following platform-architecture combinations are supported:
android-arm
android-arm64
darwin-arm64
darwin-x64
linux-arm
linux-arm (musl)
linux-arm64
linux-arm64 (musl)
linux-ppc64
linux-riscv64
linux-s390x
linux-x64
linux-x64 (musl)
win32-arm64
win32-ia32
win32-x64

If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.

overriding "rollup" in package.json does not solve the problem.

"overrides": {
    "rollup": "npm:@rollup/wasm-node@latest"
  },
@liuly0322
Copy link
Contributor

If you are using npm:

"overrides": {
  "nuxt": {
    "rollup": "npm:@rollup/wasm-node@latest"
  }
}

You can try to first remove package-lock.json, node_modules, then npm install and npm build again.

Other package managers have similar methods too, duplicate of #5194

@michal-stachura
Copy link
Author

michal-stachura commented Apr 25, 2024

Thank you @liuly0322 for your hint. I saw that task you mentioned above. Unfortunatelly it does not work. My package.json is:

                                                                                                                                 
{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "overrides": {
    "nuxt": {
       "rollup": "npm:@rollup/wasm-node@latest"
    }
  },
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare",
    "test-rollup": "rollup --version"
  },
  "devDependencies": {
    "@rollup/wasm-node": "latest",
    "@nuxt/devtools": "latest",
    "@nuxtjs/color-mode": "^3.3.0",
    "@nuxtjs/i18n": "^8.1.0",
    "@nuxtjs/tailwindcss": "^6.9.4",
    "@types/js-cookie": "^3.0.6",
    "@types/lodash": "^4.14.202",
    "dayjs-nuxt": "^2.1.9",
    "nuxt": "^3.8.1",
    "sass": "^1.69.5",
    "typescript": "^5.3.3",
    "vue": "^3.3.8",
    "vue-router": "^4.2.5",
    "vue-tsc": "^1.8.22"
  },
  "dependencies": {
    "@fullcalendar/core": "^6.1.11",
    "@fullcalendar/daygrid": "^6.1.11",
    "@fullcalendar/interaction": "^6.1.11",
    "@fullcalendar/list": "^6.1.11",
    "@fullcalendar/timegrid": "^6.1.11",
    "@fullcalendar/vue3": "^6.1.11",
    "@pinia/nuxt": "^0.5.1",
    "@vuepic/vue-datepicker": "^8.1.1",
    "js-cookie": "^3.0.5",
    "loadash": "^1.0.0",
    "lodash": "^4.17.21",
    "next-auth": "4.21.1",
    "vue3-colorpicker": "^2.2.3",
    "vue3-toastify": "^0.1.14"
  }
}

but anyway. Thank you for your help :)

@lattera
Copy link

lattera commented May 8, 2024

@lukastaegert
Copy link
Member

lukastaegert commented May 9, 2024

Native FreeBSD support should be possible if someone would take the time to set it up properly in the pipeline. PR welcome!
This is an example what needs to be done to add a new compilation target: https://github.com/rollup/rollup/pull/5346/files

This is how napi-rs builds FreeBSD: https://github.com/napi-rs/package-template/blob/f653a34ca6166f9eb3586d704923a4232f9d7efc/.github/workflows/CI.yml#L149-L183

The main reason it was skipped is that it has a completely separate pipeline, and we have limited resources. But if there is interest and someone takes the time to look into it and set it up, we are happy to support it!

@samupl
Copy link

samupl commented May 31, 2024

@lukastaegert I am thinking about contributing to this project by enabling building freebsd. I wanted to use the same solution as napi-rs does, so by using the cross-platform-actions/action action.

The only "problem" is that current action file for rollup has a pretty matrix strategy for all currently supported target and it uses actions like actions/setup-node and dtolnay/rust-toolchain - I am not 100% sure but I'm pretty confident that these cannot be easily married with cross-platform-actions/action.

That being said, would you be ok if I just created an entirely separate build step for freebsd? if I were to use cross-platform-actions/action I think that everything would have to be a shell script anyway, but also it should have a matrix of supported freebsd versions, as there's no guarantee that a binary built for one release will work on another.

What do you think about this approach?

@lukastaegert
Copy link
Member

That being said, would you be ok if I just created an entirely separate build step for freebsd?

If that is necessary, then that is fine with me.

but also it should have a matrix of supported freebsd versions, as there's no guarantee that a binary built for one release will work on another

I think there would be a problem as the "optionalDependencies" mechanism we use for installing the correct binary can select by operating system https://docs.npmjs.com/cli/v10/configuring-npm/package-json#os and cpu, but you cannot select different operating system versions. So if we build more than one FreeBSD version, everyone on FreeBSD would first need to download all of the versions before selecting the right one (I think so at least). Are you sure it is not possible to compile to run at least on all recent versions?

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

No branches or pull requests

5 participants