Skip to content
Snippets Groups Projects
  1. Oct 26, 2023
  2. Sep 06, 2023
  3. Jul 06, 2023
    • Mike Hommey's avatar
      Bug 1840537 - Enable value checking in moz.build for CONFIG variables derived... · 2fddbb74
      Mike Hommey authored
      Bug 1840537 - Enable value checking in moz.build for CONFIG variables derived from target.*. r=firefox-build-system-reviewers,andi,sergesanspaille
      
      This makes the types from mozbuild.configure.constants repr()-able, and
      repr()-ed in config.status, which, when processing moz.build, translates
      into value checking for comparison tests involving the variables.
      
      To make them pickable, though, we replace the use of EnumString.subclass
      with actual subclassing, which is a little less convenient, but avoids
      having to figure out how to make the classes EnumString.subclass creates
      pickable.
      
      This caught some mismatches in media/libpng and third_party/libsrtp.
      
      This also means we don't need to normalize the config before dumping it
      in config.status, because the only types that this was actually useful
      for are these (historically, we'd also turn byte strings into unicode
      strings but that hasn't been a thing for 4 years ; the special treatment
      of dicts and iterables was there to apply the normalization recursively,
      not to normalize dicts and iterables themselves). We still normalization
      before passing values to gyp, though.
      
      Differential Revision: https://phabricator.services.mozilla.com/D182141
      2fddbb74
  4. Jul 04, 2023
  5. Jul 03, 2023
    • Mike Hommey's avatar
      Bug 1840537 - Enable value checking in moz.build for CONFIG variables derived... · 24ef0144
      Mike Hommey authored
      Bug 1840537 - Enable value checking in moz.build for CONFIG variables derived from target.*. r=firefox-build-system-reviewers,andi,sergesanspaille
      
      This makes the types from mozbuild.configure.constants repr()-able, and
      repr()-ed in config.status, which, when processing moz.build, translates
      into value checking for comparison tests involving the variables.
      
      To make them pickable, though, we replace the use of EnumString.subclass
      with actual subclassing, which is a little less convenient, but avoids
      having to figure out how to make the classes EnumString.subclass creates
      pickable.
      
      This caught a mismatch in media/libpng.
      
      Differential Revision: https://phabricator.services.mozilla.com/D182141
      24ef0144
  6. Jun 28, 2023
  7. Jun 27, 2023
  8. Jun 21, 2023
  9. Jun 19, 2023
  10. May 29, 2023
  11. Dec 23, 2022
  12. Nov 24, 2022
  13. Aug 30, 2022
  14. Dec 23, 2021
  15. Nov 26, 2021
  16. Nov 24, 2021
    • Mitchell Hentges's avatar
      Bug 1730712: Command virtualenvs should include Mach's import scope. r=ahal · c58d0e6b
      Mitchell Hentges authored
      Mach's import scope includes:
      * Its `pth` entries
      * Its pip packages, which is either:
          * The Mach virtualenv site-packages, if packages were "pip
            installed" over the internet.
          * The system environment's site-packages, if installing packages
            over the internet is disabled and Mach is grabbing packages from
            the system Python instead.
      
      Command virtualenvs _already_ had this import scope when they were
      dynamically activated from an existing Mach process. However, when
      used directly (e.g. by `<venv>/bin/python <script>`), they would be
      missing this import scope, which was a confusing inconsistency.
      
      However, resolving this inconsistency adds a new risk: when Mach is
      using the system Python, the system packages now populate the same
      context as command virtualenv packages - and they hadn't been checked
      for compatibility. So, this patch also
      includes behaviour to verify system<=>command-venv compatibility at
      activation-time.
      
      A few notes about this system-package-verification:
      * It happens at virtualenv activation-time instead of build-time because
        system packages may change after the virtualenv is built.
      * It takes roughly 1.5s, which is significant, but it should mainly occur
        in CI, where it's acceptable. Devs using `MACH_USE_SYSTEM_PACKAGES`
        should unset the variable to avoid the time delay.
      * The algorithm works by asserting top-level requirements (e.g.
        `psutil>=5.4.2,<=5.8.0`), then runs `pip check` over the combined set
        of packages that would be in-scope.
      * Note that, in this patch, system packages are *not* asserted to be
        the same version as their vendored counterparts. This is because, until
        we parse `third_party/python/requirements.in`, we don't know which
        packages we depend on directly (and whose APIs we care about if they
        change). Since leaning on system packages is essentially only used in
        CI (which we have strong control on), this downside seemed acceptable.
      
      Differential Revision: https://phabricator.services.mozilla.com/D126288
      c58d0e6b
  17. Nov 17, 2021
    • Mitchell Hentges's avatar
      Bug 1730712: Split site manager into command and mach managers r=ahal · 84e16b0d
      Mitchell Hentges authored
      The command site manager needs to be able to do ad-hoc pip
      installations, while the Mach site manager needs to manage
      the system `sys.path` and conditionally create an on-disk
      virtualenv.
      
      By splitting the class into two, we can now give each use case the
      attention it deserves.
      
      Differential Revision: https://phabricator.services.mozilla.com/D129529
      84e16b0d
    • Mitchell Hentges's avatar
      Bug 1730712: Update "Moz site" terminology r=ahal · 725792bd
      Mitchell Hentges authored
      The existing terminology had two issues:
      * `VirtualenvManager` wasn't always associated with an on-disk
        `virtualenv`: for example, when running in automation, Mach
        "activates" a `VirtualenvManager`, updating its import scope,
        but without ever creating an on-disk `virtualenv`.
      * An upcoming patch splits the `VirtualenvManager` class, pulling
        "on-disk virtualenv-handling functions" from the project-wide
        interface for managing Python's import scope.
      
      After some good discussion with Ahal, I think we've struck
      the terminology that handles this distinction well: we'll call
      the "import scope"-handling part the "site", and we'll continue
      to call on-disk virtualenvs (and their representative classes)
      as, well, virtualenvs.
      
      Differential Revision: https://phabricator.services.mozilla.com/D130391
      725792bd
  18. Nov 09, 2021
  19. Nov 04, 2021
  20. Oct 27, 2021
  21. Sep 28, 2021
    • Mitchell Hentges's avatar
      Bug 1723031: Allow flexible dependency-specification in the Mach venv r=ahal · 9c77153d
      Mitchell Hentges authored
      There's some trade-offs in play here: the major issue is that we can't
      pin `psutil`'s because it's pre-installed on some CI workers with a
      different version (5.4.2).
      
      Additionally, we can't "just" bump that version, because CI workers jump
      between different revisions to do work, so a specific pinned version
      won't work when we try to update such a package.
      
      One option is that we could avoid validating package versions in CI, but
      then that will cause surprises (heck, I didn't know we were still using
      `psutil==5.4.2` instead of `5.8.0` until now). By doing validation, we
      make it more explicit and avoid accidentally depending on behaviour of
      too new of such a package.
      
      However, in most cases, we manage the installation environment and can
      pin dependencies. So, I've made the top-level Mach virtualenv the _only_
      one that is able to use requirement specifiers other than "==".
      
      Differential Revision: https://phabricator.services.mozilla.com/D122889
      9c77153d
    • Mitchell Hentges's avatar
      Bug 1717051: Reuse "requirements" logic in mach_initialize r=ahal · 0eb329a6
      Mitchell Hentges authored
      Rather than re-implementing it as `search_path()`, use the existing
      `MachEnvRequirements` tool to parse `mach_virtualenv_requirements.txt`
      
      Differential Revision: https://phabricator.services.mozilla.com/D126280
      0eb329a6
  22. Sep 27, 2021
    • criss's avatar
      Backed out 10 changesets (bug 1712151, bug 1724279, bug 1730712, bug 1717051,... · f2dcba95
      criss authored
      Backed out 10 changesets (bug 1712151, bug 1724279, bug 1730712, bug 1717051, bug 1723031, bug 1731145) for causing failures on test_yaml.py
      Backed out changeset 7f64d538701b (bug 1723031)
      Backed out changeset 394152994966 (bug 1723031)
      Backed out changeset 9bfeb01bcc9a (bug 1723031)
      Backed out changeset 3d283616a57d (bug 1730712)
      Backed out changeset bc677b409650 (bug 1724279)
      Backed out changeset 784c94c2f528 (bug 1723031)
      Backed out changeset 6e1bde40e3b4 (bug 1723031)
      Backed out changeset 7adf7e2136a3 (bug 1712151)
      Backed out changeset 2aef162b9a1b (bug 1717051)
      Backed out changeset 9beeb6d3d95b (bug 1731145)
      f2dcba95
    • Mitchell Hentges's avatar
      Bug 1723031: Allow flexible dependency-specification in the Mach venv r=ahal · f3f13dfc
      Mitchell Hentges authored
      There's some trade-offs in play here: the major issue is that we can't
      pin `psutil`'s because it's pre-installed on some CI workers with a
      different version (5.4.2).
      
      Additionally, we can't "just" bump that version, because CI workers jump
      between different revisions to do work, so a specific pinned version
      won't work when we try to update such a package.
      
      One option is that we could avoid validating package versions in CI, but
      then that will cause surprises (heck, I didn't know we were still using
      `psutil==5.4.2` instead of `5.8.0` until now). By doing validation, we
      make it more explicit and avoid accidentally depending on behaviour of
      too new of such a package.
      
      However, in most cases, we manage the installation environment and can
      pin dependencies. So, I've made the top-level Mach virtualenv the _only_
      one that is able to use requirement specifiers other than "==".
      
      Differential Revision: https://phabricator.services.mozilla.com/D122889
      f3f13dfc
    • Mitchell Hentges's avatar
      Bug 1717051: Reuse "requirements" logic in mach_initialize r=ahal · b9d05720
      Mitchell Hentges authored
      Rather than re-implementing it as `search_path()`, use the existing
      `MachEnvRequirements` tool to parse `mach_virtualenv_requirements.txt`
      
      Differential Revision: https://phabricator.services.mozilla.com/D126280
      b9d05720
  23. Jul 16, 2021
  24. Oct 26, 2020
    • Ricky Stewart's avatar
      Bug 1654103: Standardize on Black for Python code in `mozilla-central`. · 02a7b4eb
      Ricky Stewart authored
      Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
      
      To produce this patch I did all of the following:
      
      1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
      
      2. Run ./mach lint --linter black --fix
      
      3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
      
      4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
      
      5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
      
      # ignore-this-changeset
      
      Differential Revision: https://phabricator.services.mozilla.com/D94045
      02a7b4eb
  25. Oct 24, 2020
    • Bogdan Tara's avatar
      Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for... · da1098d4
      Bogdan Tara authored
      Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
      
      Backed out changeset ff3fb0b4a512 (bug 1672023)
      Backed out changeset e7834b600201 (bug 1654103)
      Backed out changeset 807893ca8069 (bug 1518999)
      Backed out changeset 13e6b92440e9 (bug 1518999)
      Backed out changeset 8b2ac5a6c98a (bug 1518999)
      Backed out changeset 575748295752 (bug 1518999)
      Backed out changeset 65f07ce7b39b (bug 1518999)
      Backed out changeset 4bb80556158d (bug 1518999)
      Backed out changeset 8ac8461d7bd7 (bug 1518999)
      Backed out changeset e8ba13ee17f5 (bug 1518999)
      da1098d4
  26. Oct 23, 2020
    • Ricky Stewart's avatar
      Bug 1654103: Standardize on Black for Python code in `mozilla-central`.... · c0cea3b0
      Ricky Stewart authored
      Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
      
      Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
      
      To produce this patch I did all of the following:
      
      1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
      
      2. Run ./mach lint --linter black --fix
      
      3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
      
      4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
      
      5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
      
      # ignore-this-changeset
      
      Differential Revision: https://phabricator.services.mozilla.com/D94045
      c0cea3b0
  27. Oct 22, 2020
  28. Oct 21, 2020
    • Ricky Stewart's avatar
      Bug 1654103: Standardize on Black for Python code in `mozilla-central`.... · 50762dac
      Ricky Stewart authored
      Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
      
      Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
      
      To produce this patch I did all of the following:
      
      1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
      
      2. Run ./mach lint --linter black --fix
      
      3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
      
      4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
      
      # ignore-this-changeset
      
      Differential Revision: https://phabricator.services.mozilla.com/D94045
      50762dac
  29. Oct 20, 2020
    • Mike Hommey's avatar
      Bug 1671424 - Move configure execution from client.mk to `mach configure`.... · 54f61412
      Mike Hommey authored
      Bug 1671424 - Move configure execution from client.mk to `mach configure`. r=firefox-build-system-reviewers,rstewart
      
      `mach configure` currently runs the equivalent to `make -f client.mk`.
      This is history, and essentially does the following:
      - Create `configure` and `js/src/configure` from `configure.in` and
      `js/src/configure.in` respectively.
      - Create the objdir.
      - Run `configure` from the objdir.
      
      The `configure` script is, nowadays, only really used as a means to set
      OLD_CONFIGURE (and also for people who want to run `configure`,
      literally, as in the `configure; make` workflow). `mach configure`
      actually doesn't need it. Neither does recursing into `js/src` require
      `js/src/configure`, since bug 1520340 (and now as of bug 1669633, we
      don't even recurse).
      
      Because configure.py can actually derive OLD_CONFIGURE on its own
      (except for `js/src/configure`, but `mach configure` doesn't run that),
      we don't really need `configure` for `mach configure`.
      
      So all in all, we're at a point in history where it's straightforward to
      just initiate configure.py from mach configure, so we just do that.
      
      And in the hypothetical case where the `mach configure` code is somehow
      running in python2, we get the mach virtualenv python3 and use it to
      execute `configure.py`.
      
      Differential Revision: https://phabricator.services.mozilla.com/D93741
      54f61412
  30. Oct 19, 2020
    • Narcis Beleuzu's avatar
    • Mike Hommey's avatar
      Bug 1671424 - Move configure execution from client.mk to `mach configure`.... · fcd16177
      Mike Hommey authored
      Bug 1671424 - Move configure execution from client.mk to `mach configure`. r=firefox-build-system-reviewers,rstewart
      
      `mach configure` currently runs the equivalent to `make -f client.mk`.
      This is history, and essentially does the following:
      - Create `configure` and `js/src/configure` from `configure.in` and
      `js/src/configure.in` respectively.
      - Create the objdir.
      - Run `configure` from the objdir.
      
      The `configure` script is, nowadays, only really used as a means to set
      OLD_CONFIGURE (and also for people who want to run `configure`,
      literally, as in the `configure; make` workflow). `mach configure`
      actually doesn't need it. Neither does recursing into `js/src` require
      `js/src/configure`, since bug 1520340 (and now as of bug 1669633, we
      don't even recurse).
      
      Because configure.py can actually derive OLD_CONFIGURE on its own
      (except for `js/src/configure`, but `mach configure` doesn't run that),
      we don't really need `configure` for `mach configure`.
      
      So all in all, we're at a point in history where it's straightforward to
      just initiate configure.py from mach configure, so we just do that.
      
      And in the hypothetical case where the `mach configure` code is somehow
      running in python2, we get the mach virtualenv python3 and use it to
      execute `configure.py`.
      
      Differential Revision: https://phabricator.services.mozilla.com/D93741
      fcd16177
  31. Oct 07, 2020
    • Mike Hommey's avatar
      Bug 1669633 - Don't recurse into js/src for the python-part of configure.... · 9ebbe2c5
      Mike Hommey authored
      Bug 1669633 - Don't recurse into js/src for the python-part of configure. r=firefox-build-system-reviewers,rstewart
      
      Instead, we now run js/src/old-configure from the top-level configure
      after having run old-configure and extracted a few variables to inherit
      from it.
      
      Because we're now running from the top-level, $_objdir is always the
      top-level objdir, which simplifies some things. The topobjdir in
      js/src/config.status, however, needs to stay in js/src because of the
      build frontend expecting it there.
      
      When running js/src/old-configure, we used to need some special
      treatment for a large number of variables for historic reasons, where
      we'd take values from the assigned values before running old-configure
      for some, or from AC_SUBSTs after running old-configure.
      
      Now that both old-configure and js/src/old-configure get the same
      assignments from old-configure.vars, we don't need anything special for
      the former. And only a few remaining variables still need manual work
      for the latter.
      
      One notable difference, though, is that the new code doesn't try to
      avoid running js subconfigure, which added complexity, and was actually
      error-prone.
      
      Differential Revision: https://phabricator.services.mozilla.com/D92725
      9ebbe2c5
Loading