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

purging test fails on xcode 11.5 and above (Travis) #283

Closed
andy5995 opened this issue Jun 7, 2020 · 5 comments
Closed

purging test fails on xcode 11.5 and above (Travis) #283

andy5995 opened this issue Jun 7, 2020 · 5 comments
Labels
Milestone

Comments

@andy5995
Copy link
Member

andy5995 commented Jun 7, 2020

No description provided.

@andy5995 andy5995 added the MacOS label Jun 7, 2020
@andy5995 andy5995 added this to the 0.7.05 milestone Jun 7, 2020
@andy5995 andy5995 modified the milestones: 0.7.05, 0.7.06 Jun 13, 2020
@andy5995 andy5995 modified the milestones: 0.7.06, 0.7.07 Feb 25, 2021
@andy5995
Copy link
Member Author

andy5995 commented Apr 9, 2021

Also happens with 11.6 and 12.2

https://travis-ci.com/github/theimpossibleastronaut/rmw/builds/222669680

Need to figure out how to view the purging log in the build/test directory....

andy5995 added a commit that referenced this issue Apr 11, 2021
@andy5995
Copy link
Member Author

We can see the error log now.

Here's some of the output where the error occurs

Note that this text: "Purging files based on number of days in the waste folders (90) ..." is displayed after the error messages, instead of before. Normally rmw will output that before actually trying to purge any files.

RMWTRASH=fake-year

+/Users/travis/build/theimpossibleastronaut/rmw/build/rmw -c /Users/travis/build/theimpossibleastronaut/rmw/build/../test/rmw.testrc --verbose /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/123 /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/abc /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/xyz

config file: /Users/travis/build/theimpossibleastronaut/rmw/build/../test/rmw.testrc

  :test mode: Using fake year

most recent list (mrl file): /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/rmw/mrl

'/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/123' -> '/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/123'

'/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/abc' -> '/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/abc'

'/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/xyz' -> '/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/xyz'

3 files were removed to the waste folder

+wait

+echo

+echo

+echo ' == displaying a trashinfo; it shows a DeletionDate of 1999'

 == displaying a trashinfo; it shows a DeletionDate of 1999

+cat /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/info/abc.trashinfo

[Trash Info]

Path=/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/tmp-files/abc

DeletionDate=1999-04-11T19:38:30

+wait

+echo

+echo

+echo ' == The trashinfo records that these files were rmw'\''ed in 1999'

 == The trashinfo records that these files were rmw'ed in 1999

+echo ' == So they will be purged now.'

 == So they will be purged now.

+/Users/travis/build/theimpossibleastronaut/rmw/build/rmw -c /Users/travis/build/theimpossibleastronaut/rmw/build/../test/rmw.testrc --verbose --purge

  :error: while removing /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/123

purge: No such file or directory

  :error: while removing /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/abc

purge: No such file or directory

  :error: while removing /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/xyz

purge: No such file or directory

config file: /Users/travis/build/theimpossibleastronaut/rmw/build/../test/rmw.testrc

Purging files based on number of days in the waste folders (90) ...

  [/Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/]

  ------------------------------------------------------------------------------------------------------------------------

 :warning: /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/123 has been modified since last check, not removing

 :warning: /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/abc has been modified since last check, not removing

 :warning: /Users/travis/build/theimpossibleastronaut/rmw/build/test/rmw-tests-home/test_purging.sh_dir/.local/share/Waste/files/xyz has been modified since last check, not removing

@andy5995 andy5995 changed the title purging test fails on xcode 11.5 (Travis) purging test fails on xcode 11.5 and above (Travis) Apr 12, 2021
@andy5995
Copy link
Member Author

This is the build system info for the job using xcode 11.6 (failing)

Build language: c

Build id: 223960580

Job id: 500648005

Runtime kernel version: 19.6.0

travis-build version: 091d532a

Build image provisioning date and time

Mon Oct 19 06:08:08 GMT 2020

Operating System Details

ProductName:	Mac OS X

ProductVersion:	10.15.7

BuildVersion:	19H2

Git version

git version 2.28.0

bash version

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)

Copyright (C) 2007 Free Software Foundation, Inc.

GCC version

Apple clang version 11.0.3 (clang-1103.0.32.62)

Target: x86_64-apple-darwin19.6.0

Thread model: posix

InstalledDir: /Applications/Xcode-11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

LLVM version

Apple clang version 11.0.3 (clang-1103.0.32.62)

Target: x86_64-apple-darwin19.6.0

Thread model: posix

InstalledDir: /Applications/Xcode-11.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Pre-installed Ruby versions

ruby-2.6.6

Pre-installed Node.js versions

v10.22.0

v10.22.1

v12.18.3

v12.19.0

v13.14.0

v14.6.0

v4.9.1

v6.17.1

v8.17.0

mvn -version

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec

Java version: 14.0.1, vendor: N/A, runtime: /usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home

Default locale: en_US, platform encoding: UTF-8

OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"

And for xcode 11.2 (passing)

Build language: c

Build id: 222669319

Job id: 497424617

Runtime kernel version: 18.7.0

travis-build version: 091d532a

Build image provisioning date and time

Thu Apr  2 02:31:55 GMT 2020

Operating System Details

ProductName:	Mac OS X

ProductVersion:	10.14.6

BuildVersion:	18G3020

Git version

git version 2.26.0

bash version

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)

Copyright (C) 2007 Free Software Foundation, Inc.

GCC version

Apple clang version 11.0.0 (clang-1100.0.33.12)

