vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.4k stars 1.84k forks source link

Devcontainer that works #5042

Open rafaeltab opened 1 year ago

rafaeltab commented 1 year ago

Which project is this feature idea for?

Turborepo

Describe the feature you'd like to request

I would like for the dev container to be fixed, this would allow me and others to use it to contribute more easily.

Describe the solution you'd like

I have done some research myself on how it can be fixed. One major factor of why it doesn't currently work is because Rust needs to target x86_64-unknown-linux-musl. Musl isn't included with ubuntu bullseye, the base OS we are currently using, I have personally tried it out with Alpine Linux, which does have musl. The minimum required Dockerfile that I could create, that can successfully run pnpm install and pnpm run build on the codebase is as follows.

FROM node:16-alpine
USER root
RUN npm install -g pnpm@7 vercel yalc nodemon

RUN apk add --no-cache libc6-compat git zlib-dev go make curl
ENV GOPATH=/root/go
ENV PATH=$PATH:/root/go/bin
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
RUN source "$HOME/.cargo/env"
RUN mkdir /workspaces
WORKDIR /workspaces

I don't recommend using this Dockerfile directly, as it is very stripped down, has very few of the tools necessary for effective development, and isn't set up to be used with vs code.

Describe alternatives you've considered

Not contributing, but I don't want that. I can learn a lot from contributing, and it is fun as well. Not even to mention the fact that you may be able to benefit from it. I will finish the current pull request I have open using the file I created, and would love to keep contributing using a functioning dev container.

P.S. I marked this for the Turborepo project, but it really is for the development environment, which involves Turborepo, as well as Turbopack.

anthonyshew commented 9 months ago

I'll take a swing at getting this fixed up once we remove the Golang code/toolchain. There will be less to manage then. 👍

asasvirtuais commented 5 months ago

Any updates on this? I am looking to use my first turborepo in GitHub Codespaces.

rafaeltab commented 5 months ago

Any updates on this? I am looking to use my first turborepo in GitHub Codespaces.

This issue is for a devcontainer in which one can develop turbo itself. Not a devcontainer where one could use turborepo.

For your use case, a simple getting started node js devcontainer should do the job just fine. The only thing is a global install of turbo, which you'd have to do with npm install -g turbo

ragrag commented 2 months ago

@rafaeltab do you have any other slim Dockerfile up to date for atleast some development? the one you have in description doesn't seem to be working anymore

rafaeltab commented 2 months ago

@ragrag i do not sorry, I think golang is no longer used, so you could try a rust musl devcontainer