D 2024-02-05 07:25:41.007384+00:00 Params: [('source_key', 'agdicmlk...'), ('last_polled', '2024-02-05-01-51-43')]
I 2024-02-05 07:25:41.037344+00:00 Source: ralismark (GitHub) ralismark, https://brid.gy/github/ralismark
I 2024-02-05 07:25:41.037788+00:00 Last poll: https://brid.gy/log?start_time=1707097903&key=agdicmlkLWd5chULEgZHaXRIdWIiCXJhbGlzbWFyaww
I 2024-02-05 07:25:41.060347+00:00 Updating ralismark (GitHub) /github/ralismark : {'poll_status': 'polling', 'last_poll_attempt': datetime.datetime(2024, 2, 5, 7, 25, 41, 37917, tzinfo=datetime.timezone.utc), 'rate_limited': False}
D 2024-02-05 07:25:41.148924+00:00 Using ETag Sun, 04 Feb 2024 21:26:27 GMT, last activity id swaywm:sway:7226
I 2024-02-05 07:25:41.177211+00:00 no refresh_token
I 2024-02-05 07:25:41.177895+00:00 requests.get https://api.github.com/notifications?all=true&participating=true&per_page=10 {'headers': {'If-Modified-Since': '...', 'Authorization': '...'}}
I 2024-02-05 07:25:41.520964+00:00 Received 200
I 2024-02-05 07:25:41.521298+00:00 requests.get https://api.github.com/repos/rust-lang/cargo/issues/11156 {'headers': {'Authorization': '...'}}
I 2024-02-05 07:25:41.814467+00:00 Received 200
I 2024-02-05 07:25:41.817313+00:00 requests.get https://api.github.com/repos/rust-lang/cargo/issues/11156/comments?since=2024-02-04T21:26:27Z {'headers': {'Authorization': '...'}}
I 2024-02-05 07:25:42.084759+00:00 Received 200
I 2024-02-05 07:25:42.087429+00:00 requests.get https://api.github.com/repos/rust-lang/cargo/issues/11156/reactions {'headers': {'Authorization': '...'}}
I 2024-02-05 07:25:42.501454+00:00 Received 200
I 2024-02-05 07:25:42.508130+00:00 Found 1 public activities: dict_keys(['tag:github.com,2013:rust-lang:cargo:11156'])
I 2024-02-05 07:25:42.508334+00:00 Found 0 private activities: dict_keys([])
D 2024-02-05 07:25:42.510800+00:00 activity[content] I've implemented a quick hack for this case:
```bash
export RUST_BUILD_BASE="$HOME/.cache/rust-builds"
WORKSPACE_ROOT=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".workspace_root")
PACKAGE_BASENAME=$(basename $WORKSPACE_ROOT)
TARGET_DIRECTORY=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".target_directory")
# Check if target has default location
if [ $TARGET_DIRECTORY == "$WORKSPACE_ROOT/target" ]; then
# Run cargo with target to $RUST_BUILD_BASE/$PACKAGE_BASENAME
CARGO_TARGET_DIR="$RUST_BUILD_BASE/$PACKAGE_BASENAME" cargo $@
else
# Do nothing, if target dir is configured to smth non-default
cargo $@
fi
``` => I've implemented a quick hack for this case:
```bash
export RUST_BUILD_BASE="$HOME/.cache/rust-builds"
WORKSPACE_ROOT=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".workspace_root")
PACKAGE_BASENAME=$(basename $WORKSPACE_ROOT)
TARGET_DIRECTORY=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".target_directory")
# Check if target has default location
if [ $TARGET_DIRECTORY == "$WORKSPACE_ROOT/target" ]; then
# Run cargo with target set to $RUST_BUILD_BASE/$PACKAGE_BASENAME
CARGO_TARGET_DIR="$RUST_BUILD_BASE/$PACKAGE_BASENAME" cargo $@
else
# Do nothing, target dir is configured to smth non-default
cargo $@
fi
```
D 2024-02-05 07:25:42.510995+00:00 discovering original posts for: https://github.com/rust-lang/cargo/issues/11156
I 2024-02-05 07:25:42.511810+00:00 requests.head https://github.com/rust-lang/cargo/labels/A-configuration {'headers': {}}
I 2024-02-05 07:25:42.930576+00:00 Received 404
W 2024-02-05 07:25:42.930866+00:00 Couldn't resolve URL https://github.com/rust-lang/cargo/labels/A-configuration: https://github.com/rust-lang/cargo/labels/A-configuration
I 2024-02-05 07:25:42.931115+00:00 requests.head https://github.com/rust-lang/cargo/labels/C-feature-request {'headers': {'User-Agent': '...'}}
I 2024-02-05 07:25:43.334859+00:00 Received 404
W 2024-02-05 07:25:43.335111+00:00 Couldn't resolve URL https://github.com/rust-lang/cargo/labels/C-feature-request: https://github.com/rust-lang/cargo/labels/C-feature-request
I 2024-02-05 07:25:43.335340+00:00 requests.head https://docs.oracle.com/cd/E19253-01/819-5461/gbciq/index.html {'headers': {'User-Agent': '...'}}
I 2024-02-05 07:25:43.799712+00:00 Received 200
I 2024-02-05 07:25:43.800112+00:00 requests.head https://doc.rust-lang.org/rustc/command-line-arguments.html#--remap-path-prefix-remap-source-names-in-output {'headers': {'User-Agent': '...'}}
I 2024-02-05 07:25:44.008402+00:00 Received 200
I 2024-02-05 07:25:44.009165+00:00 requests.head https://github.com/rust-lang/cargo/compare/master...alepez:cargo:build-dir-prefix {'headers': {'User-Agent': '...'}}
I 2024-02-05 07:25:45.678492+00:00 Received 200
I 2024-02-05 07:25:45.679013+00:00 Original post discovery found original posts set(), mentions {'https://github.com/rust-lang/cargo/compare/master...alepez:cargo:build-dir-prefix', 'https://github.com/rust-lang/cargo/labels/A-configuration', 'https://github.com/rust-lang/cargo/labels/C-feature-request', 'https://docs.oracle.com/cd/E19253-01/819-5461/gbciq/index.html', 'https://doc.rust-lang.org/rustc/command-line-arguments.html#--remap-path-prefix-remap-source-names-in-output'}
I 2024-02-05 07:25:45.682231+00:00 requests.head https://github.com/rust-lang/cargo/issues/11156 {'headers': None}
I 2024-02-05 07:25:46.884557+00:00 Received 200
I 2024-02-05 07:25:46.884996+00:00 starting posse post discovery with syndicated https://github.com/rust-lang/cargo/issues/11156
D 2024-02-05 07:25:47.062800+00:00 activity[content] I've implemented a quick hack for this case:
```bash
export RUST_BUILD_BASE="$HOME/.cache/rust-builds"
WORKSPACE_ROOT=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".workspace_root")
PACKAGE_BASENAME=$(basename $WORKSPACE_ROOT)
TARGET_DIRECTORY=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".target_directory")
# Check if target has default location
if [ $TARGET_DIRECTORY == "$WORKSPACE_ROOT/target" ]; then
# Run cargo with target to $RUST_BUILD_BASE/$PACKAGE_BASENAME
CARGO_TARGET_DIR="$RUST_BUILD_BASE/$PACKAGE_BASENAME" cargo $@
else
# Do nothing, if target dir is configured to smth non-default
cargo $@
fi
``` => I've implemented a quick hack for this case:
```bash
export RUST_BUILD_BASE="$HOME/.cache/rust-builds"
WORKSPACE_ROOT=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".workspace_root")
PACKAGE_BASENAME=$(basename $WORKSPACE_ROOT)
TARGET_DIRECTORY=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r ".target_directory")
# Check if target has default location
if [ $TARGET_DIRECTORY == "$WORKSPACE_ROOT/target" ]; then
# Run cargo with target set to $RUST_BUILD_BASE/$PACKAGE_BASENAME
CARGO_TARGET_DIR="$RUST_BUILD_BASE/$PACKAGE_BASENAME" cargo $@
else
# Do nothing, target dir is configured to smth non-default
cargo $@
fi
```
I 2024-02-05 07:25:47.063243+00:00 Response changed! Re-propagating. Original: Response(key=Key('Response', 'tag:github.com,2013:rust-lang:cargo:IC_kwDOAQnScc5yy0Eq'), activities_json=['{"id":"tag:github.com,2013:rust-lang:cargo:11156","url":"https://github.com/rust-lang/cargo/issues/11156","content":"### Problem\\n\\nI\'m using ZFS filesystem, which has an [instant snapshot feature](https://docs.oracle.com/cd/E19253-01/819-5461/gbciq/index.html) very useful for disaster recovery. I use this feature to automatically make snapshots of my projects. The snapshot is applied to the whole ZFS dataset and there is no way to exclude certain directories.\\n\\nThe problem with Rust projects is that they may have many files in the `target` directory (which is usually inside the project directory). File under target directory change often (e.g. when re-building) and can be effortlessly recreated. So they don\'t fit well with ZFS automatic snapshotting system.\\n\\nSimilar problem exists if someone wants to always use a different disk or partition for target directories (which are frequently changed, effortlessly recoverable, unlike the source code).\\n\\nI could override `CARGO_TARGET_DIR` environment variable, but I would need to remember to do it for every every project.\\n\\nI could create an alias of `cargo` which automatically overrides `CARGO_TARGET_DIR`, but it would also override whatever is set as target directory in the config.toml, which can cause unpredictable issues.\\n\\n### Proposed Solution\\n\\nI propose to add the environmental variable `CARGO_TARGET_DIR_REMAP` which let the user remap where target dir should be created.\\n\\nExample: crate is in `/home/user/projects/foo` and default target directory is in `/home/user/projects/foo/target`. Setting `CARGO_TARGET_DIR_REMAP=/home/user/projects=/tmp/cargo-build` should change the real target directory so it becomes `/tmp/cargo-build/foo/target`\\n\\nThe syntax is inspired by [rustc command line argument `--remap-path-prefix`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--remap-path-prefix-remap-source-names-in-output)\\n\\n### Notes\\n\\nI\'ve already experimented with [a possible implementation](https://github.com/rust-lang/cargo/compare/master...alepez:cargo:build-dir-prefix).. This is a simple working patch.\\n\\n```patch\\ndiff --git a/src/cargo/util/config/mod.rs b/src/cargo/util/config/mod.rs\\nindex fddd47acb..5bc0c94ba 100644\\n--- a/src/cargo/util/config/mod.rs\\n+++ b/src/cargo/util/config/mod.rs\\n@@ -518,6 +518,13 @@ impl Config {\\n }\\n \\n Ok(Some(Filesystem::new(path)))\\n+ } else if let Some(remap) = self.env.get(\\"CARGO_TARGET_DIR_REMAP\\") {\\n+ remap_target_dir(remap, self.cwd.clone())\\n+ .map(|dir| Some(Filesystem::new(dir)))\\n+ .map_err(|err| anyhow!(\\n+ \\"the target directory remap is not valid in the \\\\\\n+ `CARGO_TARGET_DIR_REMAP` environment variable. reason: {}\\", err)\\n+ )\\n } else {\\n Ok(None)\\n }\\n@@ -2459,3 +2466,45 @@ macro_rules! drop_eprint {\\n $crate::__shell_print!($config, err, false, $($arg)*)\\n );\\n }\\n+\\n+fn remap_target_dir(remap: &str, mut path: PathBuf) -> CargoResult<PathBuf> {\\n+ let (from, to) = remap.split_once(\'=\')\\n+ .ok_or_else(|| anyhow!(\\"must be a value of the form FROM=TO\\"))?;\\n+\\n+ // Change the path only if it starts with the `from` prefix\\n+ if path.starts_with(from) {\\n+ let relative = path.strip_prefix(from)?;\\n+ path = PathBuf::from(to).join(relative);\\n+ }\\n+\\n+ Ok(path)\\n+}\\n+\\n+#[cfg(test)]\\n+mod tests {\\n+ use super::*;\\n+\\n+ #[test]\\n+ fn test_remap_target_dir_start() {\\n+ let original_path = PathBuf::from(\\"/foo/bar/baz\\");\\n+ let remap = String::from(\\"/foo/bar=/new/target/prefix\\");\\n+ let remapped = remap_target_dir(&remap, original_path);\\n+ assert_eq!(PathBuf::from(\\"/new/target/prefix/baz\\"), remapped.unwrap());\\n+ }\\n+\\n+ #[test]\\n+ fn test_remap_target_dir_different_start_unchanged() {\\n+ let original_path = PathBuf::from(\\"/baz/foo/bar/baz\\");\\n+ let remap = String::from(\\"/foo/bar=/new/target/prefix\\");\\n+ let remapped = remap_target_dir(&remap, original_path);\\n+ assert_eq!(PathBuf::from(\\"/baz/foo/bar/baz\\"), remapped.unwrap());\\n+ }\\n+\\n+ #[test]\\n+ fn test_remap_target_dir_invalid_syntax() {\\n+ let original_path = PathBuf::from(\\"/baz/foo/bar/baz\\");\\n+ let remap = String::from(\\"/new/target/prefix\\");\\n+ let remapped = remap_target_dir(&remap, original_path);\\n+ assert!(remapped.is_err());\\n+ }\\n+}\\n\\\\ No newline at end of file\\n\\n```"}'], created=DatetimeWithNanoseconds(2024, 2, 5, 1, 51, 51, 582653, tzinfo=datetime.timezone.utc), error=[], failed=[], leased_until=None, old_response_jsons=[], original_posts=[], response_json='{"id":"tag:github.com,2013:rust-lang:cargo:IC_kwDOAQnScc5yy0Eq","url":"https://github.com/rust-lang/cargo/issues/11156#issuecomment-1925923114","author":{"id":"tag:github.com,2013:MDQ6VXNlcjIxMDY3Nzc0","url":"https://github.com/totikom","displayName":"totikom","objectType":"person","username":"totikom","image":{"url":"https://avatars.githubusercontent.com/u/21067774?v=4"}},"content":"I\'ve implemented a quick hack for this case:\\n```bash\\nexport RUST_BUILD_BASE=\\"$HOME/.cache/rust-builds\\"\\nWORKSPACE_ROOT=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r \\".workspace_root\\")\\nPACKAGE_BASENAME=$(basename $WORKSPACE_ROOT)\\nTARGET_DIRECTORY=$(cargo metadata --no-deps --offline 2>/dev/null | jq -r \\".target_directory\\")\\n\\n# Check if target has default location\\nif [ $TARGET_DIRECTORY == \\"$WORKSPACE_ROOT/target\\" ]; then\\n # Run cargo with target to $RUST_BUILD_BASE/$PACKAGE_BASENAME\\n CARGO_TARGET_DIR=\\"$RUST_BUILD_BASE/$PACKAGE_BASENAME\\" cargo $@\\nelse\\n # Do nothing, if target dir is configured to smth non-default\\n cargo $@\\nfi\\n```","published":"2024-02-04T21:26:17+00:00","updated":"2024-02-04T21:26:17+00:00","objectType":"comment","inReplyTo":[{"url":"https://github.com/rust-lang/cargo/issues/11156"}]}', sent=[], skipped=[], source=Key('GitHub', 'ralismark'), status='complete', type='comment', unsent=[], updated=datetime.datetime(2024, 2, 5, 7, 25, 47, 11560, tzinfo=datetime.timezone.utc), urls_to_activity=None)
I 2024-02-05 07:25:47.256703+00:00 Added propagate task projects/brid-gy/locations/us-central1/queues/propagate/tasks/9056303766698791384 with ETA None: {'app_engine_http_request': {'http_method': 'POST', 'relative_uri': '/_ah/queue/propagate', 'body': b'response_key=agdicmlkLWd5ckULEghSZXNwb25zZSI3dGFnOmdpdGh1Yi5jb20sMjAxMzpydXN0LWxhbmc6Y2FyZ286SUNfa3dET0FRblNjYzV5eTBFcQw', 'headers': {'Content-Type': 'application/x-www-form-urlencoded'}}}
I 2024-02-05 07:25:47.257219+00:00 skipping refetch h-feed. last-syndication-url 2024-01-25 11:45:07.995373+00:00, last-refetch 2024-02-05 01:51:57.381984+00:00
I 2024-02-05 07:25:47.286588+00:00 Updating ralismark (GitHub) /github/ralismark : {'recent_private_posts': 0, 'last_polled': datetime.datetime(2024, 2, 5, 7, 25, 41, 37917, tzinfo=datetime.timezone.utc), 'poll_status': 'ok', 'last_activities_etag': 'Mon, 05 Feb 2024 05:54:42 GMT'}
I 2024-02-05 07:25:47.467605+00:00 Added poll task projects/brid-gy/locations/us-central1/queues/poll/tasks/0313111792608451719 with ETA 1707137850: {'app_engine_http_request': {'http_method': 'POST', 'relative_uri': '/_ah/queue/poll', 'body': b'source_key=agdicmlkLWd5chULEgZHaXRIdWIiCXJhbGlzbWFyaww&last_polled=2024-02-05-07-25-41', 'headers': {'Content-Type': 'application/x-www-form-urlencoded'}}, 'schedule_time': seconds: 1707137850
}