Comments (5)
Further when trying to create a patch with bender vendor patch
, after staging an untracked file (Makefile
in this example), it fails with the following error:
error: Could not apply staged changes on top of patched upstream repository. Did you commit all previously patched modifications? Git command (Command { std: cd "/tmp/.tmpNv0osW" && "git" "apply" "--directory" "" "-p1" "/tmp/.tmp0UG66v/staged.diff", kill_on_drop: false }) in directory "/tmp/.tmpNv0osW" failed with exit code 1:
error: Makefile: already exists in working directory
from bender.
I tried to circumvent the previous error by creating a patch with the following command, executed in the vendored target_dir
:
git format-patch --relative -o <relative_path_to_patch_dir> HEAD^1
However, when running bender vendor init
it fails with the following error:
Cloning musl (https://github.com/kraj/musl.git)
Copying musl files from upstream
Patching musl with 0001-musl-Patch-to-adapt-to-Snitch.patch
error: Failed to apply patch "/scratch/colluca/workspace/CLSPLIT/snitch_cluster/sw/deps/patches/musl/0001-musl-Patch-to-adapt-to-Snitch.patch". Git command (Command { std: cd "/tmp/.tmppMR4Uf" && "git" "apply" "--directory" "" "-p1" "/scratch/colluca/workspace/CLSPLIT/snitch_cluster/sw/deps/patches/musl/0001-musl-Patch-to-adapt-to-Snitch.patch", kill_on_drop: false }) in directory "/tmp/.tmppMR4Uf" failed with exit code 1:
error: Makefile: already exists in working directory
At this point I believe this is a bug, as there doesn't seem to be a way to use bender vendor
for dependencies which need to be extended with additional files.
from bender.
To properly circumvent this issue, you may need to first commit the cloned files (before doing modifications). Alternatively, you should be able to use the --plain
flag to generate a patch based on a simple diff.
from bender.
I did commit the cloned files before doing the modifications. And I tried the --plain
flag, with which the command at least doesn't fail. But it still fails to include the untracked files to the patch (even if they are staged). And I believe this is a problem because rerunning bender vendor init
, would then delete these files.
from bender.
The issue is solved by adding the untracked files to the include_from_upstream
attribute in the Bender.yml
file.
The problem was due to a misunderstanding of the patch creation and application process. Patches are applied to the upstream dependency. When creating a new file (not in the include_from_upstream
list) with the same name as a file which exists upstream, a conflict occurs, expectedly leading to the observed error:
error: Makefile: already exists in working directory
The remote sources are vendored-in after patch application on the remote. Only files listed in include_from_upstream
are copied locally. Therefore, if you create a new file as part of a patch, you should also list this under include_from_upstream
.
from bender.
Related Issues (20)
- Issue warning when file to include from upstream is not found HOT 1
- vendor_package files are not added as source HOT 1
- Bender not updating git dependencies that have already been cloned HOT 1
- Possibility to release a build for macOS? HOT 2
- `plugins:` will be deprecated? HOT 3
- using environment variables in path dependencies HOT 2
- Citing bender
- Bug in `release.yaml`
- Bender ignores version tags HOT 2
- Package with only include_dirs doesn't work HOT 4
- Defines assumed to be string values, not numerical values
- VCS compile script doesn't propagate errors
- package filtering may fail HOT 1
- Tabs vs spaces HOT 3
- overrides doesn't seem to work in specifying a different branch - what am I doing wrong? HOT 4
- Why does `bender` look upward for a `Bender.local` even if it is run in a Bender repo?
- Latest release not available for platform 'x86_64-linux-gnu-pop22.04' HOT 1
- Error: Latest release not available for platform 'x86_64-linux-gnu-ubuntu24.04'! HOT 1
- `flist` and `flist-plus` documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bender.