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

make the build of examples optional #188

Closed
wants to merge 1 commit into from

Conversation

@zimio
Copy link

zimio commented Jan 27, 2019

The examples inside of the project have more dependencies than the project itself. This creates the issue that by default, if someone tries to build without any of these dependencies, the build will fail.

A better approach would be to make the build of examples optional, because they are not necessary for the library to function. They are just there for pedagogic purposes. Also, not building the examples all the time will speed up build time in downstream projects.

With this change if you run the following command no examples will be built.

cargo build

If you run the following command all examples will be built.

cargo build --all

@zimio zimio mentioned this pull request Jan 27, 2019
@Manishearth
Copy link
Member

Manishearth commented Jan 27, 2019

You'll also need to make sure Travis runs this.

I'm not sure if we should merge this, I feel like if you need to build a particular crate you should just cd to that folder and do so, that's usually how workspaces work.

@zimio
Copy link
Author

zimio commented Jan 27, 2019

You'll also need to make sure Travis runs this.

You are referring to this? https://github.com/servo/media/pull/188/checks?check_run_id=55297147

I'm not sure if we should merge this, I feel like if you need to build a particular crate you should just cd to that folder and do so, that's usually how workspaces work.

I don't need to build a particular crate. I want to build everything except the examples. I think the reasons I previously stated make it a worthwhile change. Building the examples is not essential and should not be done by default.

@Manishearth
Copy link
Member

Manishearth commented Jan 27, 2019

You are referring to this

Right, the cargo build line in .travis.yml would need to have --all

I want to build everything except the examples

For development? In that case you probably should be building the examples too as the API isn't very stable.

Otherwise just build the servo-media crate, that pulls in everything but examples.

If you're pulling this in as a crate none of this matters anyway, since you won't be pulling in the examples crate.

@zimio
Copy link
Author

zimio commented Jan 27, 2019

Ah, ok. I understand now. Then perhaps this PRQ is not necessary.

@zimio zimio closed this Jan 27, 2019
@Manishearth
Copy link
Member

Manishearth commented Jan 27, 2019

(I'm still open to merging this if other maintainers want to)

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.