-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
gn: add initial gn recipe #5433
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -0,0 +1,3 @@ | |||
sources: | |||
"cci.20210429": | |||
url: "https://gn.googlesource.com/gn/+archive/6771ce569fb4803dad7a427aa2e2c23e960b917e.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no sha256?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It changes all the time.
Some time stamp is probably spoiling the fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, their servers produce tarballs on fly, and sha256 is always different, it's pain to package. if someone can help how to get stable tarball URL for gn, help is welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we could mirror this repo on github and have it sync itself automatically using actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this actions/checkout#24
But it looks like it only works to sync repos on the same domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's completely possible.
But somebody/organization should invest some time setting it up...
self.copy("gn.exe", src=os.path.join(self._source_subfolder, "out"), dst="bin") | ||
|
||
def package_info(self): | ||
bin_path = os.path.join(self.package_folder, "bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these lines really necessary? It is my understanding that conan exposes self.cpp_info.binpath
to PATH automatically when a package is listed as a build requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not needed when doing crossbuilds (-pr:h hostprofile -pr:b buildprofile
).
But when using the single profile approach (when your profile contains os_build
or arch_build
, I think the PATH
environment variable is not automatically set.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
if self.settings.compiler.cppstd: | ||
tools.check_min_cppstd(self, 17) | ||
else: | ||
if self._minimum_compiler_version_supporting_cxx17: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this pattern over and over, I'm wondering if this should be a conan built in tool.
It would remove boilerplate code and eliminate the need from the recipe creator of knowing which c++ std supports each compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some util functions would be nice.
But looking at the support matrix at https://en.cppreference.com/w/cpp/compiler_support,
the minimum required compiler version depends on what c++ features a project desires..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. One day... 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C++ standard is not enough since the STL support changes between some minor versions it's a manual process for many projects
I'm testing this locally to see how it behaves with the
Looking into my sysroots it looks like I only have the shared version of
There is a |
On my Fedora Linux box, the static library is provided by Linking to the static library makes the executable more robust/workable on more machines. When using the shared libstdc++, then we cannot remove |
This comment has been minimized.
This comment has been minimized.
@SpaceIm |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
] | ||
if self.settings.build_type == "Debug": | ||
conf_args.append("-d") | ||
self.run("python build/gen.py {}".format(" ".join(conf_args)), run_environment=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it require cpython in build requirement when packaged? Maybe add a TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll add a todo.
def build(self): | ||
with tools.chdir(self._source_subfolder): | ||
with self._build_context(): | ||
tools.save(os.path.join("src", "gn", "last_commit_position.h"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment about what this is for?
self.build_requires("ninja/1.10.2") | ||
|
||
@contextmanager | ||
def _build_context(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this not be re-used some how, I hate duplication like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These environment variables are closely coupled with the .gn
sources in the test package.
This is my first encounter with gn
, so I don't really know a better way to let the build system know of another compiler.
This comment has been minimized.
This comment has been minimized.
All green in build 12 (
|
Specify library name and version: gn/cci.20210429
gn is a build system developed by google, used for google produces (chromium)
I've tested this on Linux (gcc + clang) and Windows.
TODO's: Windows + Macosconan-center hook activated.