[Bug rust/117869] New: rust fails to build for me

2024-12-01 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117869

Bug ID: 117869
   Summary: rust fails to build for me
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: build, documentation
  Severity: normal
  Priority: P3
 Component: rust
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org,
pierre-emmanuel.patry at embecosm dot com
  Target Milestone: ---

I did a `yum install cargo` and right now rust is failing for me to build:
```
make[4]: Entering directory
'/bajas/pinskia/src/upstream-gcc-isel/gcc/objdir/libgrust/libformat_parser'
cargo \
  --config
/home/apinski/src/upstream-gcc-isel/gcc/libgrust/libformat_parser/.cargo/config
\
  build \
--offline \
--target-dir . \
--manifest-path
/home/apinski/src/upstream-gcc-isel/gcc/libgrust/libformat_parser/Cargo.toml \
# FIXME: Not always '--release', right?
warning:
/home/apinski/src/upstream-gcc-isel/gcc/libgrust/libformat_parser/Cargo.toml:
`crate_type` is deprecated in favor of `crate-type` and will not work in the
2024 edition
(in the `libformat_parser` library target)
   Compiling libc v0.2.152
   Compiling unicode-xid v0.2.4
error: the `-Z unstable-options` flag must also be passed to enable the flag
`check-cfg`
error: the `-Z unstable-options` flag must also be passed to enable the flag
`check-cfg`


error: could not compile `unicode-xid` (lib)
warning: build failed, waiting for other jobs to finish...
error: could not compile `libc` (build script)
make[4]: *** [Makefile:431: debug/liblibformat_parser.a] Error 101
make[4]: Leaving directory
'/bajas/pinskia/src/upstream-gcc-isel/gcc/objdir/libgrust/libformat_parser'
make[3]: *** [Makefile:422: all-recursive] Error 1
make[3]: Leaving directory
'/bajas/pinskia/src/upstream-gcc-isel/gcc/objdir/libgrust'
make[2]: *** [Makefile:17763: all-stage1-libgrust] Error 2
make[2]: Leaving directory '/bajas/pinskia/src/upstream-gcc-isel/gcc/objdir'
make[1]: *** [Makefile:32497: stage1-bubble] Error 2
make[1]: Leaving directory '/bajas/pinskia/src/upstream-gcc-isel/gcc/objdir'
make: *** [Makefile:1104: all] Error 2

```

Note the version of cargo is required is not documented at all on
https://gcc.gnu.org/install/prerequisites.html . I had assumed centos stream 9
would have a decent version but maybe it does not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug rust/117869] rust fails to build with cargo command error

2024-12-01 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117869

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://github.com/Rust-GCC
   ||/gccrs/issues/3116
Summary|rust fails to build for me  |rust fails to build with
   ||cargo command error

--- Comment #1 from Eric Gallager  ---
Last time I had a rust build failure related to cargo, I got pointed to this
GitHub issue: https://github.com/Rust-GCC/gccrs/issues/3116

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[PATCH] gccrs: Remove unused files

2024-12-01 Thread Owen Avery
These files only exist upstream, and were presumably either never
removed upstream or accidentally upstreamed despite being removed
downstream.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-toplevel.cc: Removed.
* typecheck/rust-hir-type-check-toplevel.h: Removed.

Signed-off-by: Owen Avery 
---
 .../typecheck/rust-hir-type-check-toplevel.cc | 378 --
 .../typecheck/rust-hir-type-check-toplevel.h  |  56 ---
 2 files changed, 434 deletions(-)
 delete mode 100644 gcc/rust/typecheck/rust-hir-type-check-toplevel.cc
 delete mode 100644 gcc/rust/typecheck/rust-hir-type-check-toplevel.h

