Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Offline build for NixOS #2207

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

Open
relief-melone opened this issue Apr 29, 2025 · 2 comments
Open

Offline build for NixOS #2207

relief-melone opened this issue Apr 29, 2025 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@relief-melone
Copy link

relief-melone commented Apr 29, 2025

I am currently trying to create a native vimPlugin implementation for NixOS for vscode-js-debug. Now there are some specifics which make building node related packages pretty hard on NixOS. one is the nature the package.json being non deterministic which goes against the basic principle of the way NixOS operates. Also a package-lock does not guarantee the packages have not been altered (version deleted and republished).
Adding to this principle. NixOS does not allow network access during the build process. This is the tricky part for this one as npx gulp vsDebugServer does rely on internet access.

I am more than happy to provide a PR addressing the issue. However I do lack experience with gulp. So it would help to get some assistance here. I also saw that there is a task called dapDebugServer and was wondering if that would already do the job as it does not seem to include the i10n download nor compile:dynamic which also causes some trouble due tue dynamic linking.

I did find that in the gulpfile.js the l10n bundle download is an example that relies on downloading the zip from a github repo. My suggestion would be that you could set env vars during the build process that specify the location of such files. Would this be a viable option or are there any roadblocks I did not think of that would make an offline build impossible?

@relief-melone relief-melone added the feature-request Request for new features or functionality label Apr 29, 2025
@connor4312
Copy link
Member

Also a package-lock does not guarantee the packages have not been altered (version deleted and republished).

The package-lock does include package checksums which are proof against modification.

My suggestion would be that you could set env vars during the build process that specify the location of such files.

Sure, I would take a PR to add this. If such an environment variable is set we would jsut return early from

gulp.task('l10n:bundle-download', async () => {

@relief-melone
Copy link
Author

I am working on this. It is alot of work (and a nice NixOS learning journey). The first concept I might come up with probably would need some improvements. As stated before one of the key differences is that for NixOS to utilize npm packages they need to be "converted" from the package.json to inputs (basically also a package list derived from package.json but one that includes all the content hashes for the packages to ensure that the build process is deterministic)

This requires me to include all the explicit architecture packages as well (so. e.g. in addition to esbuild @esbuild/linux-x64) is also needed.

I don't want the impact on this repo being to big. So just as a heads up. If someone is more experienced with this and has a clever idea on how to minimize the impact that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants