audacity icon indicating copy to clipboard operation
audacity copied to clipboard

Update calls to wxFileName::Normalize to include flags

Open imciner2 opened this issue 2 years ago • 7 comments

The recent wx 3.1.6 release has now deprecated the version of wxFileName::Normalize() when no flags are passed into it (done in https://github.com/wxWidgets/wxWidgets/pull/2428). Now wx wants callers to specify the flags they want to use in the call explicitly so that there are no surprises in how it behaves. The main change in behavior with Normalize seems to be related to environment variables (https://github.com/wxWidgets/wxWidgets/pull/2425).

I tried compiling the current mater branch, and it shows at least one deprecation warning when compiled against wx v3.1.6-final tag. (there are probably more warnings, but this is where I got to in my compilation so far).

[ 47%] Building CXX object libraries/lib-files/CMakeFiles/lib-files.dir/FileNames.cpp.o
/home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-files/FileNames.cpp: In function ‘void FileNames::AddUniquePathToPathList(const FilePath&, FilePaths&)’:
/home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-files/FileNames.cpp:567:22: warning: ‘bool wxFileName::Normalize()’ is deprecated: specify the wanted flags explicitly to avoid surprises [-Wdeprecated-declarations]
  567 |    pathNorm.Normalize();
      |    ~~~~~~~~~~~~~~~~~~^~
In file included from /home/imcinerney/dev/wxwidgets/code/dev-latest/include/wx/fileconf.h:22,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-preferences/FileConfig.h:17,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-preferences/Prefs.h:44,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-files/FileNames.h:17,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-files/FileNames.cpp:23:
/home/imcinerney/dev/wxwidgets/code/dev-latest/include/wx/filename.h:366:10: note: declared here
  366 |     bool Normalize()
      |          ^~~~~~~~~

imciner2 avatar Apr 07 '22 23:04 imciner2

And apparently wxPATH_NORM_ALL is also deprecated:

/home/imcinerney/dev/fedora/audacity/upstream/src/export/ExportCL.cpp: In member function ‘virtual bool ExportCL::CheckFileName(wxFileName&, int)’:
/home/imcinerney/dev/fedora/audacity/upstream/src/export/ExportCL.cpp:753:18: warning: ‘wxPATH_NORM_ALL’ is deprecated: specify the wanted flags explicitly to avoid surprises [-Wdeprecated-declarations]
  753 |    cmd.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_ABSOLUTE);
      |                  ^~~~~~~~~~~~~~~
In file included from /home/imcinerney/dev/wxwidgets/code/dev-latest/include/wx/fileconf.h:22,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-preferences/FileConfig.h:17,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-preferences/Prefs.h:44,
                 from /home/imcinerney/dev/fedora/audacity/upstream/libraries/lib-files/FileNames.h:17,
                 from /home/imcinerney/dev/fedora/audacity/upstream/src/export/ExportCL.cpp:30:
/home/imcinerney/dev/wxwidgets/code/dev-latest/include/wx/filename.h:83:5: note: declared here
   83 |     wxPATH_NORM_ALL
      |     ^~~~~~~~~~~~~~~

imciner2 avatar Apr 08 '22 02:04 imciner2

Can confirm same thing in openSUSE

plater avatar Apr 19 '22 09:04 plater

@crsib @LWinterberg

The original poster @imciner2 BUMPed this today on the Audacity devel mailing list complaining that nothing seems to be happening about this.

Hi, I maintain Audacity for openSUSE, I have a build failure after wxWidgets was updated to 3.1.6.

petersampsonaudacity avatar Apr 20 '22 10:04 petersampsonaudacity

The original poster @imciner2 BUMPed this today on the Audacity devel mailing list complaining that nothing seems to be happening about this.

I did not bump or "complain that nothing seems to be happening about this" on the dev list, and did not even mention this there. I had asked for someone to review two PRs (#2776 and #2777) I made that contributed actual code to fix issues I had found that necessitated me carrying patches in the Fedora Audacity package. I made no such "complaint" about a lack of work on this in the 12 days since I opened it.

imciner2 avatar Apr 20 '22 10:04 imciner2

OOPS sorry to malign you Ian @imciner2 - please accept my sincere apologies

I should have looked more closely at the post on the devel list - it was Dave Plater who made the comment there

Dave Plater [email protected] via lists.sourceforge.net to audacity-devel

Hi, I maintain Audacity for openSUSE, I have a build failure after wxWidgets was updated to 3.1.6. There's an issue relating to this on github: https://github.com/audacity/audacity/issues/2774 but nothing seems to be happening. My first build failure is at: /home/davepl/rpmbuild/BUILD/audacity-Audacity-3.1.3/src/AudacityApp.cpp:1001:1: error: ‘wxString::wxString(int)’ is private within this context }; ^ In file included from /home/davepl/rpmbuild/BUILD/audacity-Audacity-3.1.3/libraries/lib-strings/Identifier.h:15:0, from /home/davepl/rpmbuild/BUILD/audacity-Audacity-3.1.3/src/AudacityApp.h:18, from /home/davepl/rpmbuild/BUILD/audacity-Audacity-3.1.3/src/AudacityApp.cpp:19: /usr/include/wx-3.1/wx/string.h:324:3: note: declared private here wxString(int); ^~~~~~~~

Thanks for your help,

Dave Plater


petersampsonaudacity avatar Apr 20 '22 12:04 petersampsonaudacity

In the meantime wxwidgets 3.2.0 has finally been released and without the patches in #2776, builds on downstream distributions do not work.

@crsib An update which includes the fixes would be much appreciated!

dvzrv avatar Jul 25 '22 13:07 dvzrv

#2776 is merged. There are no plans to backport to 3.1.

We are working hard on getting 3.2 out and there is no capacity to backport pathces

crsib avatar Jul 25 '22 14:07 crsib