-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
243 lines (142 loc) · 6.48 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
---
format:
revealjs:
width: 1290
height: 720
progress: true
incremental: false
preview-links: auto
logo: logo.png
footer: "[https://startrooper08.github.io/latinR-lightningtalk-2024/](https://startrooper08.github.io/latinR-lightningtalk-2024/)"
---
## {.center}
::: rows
::: row
![](logo.png)
:::
::: r-fit-text
**Making Code Contributions Seamless**
:::
::: row
with **R Dev Container**
:::
::: dateplace
18th November 2024 \@ **LatinR 2024**
:::
:::
## Little Bit About me
::: columns
::: {.column width="70%"}
::: nonincremental
- 👋 Hi Everyone, I'm **Atharva Shirdhankar** a **Backend and DevOps enthusiast**, with a passion for **seamless systems** and tech **tinkering** with **Raspberry Pi**!
- 💻 2x **Google Summer of Code Mentee 2023 and 2024 @R project for statistical computing**
- 📈 2x **Devto Hackathon Runner-Up** (Github Actions 2021, Azure Trail 2022)
- 🔗 Lets Connect :
[Linkedin/**@atharvashirdhankar**](https://www.linkedin.com/in/atharvashirdhankar/)
[Github/**@StarTrooper08**](https://github.com/StarTrooper08)
:::
:::
::: {.column width="30%"}
![](selfintro.gif)
:::
:::
## About the R Dev Container Project
::: nonincremental
- **Tech Stack**: R Dev Container is built with Linux, Bash, and Docker, designed for seamless integration with GitHub Codespaces and Gitpod.
::: {style="text-align: center; margin-top: 0.2em"}
<img src="https://img.icons8.com/color/48/linux--v1.png" alt="linux--v1" width="48" height="48"/>
<img src="https://img.icons8.com/color/48/bash.png" alt="bash" width="48" height="48"/>
<img src="https://img.icons8.com/doodle/48/docker.png" alt="docker" width="48" height="48"/>
:::
- **Goal**: Enable a quick, seamless setup of the R development environment, allowing contributors to start coding with just a few clicks.
- **Benefit**: Lowers the entry barrier for new contributors, reducing setup friction and making it easier to contribute to the R project.
:::
## R Dev Container Quick Setup{.scrollable}
- Visit the R Dev Container [https://github.com/r-devel/r-dev-env](https://github.com/r-devel/r-dev-env){preview-link="true"}.
- Click on Code button and change the tab to Codespaces ![](resources/ss1.png){width="750" height="400"}
- After that Click on "Create Codespace on main"![](resources/ss2.png){width="900" height="500"}
- You can also run R program. To do so, you need to click on R: not attached option in status bar(botton right). This will open up a R interactive console.
![](resources/ss3.png){width="400" height="300"}
- Just create a R file and run it using the run button on the top beside file tabs.
![](resources/ss4.png){width="750" height="400"}
## {.center background-video="projectdemo.mp4" background-video-loop="true" background-video-muted="true" background-opacity=0.2}
::: {.r-fit-text}
R Contribution Workflow
:::
## Find a Bug Report on Bugzilla{.center}
- [R Bugzilla](https://bugs.r-project.org/buglist.cgi?bug_status=__open__) - Open bug report list
![](resources/ss8.png){width="550" height="300"}
- Example Bug - [18810](https://bugs.r-project.org/show_bug.cgi?id=18810) "Improve error for readRDS by including filename". Potential Solution to this issue is also mentioned by Jeroen Ooms in the discussion.
## Building R{.center}
- To build R we can just follow easy steps mentioned in [R Dev Container Building R Docs](https://contributor.r-project.org/r-dev-env/tutorials/building_r/){preview-link="true"}.
## {}
**Bug Report Statement**
- readRDS errors do not indicate the filename or connection source, leading to generic "error reading from connection" messages.
```{.r}
install.packages('MASS')
rdsfile <- system.file('Meta/links.rds', package = 'MASS')
unlink(rdsfile)
file.create(rdsfile) #create corrupted file
tools::findHTMLlinks() #errors without clues
```
Output with Error msg
```txt {code-line-numbers="8"}
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (MASS)
The downloaded source packages are in
‘/tmp/RtmpMuQ5kv/downloaded_packages’
[1] TRUE
Error in readRDS(f) : error reading from connection
```
## Code Contribution
- Updating `readRDS()` function in `src/library/base/R/serialize.R` file.
```{.r code-line-numbers="|5|7-9"}
} else if (inherits(file, "connection"))
con <- if(inherits(file, "url")) gzcon(file) else file
else stop("bad 'file' argument")
.Internal(unserializeFromConn(con, refhook))
tryCatch(.Internal(unserializeFromConn(con, refhook)), error = function(err){
err$message <- paste(err$message, "in", summary(con)$description)
stop(err)
})
}
```
## Building R again with new Changes
- After we have made relevant changes we can just use the following commands to build R again with latest changes.
```bash
cd $BUILDDIR
make
make check
```
- Error msg after making relevant changes
```txt {code-line-numbers="9"}
* DONE (MASS)
The downloaded source packages are in
‘/tmp/RtmpsOVPcD/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
[1] TRUE
Error in doTryCatch(return(expr), name, parentenv, handler) :
error reading from connection in /workspace/r-dev-env/build/r-rdevel/library/MASS/Meta/links.rds
```
## Patch file
- create a patch file for the code changes made. The following command will save the changes made in source code in $PATCHDIR directory.
```{.bash}
cd $TOP_SRCDIR
svn diff > $PATCHDIR/patch.diff
```
![](resources/ss5.png){width="700" height="400"}
## Submit Patch File
![](resources/ss9.png){width="900" height="500"}
## Special Mentions
::: nonincremental
- R Dev Container project Mentors : **Heather Turner, James Tripp, Iain Emsley**
- A [Blogpost](https://www.dicook.org/posts/2024-07-14-r-devel/){preview-link="true"} on Fixing R graphics issues during R Dev Day Austria(July 2024) using R Dev Container - by **Di Cook** .
- Some amazing contributors who helped us bring this project all together by contributing to docs, giving feedback and helping out in finding solutions
**Elio Campitelli, Lorena Abad Crespo, Robert (Bob) Turner and Dan Brady**
:::
## Resources{.center}
**R Dev Container Repo** : [https://github.com/r-devel/r-dev-env](https://github.com/r-devel/r-dev-env)
**R Dev Container Docs** : [https://contributor.r-project.org/r-dev-env/](https://contributor.r-project.org/r-dev-env/)
**R Slack Channel** : [https://r-contributors.slack.com/](https://r-contributors.slack.com/)