Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cargo build into the GCC build directory #2883

Closed
tschwinge opened this issue Feb 27, 2024 · 5 comments · Fixed by #2947
Closed

Move cargo build into the GCC build directory #2883

tschwinge opened this issue Feb 27, 2024 · 5 comments · Fixed by #2947
Assignees
Labels
upstream Issue regarding upstreaming gccrs into GCC

Comments

@tschwinge
Copy link
Member

As of #2822 "Start reusing rustc's format_args parser", the build fails if the GCC sources are read-only:

[...]
make[3]: Entering directory '[...]/build-gcc/gcc'
cargo build --manifest-path [...]/source-gcc/gcc/../libgrust/libformat_parser/Cargo.toml --release # FIXME: Not always release, right?
error: Permission denied (os error 13) at path "[...]/source-gcc/libgrust/libformat_parser/target9JZnmI"
make[3]: *** [[...]/source-gcc/gcc/rust/Make-lang.in:411: rust/libformat_parser.a] Error 101
[...]

Those builds need to be done in the GCC build directory.

(..., and then revert commit e3fca6f "git: Ignore libgrust build folders".)

@tschwinge
Copy link
Member Author

@CohenArthur, is there a specific reason why the cargo build is done via gcc/rust/Make-lang.in instead of via the host (only, right?) libgrust build?

@tschwinge tschwinge self-assigned this Feb 28, 2024
@CohenArthur
Copy link
Member

@tschwinge no specific reason - I wanted to get something done and working, and didn't think too much about the build system :)

@CohenArthur CohenArthur added the upstream Issue regarding upstreaming gccrs into GCC label Mar 1, 2024
@CohenArthur CohenArthur added this to the GCC 14.1 release milestone Mar 1, 2024
@tschwinge
Copy link
Member Author

ACK. I have a patch (but first need to sort out other things as a prerequisite).

@tschwinge
Copy link
Member Author

(I hope that later this week I'll be able to complete this.)

@CohenArthur
Copy link
Member

@tschwinge not sure if you're aware, but cargo has a --target-dir option for all generated files (as well as --out-dir, which could replace our dodgy cp command here): https://doc.rust-lang.org/cargo/commands/cargo-build.html#output-options

tschwinge added a commit that referenced this issue Apr 11, 2024
Fixes #2883.

	* .gitignore: Remove 'libgrust/*/target/'.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
tschwinge added a commit that referenced this issue Apr 11, 2024
Addresses #2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
github-merge-queue bot pushed a commit that referenced this issue Apr 16, 2024
Fixes #2883.

	* .gitignore: Remove 'libgrust/*/target/'.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
github-merge-queue bot pushed a commit that referenced this issue Apr 16, 2024
Addresses #2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Apr 23, 2024
Fixes Rust-GCC#2883.

	* .gitignore: Remove 'libgrust/*/target/'.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Apr 23, 2024
Addresses Rust-GCC#2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Aug 1, 2024
Fixes Rust-GCC#2883.

gcc/rust/ChangeLog:
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
CohenArthur pushed a commit to CohenArthur/gccrs that referenced this issue Aug 1, 2024
Addresses Rust-GCC#2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
tschwinge added a commit that referenced this issue Dec 4, 2024
Fixes #2883.

	* .gitignore: Remove 'libgrust/*/target/'.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to the GCC build
	directory.
	* ($(LIBFORMAT_PARSER)): Build in the GCC build directory.
tschwinge added a commit that referenced this issue Dec 4, 2024
Addresses #2883.

	contrib/
	* gcc_update (files_and_dependencies): Update for
	'libformat_parser' in libgrust.
	gcc/rust/
	* Make-lang.in (LIBFORMAT_PARSER): Point to 'libformat_parser'
	build in libgrust.
	(%.toml:, $(LIBFORMAT_PARSER):): Remove.
	libgrust/
	* libformat_parser/Makefile.am: New.
	* Makefile.am [!TARGET_LIBRARY] (SUBDIRS): Add 'libformat_parser'.
	* configure.ac: Handle it.
	(TARGET_LIBRARY): New 'AM_CONDITIONAL'.
	* libformat_parser/Makefile.in: Generate.
	* Makefile.in: Regenerate.
	* configure: Likewise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Issue regarding upstreaming gccrs into GCC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants