Skip to content

Add --offline option - #65

Merged
LukeMathWalker merged 1 commit into
LukeMathWalker:mainfrom
prestontw:ptw/add-offline-option
Jun 5, 2021
Merged

LukeMathWalker merged 1 commit into
LukeMathWalker:mainfrom
prestontw:ptw/add-offline-option

Conversation

@prestontw

@prestontw prestontw commented Jun 1, 2021 •

Copy link
Copy Markdown
Contributor

to support building with vendored and patched dependencies.

I typically run my build with

cargo build --offline -p <specific package name>

I tried translating my existing Dockerfile to use cargo chef,
but I was running into compilation errors where it wasn't
picking up the patched dependencies.

I commented out the portion of my Dockerfile
that ran cook and instead ran the above command.
This indeed works. So, I've added this option to the
necessary structs and where the cargo command is built.

I typically run my build with
```
cargo build --offline -p <specific package name>
```
I commented out the portion of my Dockerfile
that ran `cook` and instead ran the above command.
This indeed works. So, I've added this option to the
necessary structs and the place where `cargo` is executed.
@prestontw

Copy link
Copy Markdown
Contributor Author

@LukeMathWalker I tried to add you as a reviewer, but it doesn't seem like it's available? Please let me know if there's anything I need to do to contribute!

@prestontw

prestontw commented Jun 2, 2021 •

Copy link
Copy Markdown
Contributor Author

Another option besides adding more options to cargo chef is to just pass through all arguments besides the recipe path to cargo when we run the build step.

Edit: added a first draft of this in #67. The main concern I have is that there is now an ordering dependency between options---options for cargo chef have to appear before options for cargo build. To make this clearer, maybe we should add an explicit -- separator? Or just keep on adding more options to cargo chef?

Edit: I see that #28 was closed out, I closed out #67 too.

@LukeMathWalker

Copy link
Copy Markdown
Owner

Thanks for the PR @prestontw!

As mentioned in the discussion you linked, I don't want to allow the user to pass raw flags/options to cargo build. If you end up needing other knobs, just open a PR/issue to discuss :)

@LukeMathWalker
LukeMathWalker merged commit e65d29e into LukeMathWalker:main Jun 5, 2021
@prestontw
prestontw deleted the ptw/add-offline-option branch June 7, 2021 18:24
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