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

Docker dev environment #28

Closed
wants to merge 3 commits into from
Closed

Docker dev environment #28

wants to merge 3 commits into from

Conversation

rimbi
Copy link

@rimbi rimbi commented May 31, 2023

This will provide a standardized development environment as well as the necessary infrastructure for the debian package management.

rimbi added 3 commits May 31, 2023 13:56
The intention is to provide a standardized development environment.
This is necessary when cross-compiling from arm to x86.
It is used to standardize the VsCode settings.
Copy link
Owner

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to

  • add instructions in the README on how to use this.
  • CI to test image build and building with image.

Comment on lines +1 to +2
[target.x86_64-unknown-linux-gnu]
linker = "x86_64-linux-gnu-gcc"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. You're specifying linker for x86 target, how is that relevant to arm cross built? 🤔

Copy link
Author

@rimbi rimbi May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x86 is the target for the cross compilation. arm is the host.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. Thing is that this will be used on normal native builds too and that would not be good. E.g I use mold linker for faster linking and AFAICT, this would override that.

Comment on lines +11 to +25

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these. If people need to add them, they can consult the docs you point to above and add them themselves.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer other way but no problem. I can add .devcaontainer folder to .gitignore.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You misunderstand. I was referring to the commented out settings, not the file itself.

@@ -0,0 +1,4 @@
FROM rust

RUN cargo install cargo-watch cargo-deb
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't provide any distro-specific stuff.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo-deb is necessary to build the deb packages, which might be good to have it accessible.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I know what it would be for but it's distro-specific and hence not something I'd want here.

Is building deb natively harder?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with natively? Without using cargo-deb?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean w/o using docker or any containers, like I normal develop. :)

@rimbi
Copy link
Author

rimbi commented May 31, 2023

Initially, I would like to use it just with VsCode. No other purposes. When you open a project with a Docker file, VsCode prompts the option for opening the project in the container and then builds and prepares the container env.

@zeenix
Copy link
Owner

zeenix commented May 31, 2023

Initially, I would like to use it just with VsCode. No other purposes. When you open a project with a Docker file, VsCode prompts the option for opening the project in the container and then builds and prepares the container env.

Nice! However, given that this project is quite small and has very few deps (which are fetched by cargo for you) and I don't expect a lot of developers to get involved, I'd only want this nice workflow added if it can be done in a very non-intrusive (e.g no changes to default linker on x86 Linux) manner.

With #27, I was more thinking of users, not developers.

@rimbi
Copy link
Author

rimbi commented May 31, 2023

Ok, I am closing this PR as I don't have enough energy to continue the discussion. :)

@rimbi rimbi closed this May 31, 2023
@rimbi rimbi deleted the docker-dev branch May 31, 2023 17:35
@zeenix
Copy link
Owner

zeenix commented May 31, 2023

Ok, I am closing this PR as I don't have enough energy to continue the discussion. :)

Fair enough. I hope no hard feelings though and that you understand me disagreeing doesn't meant that I do not appreciate your contributions (even ones that don't get merged).

@rimbi
Copy link
Author

rimbi commented Jun 1, 2023

Not at all. Apparently you don't need much help here and can move faster alone. Please don't hesitate to contact me when you need help.

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

Successfully merging this pull request may close these issues.

2 participants