Commit Graph

6 Commits

Author SHA1 Message Date
Yacin Tmimi
37489e43b6 Update how LD_LIBRARY_PATH is set for rustfmt binaries in diff check
rustfmt currently has a runtime dependency on the sysroot. So when we
build a standalone rustfmt binary we need to set `LD_LIBRARY_PATH` so
each rustfmt binary knows where to find it's dependencies.

When running our Diff-Check job to test PRs for breaking changes it's
often the case that both the master rustfmt binary and the feature
branch binary have the same runtime dependencies so we only need to
set `LD_LIBRARY_PATH` once.

However, when running the diff-check job against a subtree sync PR that
assumption doesn't hold. The subtree sync PR bumps the required
toolchain used to build rustfmt and therefore the binary that gets built
for the subtree sync PR has a different runtime dependency than the
master rustfmt binary.

Now we set `LD_LIBRARY_PATH` twice to account for this potential
difference.
2023-11-01 20:21:47 -05:00
Yacin Tmimi
b446e8eee5 update diff-check logging
These changes mostly improve logging out the cargo version and version
of the two rustfmt binaries that are compiled. Some other minor logging
changes were made as well to add some whitespace to improve visual
clarity when looking at the logs in the GitHub Actions console.
2023-11-01 20:21:47 -05:00
Yacin Tmimi
d698bf4e1b use the branch_name as the default for the optional commit hash
There was an issue with the script when passing optional rustfmt configs
without specifying a commit hash. Because these optional values are
passed via positional arguments the configs ($4)  would be used in place
of the commit hash ($3). Now that we set a default value for the
optional commit hash we avoid this problem.
2023-07-11 19:10:59 -05:00
Yacin Tmimi
e5c212b56f Improve error discovery in check_diff.sh
The `set -e` option is used to immediately exit if any command exits
with a non zero exit status. This will help us catch errors in the
script, for example, needing the `LD_LIBRARY_PATH` to be set.
2023-07-11 19:10:59 -05:00
Yacin Tmimi
89500fab0e Add LD_LIBRARY_PATH in check_diff.sh
There were some upstream changes made a while back that requires this to
be set when building rustfmt from source like we do in the
`check_diff.sh` script.

See issue 5675 for more details.
2023-07-11 19:10:59 -05:00
Yacin Tmimi
949da529d7 Add GitHub Action to test master rustfmt formatting vs a feature branch
This new action is intended to help us maintainers determine when feature
branches cause breaking formatting changes by running rustfmt (master)
and the feature branch on various rust repositories.

Over time I expect the list of checked projects to increase.

With this action in place we can more easily test that a new feature or
bug fix doesn't introduce breaking changes. Although this action needs to
be manually triggered right now, we might consider adding it to our CI
runs in the future.
2022-08-12 20:41:38 -05:00