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

workspaces templates change to allow out-of-source builds #4812

Merged

Conversation

Projects
None yet
4 participants
@memsharded
Copy link
Contributor

commented Mar 24, 2019

Changelog: Fix: Allow using reference object in workspaces in templates for out of source builds
Docs: conan-io/docs#1135

Close #4800

The key is allowing:

[build_folder]
../build/{{reference.name}}/{{settings.build_type}}

@tags: slow

@memsharded memsharded requested a review from jgsogo Mar 24, 2019

@ghost ghost assigned memsharded Mar 24, 2019

@ghost ghost added the stage: review label Mar 24, 2019

@memsharded memsharded assigned lasote and unassigned memsharded Mar 24, 2019

@memsharded memsharded added this to the 1.14 milestone Mar 24, 2019

@theodelrieu

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2019

Is it possible to use the project's folder name? I usually have package names prefixed.

Assuming Boost uses workspaces: boost_math is the package name, boost the root folder of the workspace, math a subproject. I'd like to keep the same folder hierarchy in the build folder.

This is especially useful to run Ninja commands, e.g. ninja math/test to only run Boost.Math tests.

@jgsogo
Copy link
Member

left a comment

Two considerations:

  • This new context variable available for Jinja2 engine should be documented in the same way as hooks, not like a ConanFileReference, but a namedtuple: "reference: Named tuple with attributes name, version, user, and channel. Its representation will be a reference like: box2d/2.1.0@user/channel"
  • Should it be reference or ref? We can keep reference for backwards compatibility and add ref to match our naming conventions.
@memsharded

This comment has been minimized.

Copy link
Contributor Author

commented Mar 25, 2019

Is it possible to use the project's folder name? I usually have package names prefixed.

Assuming Boost uses workspaces: boost_math is the package name, boost the root folder of the workspace, math a subproject. I'd like to keep the same folder hierarchy in the build folder.

@theodelrieu you will have the package name as an input, from there, if you can do it with Jinja (I think it is possible, something like {{ reference.name | replace("_", "/") }}), then you are good

@jgsogo Agree on docs for namedtuple, I'll do it that way. Regarding the name, I think we are calling it reference towards the user (hooks, conan_api), so maybe we could leave it the same way, the feature is experimental if we wanted we could rename it, right? But reference sounds more consistent with other places, what do you think?

@lasote

lasote approved these changes Mar 25, 2019

@lasote

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2019

Pending docs

@jgsogo

This comment has been minimized.

Copy link
Member

commented Mar 25, 2019

@jgsogo Regarding the name, I think we are calling it reference towards the user (hooks, conan_api), so maybe we could leave it the same way, the feature is experimental if we wanted we could rename it, right? But reference sounds more consistent with other places, what do you think?

For hooks, we thought it had been an error to name the argument reference when it was actually a ref. I agree that reference is more sound from the user POV, and actually I like it more 👍

@memsharded memsharded merged commit d8162b7 into conan-io:develop Mar 26, 2019

2 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details

@memsharded memsharded deleted the memsharded:feature/workspaces_out_source branch Mar 26, 2019

@ghost ghost removed the stage: review label Mar 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.