Skip to content
Snippets Groups Projects
  1. May 11, 2020
    • Manuel Jacob's avatar
      demandimport: fix compatibility with meta path finders w/o find_spec() method · a6e12d477595
      Manuel Jacob authored
      Meta path finders got a find_spec() method in Python version 3.4. The
      sys.meta_path documentation says that the deprecated find_module() method is
      used as a fallback.
      
      Setuptool’s VendorImporter still doesn’t have the find_spec() method,
      which resulted in a crash e.g. within a virtual environment. For reference, I
      opened an issue for that: https://github.com/pypa/setuptools/issues/2104.
      
      An alternative implementation would have been to implement a wrapper for
      find_module() itself and raise an AttributeError when accessing find_spec() if
      the wrapped finder doesn’t have it.
      a6e12d477595
  2. May 07, 2020
    • Jörg Sonnenberger's avatar
      tests: fix timer scaling in wait-on-file · 9d7d53771e5f
      Jörg Sonnenberger authored
      When using the default test timeouts, wait-on-file would not wait for $n
      seconds, but $n/100 seconds. This resulted in easy timeouts on even
      moderately busy fast machines. Fix the scaling to apply in all cases.
      Adjust the stepping slightly to be nicer to systems with the historic
      100Hz time base to ensure that the scheduler actually switches to a
      different process and gives them time to work.
      
      Differential Revision: https://phab.mercurial-scm.org/D8505
      9d7d53771e5f
  3. May 09, 2020
    • Pierre-Yves David's avatar
      manifest-cache: ignore IOError while writing · 35bb67427f63
      Pierre-Yves David authored
      If the wcache directory is non writable for some reason (eg: belong to root).
      Trying to write to it currently crash Mercurial. Instead we ignore the error and
      skip writing that cache.
      
      We should probably improve the user experience of multiple users interacting
      with the same repository. However this is not an adventure for stable.
      
      Differential Revision: https://phab.mercurial-scm.org/D8512
      35bb67427f63
  4. May 06, 2020
  5. May 07, 2020
  6. Apr 26, 2020
  7. Apr 24, 2020
  8. May 07, 2020
    • Rodrigo Damazio Bovendorp's avatar
      procutil: always waiting on child processes to prevent zombies with 'hg serve' · ed684a82e29b
      Rodrigo Damazio Bovendorp authored
      When runbgcommand is invoked by an extension with ensurestart=False, we never
      called waitpid - which is fine in most cases, except if that's happening on a
      command server (e.g. chg), in which case the child defunct process will just
      sit there for as long as the server is running.
      
      The actual semantics of SIGCHLD signal handling is a lot more complex than
      it seems, and the POSIX standard *seems* to read that it's ignored by default
      and everything would just work without the waitpid if we're not listening for
      it, but the truth is that it's only ignored if we *explicitly* set it to
      SIG_IGN. We further cannot set it to SIG_IGN or to a catch-all handler across
      all of 'hg serve', because Python's suprocess.Popen relies on that signal,
      and a few specific parts of hg also set custom handlers, so instead we wait
      for specific PIDs in dedicated threads.
      
      I did a poor-man's benchmark of the thread creation and it seems to take
      about 1ms, which is way better than the 20+ms from ensurestart=True.
      
      Differential Revision: https://phab.mercurial-scm.org/D8497
      ed684a82e29b
    • Jörg Sonnenberger's avatar
      tests: use regular POSIX shell · f727939f3513
      Jörg Sonnenberger authored
      wait-on-file requires one POSIX extension (sleep with non-integral
      argument), but it doesn't require any bash extensions, so just require a
      normal POSIX shell. While here, use consistent formatting without
      redundant ;
      
      Differential Revision: https://phab.mercurial-scm.org/D8500
      f727939f3513
    • Raphaël Gomès's avatar
      rust-regex: increase the DFA size limit for the `regex` crate · b15a37d85dbe
      Raphaël Gomès authored
      `re2`'s DFA limit is already increased in `rust/hg-core/src/re2/rust_re2.cpp`,
      the same has to be done for the `regex` crate.
      
      Big repositories with big `.hgignore`s will sometimes hit this limit and face
      extreme performance regressions (I've seen one take *minutes* for `hg status`).
      
      Differential Revision: https://phab.mercurial-scm.org/D8499
      b15a37d85dbe
  9. May 01, 2020
  10. Apr 16, 2020
  11. Apr 24, 2020
    • Gregory Szorc's avatar
      automation: support building Python 3 MSI installers · 5e788dc7fb5d
      Gregory Szorc authored
      This is very similar to what we just did for Inno.
      
      Differential Revision: https://phab.mercurial-scm.org/D8484
      5e788dc7fb5d
    • Gregory Szorc's avatar
      automation: support building Python 3 Inno installers · 802ee93c205d
      Gregory Szorc authored
      The core packaging code now supports building Python 3 installers
      using PyOxidizer. Let's teach the automation code to invoke it so
      that we produce both Python 2 and Python 3 based exe installers.
      
      When publishing the artifacts, the Python 3 versions are preferred
      over the Python 2 versions given their higher weight (10 versus 9).
      This may be a controversial change. But I think making Python 3
      the default is warranted, as it is the future. The Python 2 installers
      are still fully supported and can be installed should issues with
      Python 3 arise.
      
      Differential Revision: https://phab.mercurial-scm.org/D8483
      802ee93c205d
    • Gregory Szorc's avatar
      automation: add extra arguments when building Inno · 47609da15379
      Gregory Szorc authored
      These were being fed into the template expansion but not being
      used. This meant --version was not getting set when it should have
      been.
      
      Differential Revision: https://phab.mercurial-scm.org/D8482
      47609da15379
    • Gregory Szorc's avatar
      packaging: add -python2 to Windows installer filenames · 9ade217b550d
      Gregory Szorc authored
      We just taught the Windows installers to produce Python 3 variants
      built with PyOxidizer.
      
      Our plan is to publish both Python 2 and Python 3 versions of the
      installers for Mercurial 5.4.
      
      This commit teaches the Inno and WiX installers to add an optional
      string suffix to the installer name. On Python 2, that suffix is
      "-python2." We reserve the existing name for the Python 3 installers,
      which we want to make the default.
      
      Differential Revision: https://phab.mercurial-scm.org/D8479
      9ade217b550d
    • Gregory Szorc's avatar
      automation: support building Windows wheels for Python 3.7 and 3.8 · 9d441f820c8b
      Gregory Szorc authored
      The time has come to support Python 3 on Windows.
      
      Let's teach our automation code to produce Windows wheels for
      Python 3.7 and 3.8.
      
      We could theoretically support 3.5 and 3.6. But I don't think
      it is worth it. People on Windows generally use the Mercurial
      installers, not wheels. And I'd prefer we limit variability
      and not have to worry about supporting earlier Python versions
      if it can be helped.
      
      As part of this, we change the invocation of pip to `python.exe -m pip`,
      as this is what is being recommended in Python docs these days. And
      it seemed to be required to avoid a weird build error. Why, I'm not
      sure. But it looks like pip was having trouble finding a Visual Studio
      files when invoked as `pip.exe` but not when using `python.exe -m pip`.
      Who knows.
      
      Differential Revision: https://phab.mercurial-scm.org/D8478
      9d441f820c8b
  12. Apr 21, 2020
    • Gregory Szorc's avatar
      packaging: support building WiX installers with PyOxidizer · 234882d17814
      Gregory Szorc authored
      We initially implemented PyOxidizer support for Inno installers.
      That did most of the heavy work of integrating PyOxidizer into
      the packaging system. Implementing WiX installer support was
      pretty straightforward.
      
      Aspects of this patch look very similar to Inno's.
      
      The main difference is the handling of the Visual C++
      Redistributable Runtime files.
      
      The WiX installer was formerly using merge modules to
      install the VC++ 9.0 runtime because this feature is
      supported by the WiX installer (it isn't easily available
      to Inno installers).
      
      Our strategy for the runtime files is to install the
      vcruntime140.dll file next to hg.exe just like any other
      file. While we could leverage WiX's functionality for invoking
      a VCRedist installer, I don't want to deal with the complexity
      at this juncture. So, we let run_pyoxidizer() copy vcruntime140.dll
      into the staging directory (like it does for Inno) and our
      dynamic WiX XML generator picks it up as a regular file and
      installs it.
      
      We did, however, have to teach mercurial.wxs how to conditionally
      use the merge modules. But this was rather straightforward.
      
      Comparing the file layout of the WiX installers before and
      after:
      
      * Various lib/*.{pyd, dll} files no longer exist
      * python27.dll was replaced by python37.dll
      * vcruntime140.dll was added
      
      All these changes are expected due to the transition to
      Python 3 and to PyOxidizer, which embeded the .pyd and .dll files
      in hg.exe.
      
      Differential Revision: https://phab.mercurial-scm.org/D8477
      234882d17814
    • Gregory Szorc's avatar
      packaging: move version derivation to run_wix_packaging() · a5740490eb5f
      Gregory Szorc authored
      With the previous commit moving signing inline, we no
      longer need to compute the version string in build_installer()
      and can instead move this logic to run_wix_packaging(). This
      makes the logic in build_installer() simpler, which makes it
      easier to implement alternate building mechanisms.
      
      Differential Revision: https://phab.mercurial-scm.org/D8476
      a5740490eb5f
    • Gregory Szorc's avatar
      packaging: integrate signing into run_wix_packaging() · a39984091380
      Gregory Szorc authored
      Previously, signing was implemented via a separate function
      which called build_installer() and then called signing
      functionality.
      
      In this model, in order to implement an alternative build
      mechanism, we would have to invent a new variant to handle
      signing as well.
      
      This commit merges the signing logic into the function invoking
      wix. If we pass an argument holding metadata about how to sign,
      we sign hg.exe and the installer. This means all we have to
      do is pass in signing info and the signing just works.
      
      A slight change here is that signing of hg.exe happens in the
      staging directory as opposed to before the staging directory
      is populated. I don't think this matters.
      
      Differential Revision: https://phab.mercurial-scm.org/D8475
      a39984091380
    • Gregory Szorc's avatar
      packaging: isolate invocation of WiX to own function · 92627c42e7c2
      Gregory Szorc authored
      Like we did for Inno, we want to split out the building
      of Mercurial from invoking the packaging tool so that we
      can introduce an alternate build mechanism.
      
      As part of this refactor, there are inconsequential changes
      to file layouts. Before, some shared files such as the
      WiX binaries and merge modules would be installed under
      build/. Now, they are installed under build/wix-*. This
      is to keep implementation simpler. But it also helps keep
      build state more isolated.
      
      Differential Revision: https://phab.mercurial-scm.org/D8474
      92627c42e7c2
  13. Apr 24, 2020
    • Gregory Szorc's avatar
      packaging: support building Inno installer with PyOxidizer · 94f4f2ec7dee
      Gregory Szorc authored
      We want to start distributing Mercurial on Python 3 on
      Windows. PyOxidizer will be our vehicle for achieving that.
      
      This commit implements basic support for producing Inno
      installers using PyOxidizer.
      
      While it is an eventual goal of PyOxidizer to produce
      installers, those features aren't yet implemented. So our
      strategy for producing Mercurial installers is similar to
      what we've been doing with py2exe: invoke a build system to
      produce files then stage those files into a directory so they
      can be turned into an installer.
      
      We had to make significant alterations to the pyoxidizer.bzl
      config file to get it to produce the files that we desire for
      a Windows install. This meant differentiating the build targets
      so we can target Windows specifically.
      
      We've added a new module to hgpackaging to deal with interacting
      with PyOxidizer. It is similar to pyexe: we invoke a build process
      then copy files to a staging directory. Ideally these extra
      files would be defined in pyoxidizer.bzl. But I don't think it
      is worth doing at this time, as PyOxidizer's config files are
      lacking some features to make this turnkey.
      
      The rest of the change is introducing a variant of the
      Inno installer code that invokes PyOxidizer instead of
      py2exe.
      
      Comparing the Python 2.7 based Inno installers with this
      one, the following changes were observed:
      
      * No lib/*.{pyd, dll} files
      * No Microsoft.VC90.CRT.manifest
      * No msvc{m,p,r}90.dll files
      * python27.dll replaced with python37.dll
      * Add vcruntime140.dll file
      
      The disappearance of the .pyd and .dll files is acceptable, as
      PyOxidizer has embedded these in hg.exe and loads them from
      memory.
      
      The disappearance of the *90* files is acceptable because those
      provide the Visual C++ 9 runtime, as required by Python 2.7.
      Similarly, the appearance of vcruntime140.dll is a requirement
      of Python 3.7.
      
      Differential Revision: https://phab.mercurial-scm.org/D8473
      94f4f2ec7dee
  14. Apr 19, 2020
  15. Apr 30, 2020
    • Elmar Bartel's avatar
      diff: re-establish linear runtime performance · e58422afbc74
      Elmar Bartel authored
      The previous method with sum() and list() creates a new list object
      for every hunk. Then sum() is used to flatten out this sequence of
      lists.  The sum() function is not "lazy", but creates a new list object
      for every "+" operation and so this code had quadratic runtime behaviour.
      e58422afbc74
  16. Apr 23, 2020
  17. Apr 20, 2020
  18. Apr 15, 2020
    • Pierre-Yves David's avatar
      upgrade: properly filter action depending on planned work · c36a3fcfc36b
      Pierre-Yves David authored
      The `determineactions` function filters out deficiency that are not scheduled to
      be fixed by the target repository configuration. However it only did so for
      requirement we currently support, letting other actions for unsupported
      requirement through even if the target repo configuration did not request it.
      
      As a result the output of the command was easily polluted by experimental
      feature with no upgrade support.
      
      We rework the code to still filter out requirement based action without the
      faulty filtering.
      
      Differential Revision: https://phab.mercurial-scm.org/D8427
      c36a3fcfc36b
  19. Apr 13, 2020
  20. Apr 16, 2020
  21. Apr 20, 2020
  22. Mar 28, 2020
Loading