[med-svn] [Git][med-team/castxml][master] 4 commits: New upstream version 0.4.5

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed Apr 6 19:49:07 BST 2022



Étienne Mollier pushed to branch master at Debian Med / castxml


Commits:
c70afae8 by Étienne Mollier at 2022-04-05T20:36:17+02:00
New upstream version 0.4.5
- - - - -
4fe03b22 by Étienne Mollier at 2022-04-05T20:36:17+02:00
routine-update: New upstream version

- - - - -
c5d440de by Étienne Mollier at 2022-04-05T20:36:18+02:00
Update upstream source from tag 'upstream/0.4.5'

Update to upstream version '0.4.5'
with Debian dir d03ea076fed7eafc7534e9081668714fc3da5216
- - - - -
db91224a by Étienne Mollier at 2022-04-05T20:38:20+02:00
routine-update: Ready to upload to unstable

- - - - -


7 changed files:

- debian/changelog
- src/Detect.cxx
- src/Utils.cxx
- src/Utils.h
- src/Version.cmake
- test/expect/cmd.cc-msvc-bad-cmd.stderr.txt
- test/expect/cmd.cc-msvc-c-bad-cmd.stderr.txt


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+castxml (0.4.5-1) unstable; urgency=medium
+
+  * New upstream version
+
+ -- Étienne Mollier <emollier at debian.org>  Tue, 05 Apr 2022 20:36:27 +0200
+
 castxml (0.4.4-1) unstable; urgency=medium
 
   [ Gert Wollny ]