diff --git a/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc 
b/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc
deleted file mode 100644
index 8224afb4b68..000
--- a/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc
+++ /dev/null
@@ -1,378 +0,0 @@
-// Copyright (C) 2020-2024 Free Software Foundation, Inc.
-
-// This file is part of GCC.
-
-// GCC is free software; you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3, or (at your option) any later
-// version.
-
-// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-// WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-// for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GCC; see the file COPYING3.  If not see
-// .
-
-#include "rust-hir-type-check-toplevel.h"
-#include "rust-hir-type-check-enumitem.h"
-#include "rust-hir-type-check-type.h"
-#include "rust-hir-type-check-expr.h"
-#include "rust-hir-type-check-pattern.h"
-#include "rust-hir-type-check-implitem.h"
-
-namespace Rust {
-namespace Resolver {
-
-TypeCheckTopLevel::TypeCheckTopLevel () : TypeCheckBase () {}
-
-void
-TypeCheckTopLevel::Resolve (HIR::Item &item)
-{
-  rust_assert (item.get_hir_kind () == HIR::Node::BaseKind::VIS_ITEM);
-  HIR::VisItem &vis_item = static_cast (item);
-
-  TypeCheckTopLevel resolver;
-  vis_item.accept_vis (resolver);
-}
-
-void
-TypeCheckTopLevel::visit (HIR::TypeAlias &alias)
-{
-  TyTy::BaseType *actual_type
-= TypeCheckType::Resolve (alias.get_type_aliased ().get ());
-
-  context->insert_type (alias.get_mappings (), actual_type);
-
-  for (auto &where_clause_item : alias.get_where_clause ().get_items ())
-{
-  ResolveWhereClauseItem::Resolve (*where_clause_item.get ());
-}
-}
-
-void
-TypeCheckTopLevel::visit (HIR::TupleStruct &struct_decl)
-{
-  std::vector substitutions;
-  if (struct_decl.has_generics ())
-resolve_generic_params (struct_decl.get_generic_params (), substitutions);
-
-  for (auto &where_clause_item : struct_decl.get_where_clause ().get_items ())
-{
-  ResolveWhereClauseItem::Resolve (*where_clause_item.get ());
-}
-
-  std::vector fields;
-  size_t idx = 0;
-  for (auto &field : struct_decl.get_fields ())
-{
-  TyTy::BaseType *field_type
-   = TypeCheckType::Resolve (field.get_field_type ().get ());
-  TyTy::StructFieldType *ty_field
-   = new TyTy::StructFieldType (field.get_mappings ().get_hirid (),
-std::to_string (idx), field_type,
-field.get_locus ());
-  fields.push_back (ty_field);
-  context->insert_type (field.get_mappings (), ty_field->get_field_type 
());
-  idx++;
-}
-
-  // get the path
-  const CanonicalPath *canonical_path = nullptr;
-  bool ok = mappings->lookup_canonical_path (
-struct_decl.get_mappings ().get_nodeid (), &canonical_path);
-  rust_assert (ok);
-  RustIdent ident{*canonical_path, struct_decl.get_locus ()};
-
-  // its a single variant ADT
-  std::vector variants;
-  variants.push_back (new TyTy::VariantDef (
-struct_decl.get_mappings ().get_hirid (), struct_decl.get_identifier (),
-ident, TyTy::VariantDef::VariantType::TUPLE, nullptr, std::move (fields)));
-
-  // Process #[repr(X)] attribute, if any
-  const AST::AttrVec &attrs = struct_decl.get_outer_attrs ();
-  TyTy::ADTType::ReprOptions repr
-= parse_repr_options (attrs, struct_decl.get_locus ());
-
-  TyTy::BaseType *type
-= new TyTy::ADTType (struct_decl.get_mappings ().get_hirid (),
-mappings->get_next_hir_id (),
-struct_decl.get_identifier (), ident,
-TyTy::ADTType::ADTKind::TUPLE_STRUCT,
-std::move (variants), std::move (substitutions), repr);
-
-  context->insert_type (struct_decl.get_mappings (), type);
-}
-
-void
-TypeCheckTopLevel::visit (HIR::Module &module)
-{
-  for (auto &item : module.get_items ())
-TypeCheckTopLevel::Resolve (*item.get ());
-}
-
-void
-TypeCheckTopLevel::visit (HIR::StructStruct &struct_decl)
-{
-  std::vector substitutions;
-  if (struct_decl.