Sunday, May 2, 2010

Python distutils and manifest files (Visual Studio 2010)

Visual Studio 2005 introduced a new deployment model for Windows client applications based on isolated applications and side-by-side assemblies. The redistributable libraries (such as MFC, ATL, CRT) have been rebuilt as shared side-by-side assemblies and installed in the native assembly cache, WinSxS folder in Windows. This has provided a common location for particular versions of the dll-s and the applications had to declare their dependencies by using a manifest file. The manifest file is an XML file which contain references to the dependent dlls located in WinSxS, these files had to be deployed along with every dll or executable which depend on the redistributables. Without having the manifest (either by a separate file or embedded in the executable as a resource) the application generates an error.
Though the purpose of this change was to simplify deployment, the result was probably the opposite. As a result Microsoft changed deployment requirements in Visual C++ 2010. As of Visual Studio 2010 Microsoft has backed out the manifest generation and no manifests are generated by default with the VC2010 builds. There's no requirement to embed manifests in the executables anymore and CRT-s need not be installed in WinSxS. All you need to do is copy the VC++ dependent DLLs to the application folder and run.

This change may however cause issues for those build systems (like python distutils) which don't expect that the manifest may eventually be missing and stop the compilation in this condition. I don't see any change in this regard in the python SVN trunk either. Fortunately to prevent from this issue we could easily alter the corresponding file (/Lib/distutils/msvc9compiler.py) to something like:

   # embed the manifest
   # XXX - this is somewhat fragile - if mt.exe fails, distutils
   # will still consider the DLL up-to-date, but it will not have a
   # manifest. Maybe we should link to a temp file? OTOH, that
   # implies a build environment error that shouldn't go undetected.
   if os.path.isfile(temp_manifest):
        mfid = 1 if target_desc == CCompiler.EXECUTABLE else 2
        out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
        try:
             self.spawn(['mt.exe', '-nologo', '-manifest',
                  temp_manifest, out_arg])
        except DistutilsExecError as msg:
              raise LinkError(msg)
        else:
              log.debug("skipping %s (up-to-date)", output_filename)

Which may work even if the deployment model will frequently be altered by Microsoft from versions to versions ;-)

