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

The // SNAP feature of tidy is broken #11985

Closed
huonw opened this issue Feb 2, 2014 · 1 comment · Fixed by #11989
Closed

The // SNAP feature of tidy is broken #11985

huonw opened this issue Feb 2, 2014 · 1 comment · Fixed by #11989

Comments

@huonw
Copy link
Member

huonw commented Feb 2, 2014

Create src/a.rs with contents

// SNAP b6400f9

then make tidy fails with:

  File "/home/huon/rust/src/etc/tidy.py", line 60, in <module>
    a, b, c, phash = snapshot.determine_curr_snapshot_info()
TypeError: determine_curr_snapshot_info() takes exactly 1 argument (0 given)

cc @cmr

huonw added a commit to huonw/rust that referenced this issue Feb 2, 2014
@adrientetar
Copy link
Contributor

This might make it work:

commit 0b215c3286c0dc7c2b2569c65b08c07c7e0d302d
Author: Adrien Tétar <adri-from-59 at hotmail period fr>
Date:   Sun Feb 2 09:56:02 2014 +0100

    etc/tidy: pass triple information to SNAP

diff --git a/mk/tests.mk b/mk/tests.mk
index d50f987..e44c046 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -255,13 +255,13 @@ tidy:
        | grep '^$(S)src/llvm' -v \
        | grep '^$(S)src/gyp' -v \
        | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
-       $(Q)find $(S)src/etc -name '*.py' \
+       $(CFG_BUILD) $(Q)find $(S)src/etc -name '*.py' \
        | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
-       $(Q)echo $(ALL_CS) \
+       $(CFG_BUILD) $(Q)echo $(ALL_CS) \
        | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
-       $(Q)echo $(ALL_HS) \
+       $(CFG_BUILD) $(Q)echo $(ALL_HS) \
        | xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
-       $(Q)find $(S)src -type f -perm +111 \
+       $(CFG_BUILD) $(Q)find $(S)src -type f -perm +111 \
            -not -name '*.rs' -and -not -name '*.py' \
            -and -not -name '*.sh' \
        | grep '^$(S)src/llvm' -v \
diff --git a/src/etc/tidy.py b/src/etc/tidy.py
index 3364ddc..1a5d2ac 100644
--- a/src/etc/tidy.py
+++ b/src/etc/tidy.py
@@ -33,8 +33,8 @@ def do_license_check(name, contents):
     if not check_license(name, contents):
         report_error_name_no(name, 1, "incorrect license")

-
-file_names = [s for s in sys.argv[1:] if (not s.endswith("_gen.rs"))
+triple = sys.argv[1]
+file_names = [s for s in sys.argv[2:] if (not s.endswith("_gen.rs"))
                                      and (not ".#" in s)]

 current_name = ""
@@ -58,7 +58,7 @@ try:
             match = re.match(r'^.*//\s*SNAP\s+(\w+)', line)
             if match:
                 hsh = match.group(1)
-                a, b, c, phash = snapshot.determine_curr_snapshot_info()
+                a, b, c, phash = snapshot.determine_curr_snapshot_info(triple)
                 if not phash.startswith(hsh):
                     report_err("Snapshot out of date: " + line)
             else:

EDIT: this does not seem to work; the nested grep and xargs seem to pass args in a special way. (triple ends up being the name of a file to scan)

@bors bors closed this as completed in 9a672f9 Feb 6, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 28, 2023
…-pedantic, r=xFrednet

Move `uninhabited_references` to `nursery`

I think this lint has too many false positives and should be put in pedantic. See rust-lang#11984 and rust-lang#11985 for context.

The lint is already in beta and is causing trouble for us, so I would also like this PR to be backported to beta as well.

changelog: Moved [`uninhabited_references`] to `nursery` (Now allow-by-default)
[rust-lang#11997](rust-lang/rust-clippy#11997)
(Check if this has been backported)

Fixes rust-lang#11984.
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 a pull request may close this issue.

2 participants