tagattie/FreeBSD-VSCode

Include freebsd-vscode in ports tree

Closed this issue · 13 comments

It would be super convenient to include freebsd-vscode in ports tree. Did you try this? Anything is missing?

Hi, thanks for your interest in this port. I hope it'll become an official port eventually.

One issue is yarn command, which accesses network to download files, executed during build phase. FreeBSD doesn't like this behavior so there must be some other way to pre-download files and check their integrity with distinfo.

So far no luck unfortunately... ☹️

0mp commented

The easiest way to work around it is to prepare a release tarball with all the source code. This way the ports framework just downloads a prepared package with all the source code it needs from things like yarn.

This is a solution that was suggested to me by other ports committers.

Thanks for the tip.

I found yarn install has the --offline option. So preparing a tarball containing all node_modules dependencies from yarn's cache and using it for port building may solve the problem. I will try that way.

HI @tagattie,

Did you have a chance to give it a try?

Hi @mateuszkwiatkowski,

Yes I tried yarn install with --offline option and it was a success. However, there are still some build steps trying to download files from the internet. I'm trying to figure out where they are and how to deal with them.

What is missing to make this a Port?
Can I help with anything?
Could this be depending on the existing electron4 Port instead of bundling its own?

Now the port can be built with poudriere, it is good enough to be an official one IMO. I will work with port committer(s).

Could this be depending on the existing electron4 Port instead of bundling its own?

I'm not sure if I'm following. The port now depends on devel/electron4 for building instead of downloading and using a custom binary distribution file. Do you mean something other than that?

Yeah sorry, I meant if ti was possible to run with the electron executable (RUN_DEPENDS) instead of linking it (and bundling much of it).
I guess this is blocked by VSCode#72298 though.

I tried to copy vscode to /usr/ports/editors/vscode. But quite early on, I got an error message saying

$ yarn --frozen-lockfile --offline
yarn install v1.19.1
warning package.json: No license field
warning vscode-extensions@0.0.1: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
error Can't make a request in offline mode ("https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz")
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/editors/vscode
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/vscode

When going back to my original location and install it (and create a package), it works fine.

@andersbo87 I got this to work on my healty version of GhostBSD by making a change to the Makefile at /usr/ports/editors/vscode/Makefile

If you delete the --offline switch on line 161 it will allow you to complete the build by pulling the packages from online resources. Not an optimal solution, but once I made the change it built without issue.

diff /usr/ports/editors/vscode/Makefile.old /usr/ports/editors/vscode/Makefile
161c161
< 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn --frozen-lockfile --offline # --no-progress
---
> 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn --frozen-lockfile # --no-progress

@mateuszkwiatkowski would you like to close this issue?

The port was added around two years ago: https://cgit.freebsd.org/ports/commit/?id=719fc2047bd9f7823509944bd1e856ac8da71fed

Thank you

Thank you!