31 comments:

  1. Asupan makanan hasil rekayasa genetika dapat memicu peningkatan jumlah makanan sebagian besar berdasarkan situs jayatogel online terpercaya reaksi alergi. Mentransfer gen dari makanan yang menyebabkan alergi pada banyak orang dapat menyebabkan makanan baru di mana gen dipindahkan ke sifat alergen yang sama. Karena modifikasi makanan ini membutuhkan penggunaan bakteri dan virus munculnya gangguan terbaru yang situs totobet terbaik dapat mempengaruhi kesehatan manusia dan menimbulkan tantangan lingkungan pada kenyataannya merupakan kenyataan yang berlarut-larut.

    ReplyDelete
  2. Are you searching for employment practice in Hyderabad? Did you discover one yet? It’s a troublesome nut to crack as a result of every job consultancy in hyderabad is totally different completely and offers different services. Before selecting one, the individual must aid analysis on what services they need and what expectations they need from the task practice in Hyderabad. Their square measure varied choices accessible. select what’s best for you.

    ReplyDelete
  3. From the day I have started the software engineering studies until now, I have faced numerous difficulties in getting my hand on python perfectly. As one of my friends has recommended online academic help, which she is using for getting affordable nursing essay writing services for her academic help. She suggested that contacting them can lead me to someone who will help me with this trouble. Well, I have my fingers crossed and looking forwards to getting the best help for my coding assignments.

    ReplyDelete
    Replies
    1. There is no doubt that students encounter numerous challenges in their daily routine and it's pretty impossible for them to manage the workload by themselves. It is indeed beneficial for students to use cheap essay writing services to overcome challenges by availing assistance from professionals.

      Delete
  4. What an amazing post you are sharing here you describe in well-mannered. I am really wonder reading this and welcome method of writing an article on mobile patrol security services.

    ReplyDelete
  5. I really liked reading your article. I am also a blogger, I know how hard it takes to write a blog or article. You will keep bringing articles on new topics like this, I appreciate it. smsf audit

    ReplyDelete
  6. Python is a programming language. Its design philosophy emphasizes code readability with its use of significant indentation. It is developers favourite choice and Buy Dissertation Online is also developed on Python. Do you like it?

    ReplyDelete
  7. When you think that your child is in need of care since you don't understand their needs then there are special pediatric home health agencies that can take good care of you child with professional staff observing your child and take care of their basic needs.

    ReplyDelete
  8. You have to share a piece of great information but I have searched the Pakistani dress and I have seen the website. In this, there are a lot of Pakistani lawn brands and I know that here you can see all branded and local unstitched, stitched, and kids dress.

    ReplyDelete
  9. Excellent article plus its information and I positively bookmark to this site because here I always get an amazing knowledge as I expect. Thanks for this to share with us Amazon EBC Templates.

    ReplyDelete
  10. These entrance exams take a toll of the candidate who aspires to crack it but with proper knowledge regarding how to top an exam, one can easily clear it. This page intends to furnish relevant information about the exam and the best ways to crack them. Amazon a plus Content

    ReplyDelete
  11. hi, Your post is based on informative things. In my opinion, you will be a great blogger in the future. Keep it up Online Shopping Store in Pakistan.

    ReplyDelete
  12. Nice to be visiting your blog once more, well this article that I've been waited for too long. I want this article to finish my projects within the faculty, and it has same topic together with your article. Thank you so much for sharing this wonderful post.shiza hassan winter collection.

    ReplyDelete
  13. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. managed risk.

    ReplyDelete
  14. Thanks for the sharing information you have shared. Keep it up.
    Sanford Chart

    ReplyDelete
  15. Thanks for the information, I found a lot of interesting information here. Nexus Iceland Employees Login

    ReplyDelete
  16. Thanks for share this information!!!
    MyBalanceNow

    ReplyDelete
  17. I'll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.
    My Sanford Chart

    ReplyDelete
  18. One of our best banking options is the MetaBank ACE Flare Account. The Ace Flare account lets you both check your balance and save money. When compared to our prepaid debit card, customers with ACE Direct Deposit accounts can make more branch withdrawals.

    ReplyDelete
  19. Thank you so much for sharing all of this great information with us. The blogs you write are funny. So useful and easy to understand!
    mynorthsidehr

    ReplyDelete
  20. I admire the work and effort you contributed to this. I gained a lot of new things from this piece of writing. It's delightful to have entry to such helpful data. The piece that followed offered helpful tips and information. I appreciate you sharing your knowledge! Continue your fantastic work! Keep on sharing. I invite you to visit my website.
    Cómo solicitar el divorcio nueva jersey
    cost of uncontested divorce in virginia

    ReplyDelete
  21. I got a impressive and useful information from your blog. MyAccountAccess

    ReplyDelete
  22. This blog post is truly inspiring! I love how you've highlighted the importance of resilience and perseverance in the face of challenges. How Much is A Divorce in New York City Your words have motivated me to keep pushing forward in my own journey. Thank you for sharing such valuable insights and positivity!

    ReplyDelete
  23. Your words have motivated me to keep pushing forward in my own journey. Thank you for sharing such valuable insights and positivity! Wedding venue Montreal

    ReplyDelete
  24. This blog post is truly inspiring! I love how you've highlighted the importance of resilience and perseverance in the face of challenges. pallets delivery montreal

    ReplyDelete
  25. Navigating a protective order virginia necessitates expert legal guidance to protect your well-being, offering support and counsel during sensitive legal proceedings.

    ReplyDelete
  26. Heartfelt appreciation for consistently presenting stellar content on your blog. Your dedication to sharing valuable insights and enthralling material is genuinely treasured. Your blog has evolved into a reliable reservoir of information and inspiration. Keep up the fantastic work!Middlesex County Reckless Driving Attorney and Middlesex County Reckless Driving Lawyer

    ReplyDelete
  27. The article "Python distutils and manifest files (Visual Studio 2010)" offers a detailed guide on integrating Python projects with Visual Studio 2010, focusing on compatibility with legacy systems and optimizing build processes within the Visual Studio environment. New York State Divorce Process

    ReplyDelete