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

Rollup should allow building from source. #5426

Open
xbjfk opened this issue Mar 11, 2024 · 7 comments
Open

Rollup should allow building from source. #5426

xbjfk opened this issue Mar 11, 2024 · 7 comments

Comments

@xbjfk
Copy link

xbjfk commented Mar 11, 2024

Feature Use Case

This features is useful for people who are:
a) security conscious and prefer compiling everything from source or
b) have a non-standard system not supported by binary packages provided

Feature Proposal

I would suggest this be implemented with respect to the --build-from-source flag passed to npm, just like node-pre-gyp does: mapbox/node-pre-gyp#8

@lukastaegert
Copy link
Member

lukastaegert commented Mar 11, 2024

This would require people to set up a Rust toolchain on their system with the correct nightly version, which is non-trivial. Basically they need to follow the CONTRIBUTING.md file. Not sure if anyone would want to go through that hassle.

You can easily try this out yourself, just install Rollup directly from GitHub, i.e. npm install rollup/rollup#master to install from master.
Using tags, you would be able to install any specific version from GitHub that way, e.g. npm i rollup/rollup#v4.12.1.

@Kreijstal

This comment was marked as resolved.

@xbjfk
Copy link
Author

xbjfk commented Apr 1, 2024

Hey, sorry it took so long for me to get back to you - I appreciate you response.

This would require people to set up a Rust toolchain on their system with the correct nightly version, which is non-trivial.

I absolutely agree, and I think the default should be the binaries.

The main problem I'm having is none of the binary versions run on my system; as you suggested, I tried to compile from git - but from what I can tell it depends on a previous version of rollup to build (?) - which won't run on my system - the .node file successfully compiled however. Is there any way to bootstrap rollup without a previous version of rollup?

It would also be nice not to manage npm overrides for the git version, but I'm focused on getting any version running natively for now.

@lukastaegert
Copy link
Member

Building Rollup without Rollup would indeed be something nice. I wonder if we could create a bootstrap build using https://www.npmjs.com/package/vite-node, but this would still rely on the native code of esbuild for the TypeScript conversion and would probably not solve your problems.

@xbjfk
Copy link
Author

xbjfk commented Apr 4, 2024

Actually, I think it might solve my problem, since I am able to compile esbuild from scratch (with go build) - I'm pretty sure esbuild does not need to be bootstrapped.

@Kreijstal
Copy link

Building Rollup without Rollup would indeed be something nice. I wonder if we could create a bootstrap build using https://www.npmjs.com/package/vite-node, but this would still rely on the native code of esbuild for the TypeScript conversion and would probably not solve your problems.

Reminds me of https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/

@Et7f3
Copy link

Et7f3 commented Apr 13, 2024

May I ask @xbjfk what is your OS triplet ? Do you want I cross compile a reproducible rollup (in CI so you can trust binary)

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

4 participants