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

Use simple include path #591

Closed
wants to merge 3 commits into from
Closed

Use simple include path #591

wants to merge 3 commits into from

Conversation

jaebaek
Copy link
Contributor

@jaebaek jaebaek commented Jul 23, 2019

This is similar to #571. We do not want to use third_party as
a part of include path.

Copy link
Collaborator

@dj2 dj2 left a comment

Choose a reason for hiding this comment

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

Does lodepng exist in other repos? Isn't this just going to be disabled by other build systems?

@@ -45,6 +45,8 @@ endif()

add_executable(amber ${AMBER_SOURCES})
target_include_directories(amber PRIVATE "${CMAKE_BINARY_DIR}")
target_include_directories(amber PRIVATE
"${PROJECT_SOURCE_DIR}/third_party/lodepng")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this to just ${PROJECT_SOURCE_DIR}/third_party

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

samples/png.cc Outdated
@@ -21,7 +21,7 @@

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#include "third_party/lodepng/lodepng.h"
#include "lodepng.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be lodepng/lodepng.h. I'm pretty sure the linter is going to give an error with this being a directory-less include path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

@jaebaek jaebaek left a comment

Choose a reason for hiding this comment

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

This change allows us to use lodepng in other place. I agree with you that we should keep lodepng/ in front of lodepng.h.

@@ -45,6 +45,8 @@ endif()

add_executable(amber ${AMBER_SOURCES})
target_include_directories(amber PRIVATE "${CMAKE_BINARY_DIR}")
target_include_directories(amber PRIVATE
"${PROJECT_SOURCE_DIR}/third_party/lodepng")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

samples/png.cc Outdated
@@ -21,7 +21,7 @@

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#include "third_party/lodepng/lodepng.h"
#include "lodepng.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@dj2
Copy link
Collaborator

dj2 commented Jul 24, 2019

This change allows us to use lodepng in other place. I agree with you that we should keep lodepng/ in front of lodepng.h.

Right, but are we using lodepng in other places? Is this something that's blocking other work or something we may want in the future?

@jaebaek
Copy link
Contributor Author

jaebaek commented Jul 24, 2019

I am testing Bazel build and I do not want to make lodepng as a submodule nor part of source code. I just let Bazel download lodepng from lodepng github directly. Bazel puts lodepng in other specific place if it is not the part of source code nor submodule. There is no way to change this specific location.

This is similar to google#571. We do not want to use `third_party` as
a part of include path.
@dj2
Copy link
Collaborator

dj2 commented Jul 24, 2019

Wait, I'm confused. You're writing a general Bazel script for Amber? Is this to be checked into the Amber repo? If so, it should continue to use the git-sync-deps mechanism so Bazel should be using the third_party/ code.

@jaebaek
Copy link
Contributor Author

jaebaek commented Jul 24, 2019

No. It is not a general Bazel script. It will be used only inside Google. Since other third parties of Amber used in Google has internal dependencies, it is hard to make them public.

@dj2
Copy link
Collaborator

dj2 commented Jul 24, 2019

Downloading code in the build I don't think is allowed. Your better bet is to disable png support in google3 and instead just use the PPM code which is self contained. They this CL goes away and you create a CL to make lodepng optional.

@jaebaek
Copy link
Contributor Author

jaebaek commented Jul 24, 2019

I tested the bazel script and it works fine. There are other projects inside Google (which is not part of google3) also did similar things. Actually I just mimic them. If Google inside does not need to update some third party code, many of projects let Bazel download those third parties from specific version of github commit.

If you still doubt this, then I will follow what you mentioned. Actually, it is the same with my initial implementation.

@dj2
Copy link
Collaborator

dj2 commented Jul 24, 2019

That surprises me. @dnovillo I always though code used in the build needed to be in the repo? Is it common to download thrid_party code and include it during the build?

I think the simplest solution is to just disable PNG for internal and use the PPM output format which is fully contained inside Amber. Then you don't need lodepng at all.

@jaebaek
Copy link
Contributor Author

jaebaek commented Jul 24, 2019

Supporting PNG is not a critical issue. Ok, let me disable PNG.

@jaebaek jaebaek closed this Jul 24, 2019
jaebaek added a commit to jaebaek/amber that referenced this pull request Jul 24, 2019
As discussed in google#591, this CL sets lodepng as an optional library.
@jaebaek jaebaek mentioned this pull request Jul 24, 2019
jaebaek added a commit that referenced this pull request Jul 24, 2019
As discussed in #591, this CL sets lodepng as an optional library.
sarahM0 pushed a commit to sarahM0/amber that referenced this pull request Jul 25, 2019
As discussed in google#591, this CL sets lodepng as an optional library.
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