=====================================
src/Detect.cxx
=====================================
@@ -18,6 +18,7 @@
 #include "Options.h"
 #include "Utils.h"
 
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Triple.h"
@@ -184,11 +185,38 @@ static bool detectCC_MSVC(const char* const* argBeg, const char* const* argEnd,
   std::string out;
   std::string err;
   std::string msg;
+
+  // Create a temporary directory to hold some temporary files.
+  llvm::SmallString<128> tmpDir;
+  if (std::error_code e =
+        llvm::sys::fs::createUniqueDirectory("castxml", tmpDir)) {
+    msg = e.message();
+    return failedCC(id, cc_args, out, err, msg);
+  }
+
+  // Tell MSVC to put the object file in the temporary directory.
+  // We previously used '-FoNUL' but this does not work on Windows 11.
+  llvm::SmallString<128> tmpObj = tmpDir;
+  tmpObj.append("/detect_vs.obj");
+  llvm::SmallString<128> argFo("-Fo");
+  argFo.append(tmpObj);
+
+  // Extend the original command line with our source and object.
   cc_args.push_back("-c");
-  cc_args.push_back("-FoNUL");
   cc_args.push_back(detect_vs_cpp.c_str());
-  if (runCommand(int(cc_args.size()), &cc_args[0], ret, out, err, msg) &&
-      ret == 0) {
+  cc_args.push_back(argFo.c_str());
+
+  // Run the compiler.
+  bool success =
+    runCommand(int(cc_args.size()), &cc_args[0], ret, out, err, msg) &&
+    ret == 0;
+
+  // Remove temporary object file and directory.
+  llvm::sys::fs::remove(llvm::Twine(tmpObj));
+  llvm::sys::fs::remove(llvm::Twine(tmpDir));
+
+  // Check results.
+  if (success) {
     if (const char* predefs = strstr(out.c_str(), "\n#define")) {
       opts.Predefines = predefs + 1;
     }


=====================================
src/Utils.cxx
=====================================
@@ -119,7 +119,7 @@ unsigned int getVersionPatch()
 }
 
 bool runCommand(int argc, const char* const* argv, int& ret, std::string& out,
-                std::string& err, std::string& msg)
+                std::string& err, std::string& msg, std::string* maybeTmpDir)
 {
   // Find the program to run.
   llvm::ErrorOr<std::string> maybeProg = llvm::sys::findProgramByName(argv[0]);
@@ -131,15 +131,17 @@ bool runCommand(int argc, const char* const* argv, int& ret, std::string& out,
 
   // Create a temporary directory to hold output files.
   llvm::SmallString<128> tmpDir;
-  if (std::error_code e =
-        llvm::sys::fs::createUniqueDirectory("castxml", tmpDir)) {
+  if (maybeTmpDir) {
+    tmpDir = *maybeTmpDir;
+  } else if (std::error_code e =
+               llvm::sys::fs::createUniqueDirectory("castxml", tmpDir)) {
     msg = e.message();
     return false;
   }
   llvm::SmallString<128> tmpOut = tmpDir;
-  tmpOut.append("out");
+  tmpOut.append("/out");
   llvm::SmallString<128> tmpErr = tmpDir;
-  tmpErr.append("err");
+  tmpErr.append("/err");
 
   // Construct file redirects.
   llvm::StringRef inFile; // empty means /dev/null
@@ -185,7 +187,9 @@ bool runCommand(int argc, const char* const* argv, int& ret, std::string& out,
   // Remove temporary files and directory.
   llvm::sys::fs::remove(llvm::Twine(tmpOut));
   llvm::sys::fs::remove(llvm::Twine(tmpErr));
-  llvm::sys::fs::remove(llvm::Twine(tmpDir));
+  if (!maybeTmpDir) {
+    llvm::sys::fs::remove(llvm::Twine(tmpDir));
+  }
 
   return ret >= 0;
 }


=====================================
src/Utils.h
=====================================
@@ -43,7 +43,8 @@ unsigned int getVersionPatch();
 
 /// runCommand - Run a given command line and capture the output.
 bool runCommand(int argc, const char* const* argv, int& ret, std::string& out,
-                std::string& err, std::string& msg);
+                std::string& err, std::string& msg,
+                std::string* maybeTmpDir = nullptr);
 
 /// suppressInteractiveErrors - Disable Windows error dialog popups
 void suppressInteractiveErrors();


=====================================
src/Version.cmake
=====================================
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 4)
-set(CastXML_VERSION_PATCH 4)
+set(CastXML_VERSION_PATCH 5)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)
 
@@ -13,7 +13,7 @@ if(CastXML_VERSION_RC)
 endif()
 
 # If this source was exported by 'git archive', use its commit info.
-set(git_info "2095c10 CastXML 0.4.4")
+set(git_info "7ef4b1e CastXML 0.4.5")
 
 # Otherwise, try to identify the current development source version.
 if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "


=====================================
test/expect/cmd.cc-msvc-bad-cmd.stderr.txt
=====================================
@@ -1,3 +1,3 @@
 ^error: '--castxml-cc-msvc' compiler command failed:
 
- 'cc-msvc-bad-cmd' '-c' '-FoNUL' '.*/share/castxml/detect_vs.cpp'
+ 'cc-msvc-bad-cmd' '-c' '[^']*/share/castxml/detect_vs.cpp' '-Fo[^']*/detect_vs.obj'


=====================================
test/expect/cmd.cc-msvc-c-bad-cmd.stderr.txt
=====================================
@@ -1,3 +1,3 @@
 ^error: '--castxml-cc-msvc-c' compiler command failed:
 
- 'cc-msvc-c-bad-cmd' '-c' '-FoNUL' '.*/share/castxml/detect_vs.c
+ 'cc-msvc-c-bad-cmd' '-c' '[^']*/share/castxml/detect_vs.c' '-Fo[^']*/detect_vs.obj'



View it on GitLab: https://salsa.debian.org/med-team/castxml/-/compare/e896fe5bd4aea51a758345ba8b0ae70117b0637a...db91224a3f6177bdccd70f40da26583d1ed135c2

-- 
View it on GitLab: https://salsa.debian.org/med-team/castxml/-/compare/e896fe5bd4aea51a758345ba8b0ae70117b0637a...db91224a3f6177bdccd70f40da26583d1ed135c2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220406/2ec60442/attachment-0001.htm>


More information about the debian-med-commit mailing list