Details
Diff Detail
Event Timeline
Can you delete and re-create, and add llvm-commits to the subscribers? (It doesn't work if you add it after the fact, it has to be done the first time you create the review)
Hmm, actually it looks like llvm-commits is already added, I'm not sure why it's not sending out email
Zturner, but I added llvm-commit when I created the diff. It looks like it doesnt work...
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
133 | Should this be -DLLVM_USE_SANITIZER_COVERAGE=YES? (The R is missing in Sanitizer) |
+ Split build and testing into 2 steps so it is easier to understand when it fails.
+ Add asan dll path to Path, so it is found when executing the tests.
+ Add bin dir to Path, so tools like FileCheck, not and sancov are found when executing the tests.
rnk, does this look correct to you? I dont' see anything obviously wrong, but you are more familiar with this bot than I am.
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
128 | The backslashes here need to be escaped or they will be treated as escape characters. Or use path.join so you don't have to deal with slashes at all. |
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
128 | This won't work, this code will execute on the master, not the build slave, so the CWD will be wrong, and we won't be able to glob. I think it might be possible to construct a relative path to clang-cl, but I'm not sure how to add the absolute runtime library path to PATH. |
@rnk I am not sure I understand what you mean. All the steps will be executed in the same machine, won't they? So, after building clang and compiler-rt with MSVC, we have the binaries and libraries in build_dir\Release . I am adding them to PATH.
Ahh yes, classic master/slave problems :(
I had this problem once before, I think in the LLDB builder, and Galina showed me a way to get the current directory on the master, but I'll have to do some digging to find it.
Ok here it is.
# get full path to build directory f.addStep(SetProperty(name="get_builddir", command=["pwd"], property="builddir", description="set build dir", workdir=build_dir)) # Use the build directory via the %(builddir) syntax. cmake_cmd = [ "cmake", "-G", "Ninja", "../llvm", "-DCMAKE_BUILD_TYPE=" + config, "-DPYTHON_HOME=" + python_source_dir, "-DCMAKE_INSTALL_PREFIX=../install", "-DLLDB_TEST_COMPILER=\"%(builddir)s/bin/clang.exe\"" ]
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
149–150 | Does this work? I know Property('slave_env') will return the slave environment as a dictionary, but is this just a local dictionary where changes made to it don't get written back to the slave? That's what I expect. If so you might need to do something like newPath = ";".join([bin_path, dll_path, Property('slave_env')['Path']]) f.addStep(SetProperty(name="set toolchain path", command=["set", "PATH", "=", newPath], description="set toolchain path", workdir=build_dir)) (I'm honestly not 100% sure though, so confirm that I'm right if you can) |
Actually wait, each step runs with env=Property('slave_env'). So even if you set the path beforehand, this will override your changes because it will already have PATH in this env. So you need to save off the value of Property(slave_env), fix up the PATH environment variable, and then use that as the value of the env keyword argument in subsequent calls.
@zturner I am modifying the Property('slave_env') dictionary. I update the value mapped to the key: Path , to add the new directories.
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
134 | This might fail if many version of clang have been built and the lib directory contains more than one version. I suspect the bot already has more than one version directory. | |
141 | I doubt this will work. A "Property" is not a string or dictionary. The master never sees the property values until the build actually executes. It has to generate the list of steps to execute up front, before actually running any of them. When you say "addStep", that adds a step to be run in the future on another machine. The steps don't run synchronously inside this python code. As an alternative, we don't need to set PATH if we link statically, right? I'd recommend we do that. Set "-DLLVM_USE_CRT_"+config.upper()"=MT" in the cmake command to do that. |
It might work if you save the value of Property('slave_env') into a local variable first, then modify the values in that local variable, then reference the local variable in all subsequent lines that say env = Property('slave_env'). Otherwise I don't know if it will just ask the slave for its value new every time. (This is all very magic black-box type stuff).
Or maybe I'm totally wrong and what Reid said is correct, that the master never sees the value of the properties :) I'm obviously not going to be putting buildbot on my resume :)
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
134 | No, that step is conditional on cleanBuildIfRequested, which is typically false. The builder is intended to be fast and incremental. |
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
141 | True, but we don't have to compute the clang version to compute the path the bin directory. Static linking would still eliminate the need for this "dir /b" step. | |
143 | Why add config? A ninja build will put the binaries in "%(builddir)s/bin", right? | |
148 | This will probably work, nice :) |
Hello Marcos,
I have commented couple things inline.
You may want to reconsider how you try to set the environments. What you are trying to do wouldn't work. Property('slave_env') is a local snapshot of the slave envs, and does not get propagated back to the slave.
You either would need to use a build step env param to set an env var, or do something else which would not require that.
At the first glance, Reid's suggestion of reducing the number of dependencies looks as a way to go, unless you have a strong reason to dial with DLLs.
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
118 | Depending on a build slave version, RemoveDirectory might not work well on Windows, if some directories are not empty or temporarily locked by some service or anti-virus. Just FYI. Unfortunately, there is no good solution for this. Issuing "rmdir /S /Q" command might fail too, depending on the shell. | |
133 | All these could be done simpler. Every build step has a property "workdir" which contains a fully qualified path. When referencing a path, you could do something like WithProperties( "-DCMAKE_CXX_COMPILER=%(workdir)s/" + staged_install + "/bin/clang++" )) No need to be canonical with the directory separator as well, forward slashes would do just fine. You can check how similar to this is done in the UnifiedTreeBuilder.py, lines 365-375. | |
150 | All these could be done simpler. Every build step has a property "workdir" which contains a fully qualified path. When referencing a path, you could do something like WithProperties( "-DCMAKE_CXX_COMPILER=%(workdir)s/" + staged_install + "/bin/clang++" )) No need to be canonical with the directory separator as well, forward slashes would do just fine. You can check how similar to this is done in the UnifiedTreeBuilder.py, lines 365-375. | |
152 | Could you use the CmakeCommand instead of the ShellCommand, please? |
@gkistanova @rnk Thanks for your feedback.
I have included suggested changes.
Unfortunately, I can't use MT for now. There is a problem with clang driver, and the order of static libraries. I will file a bug in bugzilla.
I still need to update the code to use CmakeCommand. Maybe in a different diff?
We run buildbot 0.8.5 on the master. It does not have Interpolate.
So, please use WithProperties instead.
Hello Marcos,
Feel free to commit after fixing that missing comma.
Would you make sure the slave for that builder will connect to the silent master and not production, to stage it for a day or two, please?
zorg/buildbot/builders/SanitizerBuilderWindows.py | ||
---|---|---|
131 | You are missing a comma here between the arguments. |
zorg/buildbot/builders/Util.py | ||
---|---|---|
23 ↗ | (On Diff #87732) | A cosmetic - "and and" |
The builder is already connected to the normal build master, though. Should we move it?
Yes, please, once this change is landed.
Just stop the slave, point it to the silent master, and start it again. It should connect with the same credentials.
In a day or two of the reliably green builds on the staging, feel free to return it back to the normal build master.
It seems less than ideal for our existing coverage to go silent if we connect this to the non production master.
What if we set haltOnFailure=False and flunkOnFailure=False for all of the newly added steps, until we can confirm that it's stable?
Hi Zachary,
This could do, if you are sure that these steps would not compromise the whole build.
Anyway, you can re-point the slave to the silent master if something would go wrong. Just be ready to act quickly. :)
Sounds good. Any chance of a master restart today after landing this, so that we can see by tomorrow morning if it's going to be a problem?
Depending on a build slave version, RemoveDirectory might not work well on Windows, if some directories are not empty or temporarily locked by some service or anti-virus. Just FYI.
Unfortunately, there is no good solution for this. Issuing "rmdir /S /Q" command might fail too, depending on the shell.