Target: x86_64-apple-darwin18.7.0

Thread model: posix

InstalledDir: /Applications/Xcode-11.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

LLVM version

Apple clang version 11.0.0 (clang-1100.0.33.12)

Target: x86_64-apple-darwin18.7.0

Thread model: posix

InstalledDir: /Applications/Xcode-11.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Pre-installed Ruby versions

ruby-2.6.5

Pre-installed Node.js versions

v10.18.1

v10.19.0

v12.14.1

v12.16.1

v13.6.0

v4.9.1

v6.17.1

v8.17.0

mvn -version

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec

Java version: 13.0.2, vendor: N/A, runtime: /usr/local/Cellar/openjdk/13.0.2+8_2/libexec/openjdk.jdk/Contents/Home

Default locale: en_US, platform encoding: UTF-8

OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"

andy5995 added a commit that referenced this issue Apr 24, 2021
See if using that env var is for some reason causing the challenging
behavior (#283)
andy5995 added a commit that referenced this issue Apr 24, 2021
andy5995 added a commit that referenced this issue Apr 24, 2021
andy5995 added a commit that referenced this issue Apr 26, 2021
andy5995 added a commit that referenced this issue Apr 26, 2021
@andy5995
Copy link
Member Author

andy5995 commented Apr 26, 2021

I tried running make check through a different shell, tcsh, but that gave the same result.

I also tried using faccessat() instead of lstat() for the exists() function, but that made things worse. 5/11 tests failed on the osx build.

(I cancelled all the Linux jobs on that build, but some show at https://travis-ci.com/github/theimpossibleastronaut/rmw/builds/224114055)

@andy5995
Copy link
Member Author

There's likely something screwy going on around

rmw/src/purging_rmw.c

Lines 364 to 467 in c3eebb9

struct stat st;
if (lstat (corresponding_file_to_purge, &st))
{
if (cli_user_options->want_orphan_chk
&& cli_user_options->force >= 2)
{
int res = 0;
if (cli_user_options->want_dry_run == false)
{
res = remove (trashinfo_entry_realpath);
if (res != 0)
msg_err_remove (trashinfo_entry_realpath, __func__);
}
if (res == 0)
printf ("removed '%s'\n", trashinfo_entry_realpath);
(*orphan_ctr)++;
continue;
}
else
{
printf ("While processing %s:\n", trashinfo_entry_realpath);
puts ("You can remove the trashinfo file with '-offg'");
// Will exit after error
msg_err_lstat (corresponding_file_to_purge, __func__, __LINE__);
}
}
int orig_dev = st.st_dev;
int orig_inode = st.st_ino;
if (S_ISDIR (st.st_mode))
{
if (cli_user_options->want_dry_run == false)
status =
rmdir_recursive (corresponding_file_to_purge, 1,
cli_user_options->force);
else
{
/* Not much choice but to
* assume there would not be an error if the attempt were actually made */
status = 0;
}
switch (status)
{
case EACCES:
print_msg_warn ();
printf (_("Directory not purged - still contains files\n"));
printf ("%s\n", corresponding_file_to_purge);
printf (_("(check owner/write permissions)\n"));
dirs_containing_files_ctr++;
break;
case RMDIR_MAX_DEPTH:
print_msg_warn ();
/* TRANSLATORS: "depth" refers to the recursion depth in a
* directory */
printf (_("Maximum depth of %u reached, skipping\n"),
RMDIR_MAX_DEPTH);
printf ("%s\n", corresponding_file_to_purge);
max_depth_reached_ctr++;
break;
case 0:
if (cli_user_options->want_dry_run == false)
status = rmdir (corresponding_file_to_purge);
else
status = 0;
if (status == 0)
{
deleted_dirs_ctr++;
bytes_freed += st.st_size;
}
else
msg_err_remove (corresponding_file_to_purge, __func__);
break;
default:
msg_err_remove (corresponding_file_to_purge, __func__);
break;
}
}
else
{
if (cli_user_options->want_dry_run == false)
{
if (!is_modified
(corresponding_file_to_purge, orig_dev, orig_inode))
status = remove (corresponding_file_to_purge);
else
status = -1;
}
else
status = 0;
if (status == 0)
{
deleted_files_ctr++;
bytes_freed += st.st_size;
}
else
msg_err_remove (corresponding_file_to_purge, __func__);
}

Not sure what yet. But that code is so old and obfuscated it needs refactoring, which I'll do within the next couple weeks.

andy5995 added a commit that referenced this issue Apr 28, 2021
andy5995 added a commit that referenced this issue Apr 28, 2021
@andy5995 andy5995 added this to the 0.7.08 milestone Apr 28, 2021
zvezdochiot pushed a commit to FS-make-simple/rmw that referenced this issue Sep 5, 2022
zvezdochiot pushed a commit to FS-make-simple/rmw that referenced this issue Sep 5, 2022
commit d71cb6c
Author: andy5995 <[email protected]>
Date:   Wed Apr 28 13:40:28 2021 -0500

    .travis.yml:add xcode 9.4 and 10.3

commit 67d47a9
Author: andy5995 <[email protected]>
Date:   Wed Apr 28 13:36:39 2021 -0500

    remove extra check before removing (for now)

    (fixes theimpossibleastronaut#283)

commit d359bfb
Author: andy5995 <[email protected]>
Date:   Wed Apr 28 13:06:25 2021 -0500

    remove is_modified(), use exists() instead

    (theimpossibleastronaut#283)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant