diff --git a/.github/workflows/sapling-cli-getdeps_linux.yml b/.github/workflows/sapling-cli-getdeps_linux.yml index 4665d0be1d979..e36d3fb3632dd 100644 --- a/.github/workflows/sapling-cli-getdeps_linux.yml +++ b/.github/workflows/sapling-cli-getdeps_linux.yml @@ -3,7 +3,12 @@ name: Sapling CLI Getdeps Linux on: - workflow_dispatch + push: + branches: + - main + pull_request: + branches: + - main permissions: contents: read # to fetch code (actions/checkout) diff --git a/build/fbcode_builder/manifests/python b/build/fbcode_builder/manifests/python index 00fed973ca95b..02f8311a0643b 100644 --- a/build/fbcode_builder/manifests/python +++ b/build/fbcode_builder/manifests/python @@ -8,6 +8,11 @@ python@3.8 python3 python3-devel +# Centos Stream 9 default python is 3.9, sapling needs 3.10+ +[rpms.all(distro=centos_stream,distro_vers=9)] +python3.12 +python3.12-devel + # sapling needs dataclasses which arrive in 3.7, and the bionic python is 3.6 [debs.all(distro=ubuntu,distro_vers="18.04")] python3.8-dev diff --git a/build/fbcode_builder/manifests/python-setuptools b/build/fbcode_builder/manifests/python-setuptools index 236cb0b514310..1f6013ddc0bfb 100644 --- a/build/fbcode_builder/manifests/python-setuptools +++ b/build/fbcode_builder/manifests/python-setuptools @@ -11,6 +11,10 @@ builder = python-wheel [rpms] python3-setuptools +# Centos Stream 9 default python is 3.9, sapling needs 3.10+ +[rpms.all(distro=centos_stream,distro_vers=9)] +python3.12-setuptools + [homebrew] python-setuptools diff --git a/eden/scm/lib/commands/debugcommands/cmddebugfilterid/BUCK b/eden/scm/lib/commands/debugcommands/cmddebugfilterid/BUCK index 4e7c92e72241d..6d4d52011da22 100644 --- a/eden/scm/lib/commands/debugcommands/cmddebugfilterid/BUCK +++ b/eden/scm/lib/commands/debugcommands/cmddebugfilterid/BUCK @@ -1,4 +1,3 @@ -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library") oncall("sapling") @@ -20,15 +19,11 @@ rust_library( }, }}, crate_root = "src/lib.rs", - features = [ - "fb", - ], deps = [ "//eden/scm/lib/clidispatch:clidispatch", "//eden/scm/lib/commands/cmdutil:cmdutil", - "//eden/scm/lib/repo:repo", - ] + ([] if rust_oss.is_oss_build() else [ "//eden/scm/lib/filters:filters", + "//eden/scm/lib/repo:repo", "//eden/scm/lib/types:types", - ]), + ], ) diff --git a/eden/scm/lib/commands/debugcommands/cmddebugfilterid/src/lib.rs b/eden/scm/lib/commands/debugcommands/cmddebugfilterid/src/lib.rs index 020366617d62e..4d5ed4b3a6ae2 100644 --- a/eden/scm/lib/commands/debugcommands/cmddebugfilterid/src/lib.rs +++ b/eden/scm/lib/commands/debugcommands/cmddebugfilterid/src/lib.rs @@ -7,17 +7,13 @@ #![allow(unexpected_cfgs)] -#[cfg(feature = "fb")] use std::str::FromStr; use clidispatch::ReqCtx; use cmdutil::define_flags; -#[cfg(feature = "fb")] use filters::filter::FilterGenerator; use repo::repo::Repo; -#[cfg(feature = "fb")] use types::HgId; -#[cfg(feature = "fb")] use types::RepoPathBuf; define_flags! { @@ -34,25 +30,18 @@ define_flags! { } pub fn run(ctx: ReqCtx, repo: &Repo) -> cmdutil::Result { - #[cfg(feature = "fb")] - { - let config = repo.config(); - let mut filter_gen = - FilterGenerator::from_dot_dirs(repo.dot_hg_path(), repo.shared_dot_hg_path(), config)?; - let paths = ctx - .opts - .args - .into_iter() - .map(RepoPathBuf::from_string) - .collect::, _>>()?; - let commit_id = HgId::from_str(&ctx.opts.rev)?; - let filter = filter_gen.generate_filter_id(commit_id, &paths)?; - ctx.core.io.write(filter.id()?)? - } - - #[cfg(not(feature = "fb"))] - let _ = (ctx, repo); - + let config = repo.config(); + let mut filter_gen = + FilterGenerator::from_dot_dirs(repo.dot_hg_path(), repo.shared_dot_hg_path(), config)?; + let paths = ctx + .opts + .args + .into_iter() + .map(RepoPathBuf::from_string) + .collect::, _>>()?; + let commit_id = HgId::from_str(&ctx.opts.rev)?; + let filter = filter_gen.generate_filter_id(commit_id, &paths)?; + ctx.core.io.write(filter.id()?)?; Ok(0) } diff --git a/eden/scm/sapling/httpclient/__init__.py b/eden/scm/sapling/httpclient/__init__.py index 7d4ec98aee8a6..6939ef549cd2d 100644 --- a/eden/scm/sapling/httpclient/__init__.py +++ b/eden/scm/sapling/httpclient/__init__.py @@ -461,7 +461,7 @@ def __init__( if ssl_wrap_socket is not None: _wrap_socket = ssl_wrap_socket else: - _wrap_socket = ssl.wrap_socket + _wrap_socket = ssl.SSLContext.wrap_socket call_wrap_socket = None handlesubar = _handlesarg(_wrap_socket, "server_hostname") if handlesubar is True: @@ -470,7 +470,7 @@ def __init__( handlesnobar = _handlesarg(_wrap_socket, "serverhostname") if handlesnobar is True and handlesubar is not True: # supports serverhostname - def call_wrap_socket(sock, server_hostname=None, **ssl_opts): + def call_wrap_socket(sock, server_hostname=None, **ssl_opts): # noqa: F811 return _wrap_socket(sock, serverhostname=server_hostname, **ssl_opts) if handlesubar is False and handlesnobar is False: diff --git a/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/BUCK b/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/BUCK index 7a0679b011ced..75b9ed588a4f8 100644 --- a/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/BUCK +++ b/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/BUCK @@ -6,6 +6,15 @@ oncall("sapling") rust_python_library( name = "pyedenfsassertedstates", srcs = glob(["src/**/*.rs"]), + autocargo = { + "cargo_toml_config": { + "extra_buck_dependencies": { + "dependencies": [ + "fbsource//third-party/rust:anyhow", + ], + }, + }, + }, crate_root = "src/lib.rs", features = ["fb"], deps = [ diff --git a/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/Cargo.toml b/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/Cargo.toml index ebdc594c72289..2e01eac2f0601 100644 --- a/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/Cargo.toml +++ b/eden/scm/saplingnative/bindings/modules/pyedenfsassertedstates/Cargo.toml @@ -6,6 +6,7 @@ version = "0.1.0" edition = "2024" [dependencies] +anyhow = "1.0.98" cpython = { version = "0.7.2", features = ["python3-sys"], default-features = false } edenfs-asserted-states-client = { version = "0.1.0", path = "../../../../../fs/rust/edenfs-asserted-states-client" } sapling-configmodel = { version = "0.1.0", path = "../../../../lib/config/model" } diff --git a/eden/scm/tests/run-tests.py b/eden/scm/tests/run-tests.py index 8ab6e179ac4b2..073adc04af570 100755 --- a/eden/scm/tests/run-tests.py +++ b/eden/scm/tests/run-tests.py @@ -2913,7 +2913,7 @@ def progressrenderer(): timepassed = now - suitestart lines = [] runningfrac = 0.0 - for name, (test, teststart) in runningtests.items(): + for name, (test, teststart) in list(runningtests.items()): try: saltseen, saltcount, linenum = getattr(test, "progress") runningfrac += saltseen * 1.0 / saltcount diff --git a/eden/scm/tests/test-git-shallow.t b/eden/scm/tests/test-git-shallow.t index df43a9065b44a..83dca9da5f22a 100644 --- a/eden/scm/tests/test-git-shallow.t +++ b/eden/scm/tests/test-git-shallow.t @@ -6,6 +6,7 @@ Test client git repo with lazy blob/tree objects. $ . $TESTDIR/git.sh $ git -c init.defaultBranch=main init -q server-repo $ cd server-repo + $ git config uploadpack.allowFilter true $ SL_IDENTITY=sl drawdag << 'EOS' > B # bookmark main = B > | # B/dir/1=2\n